EVENT call from MQTT
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 73
- Joined: 30 Nov 2017, 18:29
EVENT call from MQTT
Hi,
I am building my first project integrating ESPEASY and OPENHAB2.
I would like to understand how I can send and event call from MQTT.
In other words, I would like to trigger a rule from MQTT.
I know how it can be done using http: http://<espeasyip>/control?cmd=event,remoteTimerControl=5
But I need to do in MQTT.
How can this be achieved?
thanks
I am building my first project integrating ESPEASY and OPENHAB2.
I would like to understand how I can send and event call from MQTT.
In other words, I would like to trigger a rule from MQTT.
I know how it can be done using http: http://<espeasyip>/control?cmd=event,remoteTimerControl=5
But I need to do in MQTT.
How can this be achieved?
thanks
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: EVENT call from MQTT
Wiki is your friend: https://www.letscontrolit.com/wiki/inde ... _Reference
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 73
- Joined: 30 Nov 2017, 18:29
Re: EVENT call from MQTT
Hi @grovkillen,grovkillen wrote: ↑01 Feb 2018, 10:11 Wiki is your friend: https://www.letscontrolit.com/wiki/inde ... _Reference
I appreciate your help, but I had already checked that page and the tutorial page.
I couldn't find an example of how to format the syntax of a MQTT request to call an EVENT.
For a GPIO the syntax that I use is:
Switch Sonoff1 {mqtt=">[mymosquitto:/Sonoff_1/gpio/12:command:ON:1],>[mymosquitto:/Sonoff_1/gpio/12:command:OFF:0]"}
What should be the syntax for an EVENT?
thanks
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: EVENT call from MQTT
Topic:
Payload:
Code: Select all
<unitname>/cmd
Code: Select all
event,remoteTimerControl=5
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 73
- Joined: 30 Nov 2017, 18:29
Re: EVENT call from MQTT
will try tonight thanksgrovkillen wrote: ↑01 Feb 2018, 14:14 Topic:Payload:Code: Select all
<unitname>/cmd
Code: Select all
event,remoteTimerControl=5
-
- Normal user
- Posts: 73
- Joined: 30 Nov 2017, 18:29
Re: EVENT call from MQTT
Hi,grovkillen wrote: ↑01 Feb 2018, 14:14 Topic:Payload:Code: Select all
<unitname>/cmd
Code: Select all
event,remoteTimerControl=5
I can't understand the syntax.
Tried this in Openhab, but it did not trigger any rule in ESPeasy:
Code: Select all
{mqtt=">[mymosquitto:/Sonoff_1/cmd/event:command:remoteTimerControl=5:0]"}
Code: Select all
on remoteTimerControl do
TaskValueSet 5,1,%eventvalue%
endon
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: EVENT call from MQTT
This is a openhab issue. I don't use that controller myself. But to start I would use a mqtt viewer (I use MQTT snooper). That way you can see what the actual message from openhab looks like.leel1967l wrote: ↑01 Feb 2018, 23:11Hi,grovkillen wrote: ↑01 Feb 2018, 14:14 Topic:Payload:Code: Select all
<unitname>/cmd
Code: Select all
event,remoteTimerControl=5
I can't understand the syntax.
Tried this in Openhab, but it did not trigger any rule in ESPeasy:Rule is (works with http call):Code: Select all
{mqtt=">[mymosquitto:/Sonoff_1/cmd/event:command:remoteTimerControl=5:0]"}
Code: Select all
on remoteTimerControl do TaskValueSet 5,1,%eventvalue% endon
The being said, my guess is that you want the config file to read something like this:
Code: Select all
{mqtt=">[mymosquitto:/Sonoff_1/cmd:command:event,remoteTimerControl=5:0]"}
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Who is online
Users browsing this forum: Anthropic Claude Bot [bot], opensiteexplorer.org/dotbot [bot] and 20 guests