Schedule IRSend

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
nrgz28
New user
Posts: 3
Joined: 15 Jan 2021, 20:20

Schedule IRSend

#1 Post by nrgz28 » 15 Jan 2021, 20:24

Hello everyone. I've got a simple question about using the IRSEND function... How can I schedule sending IR codes locally on the ESP ? Doing something like the below code doesn't work, no matter what I do.

On System#Boot do
timerSet,1,60
endon

On Rules#Timer=1 do
SendToHTTP,10.2.3.152,80,'/control?cmd=IRSEND,NEC,0x5D0540BF,32'
SendToHTTP,10.2.3.152,80,'/control?cmd=IRSEND,NEC,0X5D05C03F,32'
timerSet,1,120
endon

I read a post, talking about using Sendtohttp to send IRcodes in rules, not working, due to the fact that the chip can't listen to http requests while it's executing one.

Is there another way I can invoke the IRSEND function and schedule it ?

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Schedule IRSend

#2 Post by TD-er » 15 Jan 2021, 20:46

If the code is already known, you can program it in the rules running on the IRsend node.
Then you simply must trigger an event on that node to execute that part of the code.

Events can be sent via lots of ways, like HTTP, MQTT or the p2p protocol.

nrgz28
New user
Posts: 3
Joined: 15 Jan 2021, 20:20

Re: Schedule IRSend

#3 Post by nrgz28 » 15 Jan 2021, 22:52

TD-er wrote: 15 Jan 2021, 20:46 If the code is already known, you can program it in the rules running on the IRsend node.
Then you simply must trigger an event on that node to execute that part of the code.

Events can be sent via lots of ways, like HTTP, MQTT or the p2p protocol.
That's what I'm asking... How do I use the IRSend function in the rules without resorting to the SendHTTP workaround ?

nrgz28
New user
Posts: 3
Joined: 15 Jan 2021, 20:20

Re: Schedule IRSend

#4 Post by nrgz28 » 15 Jan 2021, 22:58

Nevermind! This seems to work now for some reason.. while yesterday for a couple hours all I was getting in the logs was "command unknown" for IRSEND.. wtf!! hehe

On System#Boot do
timerSet,1,10
endon

On Rules#Timer=1 do
IRSEND NEC 0x5D0540BF
IRSEND NEC 0X5D05C03F
timerSet,1,5
endon

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Schedule IRSend

#5 Post by TD-er » 16 Jan 2021, 00:27

Ah the new feature added yesterday is already being used :) (the 0x hex notation)

Better to use a comma instead of a space, since using > 2 spaces may cause issues (or a tab) to determine what parameter it is.

Post Reply

Who is online

Users browsing this forum: No registered users and 41 guests