Page 1 of 1

Espeasy to trigger event on another device (sonoff)

Posted: 30 Sep 2017, 11:38
by MsbS
I have an ESPEASY D1 mini with IR receiver and a Sonoff switch (flashed with espeasy too).
I want to create a rule in espeasy to trigger event on sonoff. Basically: I press a button on remote, IR receiver picks this, Espeasy runs a rule and triggers the action: sends event to sonoff. Sonoff receives event and switches the lamp on or off.

Sonoff has 2 events defined: lamp_on and lamp_off.
What should I create as action on espeasy? Currently I have something like:

on IR#IR=16712445 do
sendTo 1,event,lamp_on
endon

I also tried sendToHTTP 192.168.1.XYZ,80,control?cmd=event,lamp_on

What is the right way?

I know the trigger works OK (from reviewing the log - Event is triggered), but I don't know how to write the Action part.


EDIT: OK, I now understood the syntax, I just found the json example from wiki confusing at first. It turns out slash is crucial:

sendToHTTP 192.168.1.XYZ,80,/control?cmd=event,lamp_on