Espeasy to trigger event on another device (sonoff)

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
MsbS
New user
Posts: 3
Joined: 28 Sep 2017, 21:57

Espeasy to trigger event on another device (sonoff)

#1 Post by MsbS » 30 Sep 2017, 11:38

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

Who is online

Users browsing this forum: Anthropic Claude Bot [bot], opensiteexplorer.org/dotbot [bot] and 15 guests