Page 1 of 1

Schedule IRSend

Posted: 15 Jan 2021, 20:24
by nrgz28
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 ?

Re: Schedule IRSend

Posted: 15 Jan 2021, 20:46
by TD-er
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.

Re: Schedule IRSend

Posted: 15 Jan 2021, 22:52
by nrgz28
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 ?

Re: Schedule IRSend

Posted: 15 Jan 2021, 22:58
by nrgz28
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

Re: Schedule IRSend

Posted: 16 Jan 2021, 00:27
by TD-er
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.