Newbie Rules Question
Moderators: grovkillen, Stuntteam, TD-er
Newbie Rules Question
I have a setup running with Openhab, MQTT and multiple ESP nodes.
One of the ESPEasy nodes running R120 is named "ESP1" and is configured with Subscribe Template "/ESP1/#". Through Openhab, user action generates a MQTT message "/ESP1/aaa/bbb 1".
What is the event syntax in ESPEasy Rules that I need for the above message?
I have read many posts on the ESPEasy rules but have not been able to figure it out as I am a newbie to the rules.
Thanks in advance.
One of the ESPEasy nodes running R120 is named "ESP1" and is configured with Subscribe Template "/ESP1/#". Through Openhab, user action generates a MQTT message "/ESP1/aaa/bbb 1".
What is the event syntax in ESPEasy Rules that I need for the above message?
I have read many posts on the ESPEasy rules but have not been able to figure it out as I am a newbie to the rules.
Thanks in advance.
Re: Newbie Rules Question
Tried a few things and found that "MQTT Import" provided the best solution.
Re: Newbie Rules Question
on <event> dosmathur wrote: ..MQTT message "/ESP1/aaa/bbb 1".
What is the event syntax in ESPEasy Rules that I need for the above message?
publish /ESP1/aaa/bbb,1
endon
Re: Newbie Rules Question
Thanks timsson. However, I need to subscribe rather than publish as the publishing is done by Openhab. Based on the content of the topic subscribed in the ESPEasy device, I want to process a rule.
timsson wrote: on <event> do
publish /ESP1/aaa/bbb,1
endon
Re: Newbie Rules Question
I am not sure how this works as I have not tried to use the subscribe, but can you tell me what shows up in the log when the MQTT message arrives? If it is an event, try to use it as an event in "rules".
I haven't found anything else, but this is where I would start. Syntax is probably the same as any event based rule.
Please post if it works!
I haven't found anything else, but this is where I would start. Syntax is probably the same as any event based rule.
Please post if it works!
Re: Newbie Rules Question
Several posts showing you cannot subscribe to MQTT published data on ESPEasy. See also http://www.letscontrolit.com/wiki/index ... _Variables
However, you can use it this way:
In OpenHAB: executeCommandLine("curl http://192.168.1.201/control?cmd=event,myEventNo1=123")
on myEventNo1 do
timerSet 1,%eventvalue%
endon
or for a Dummy Device (like a variable).....
on myEventNo1 do
TaskValueSet 1,1,%eventvalue%
endon
However, you can use it this way:
In OpenHAB: executeCommandLine("curl http://192.168.1.201/control?cmd=event,myEventNo1=123")
on myEventNo1 do
timerSet 1,%eventvalue%
endon
or for a Dummy Device (like a variable).....
on myEventNo1 do
TaskValueSet 1,1,%eventvalue%
endon
Re: Newbie Rules Question
https://github.com/ESP8266nu/ESPEasyPlu ... Import.inoStephenF wrote:Several posts showing you cannot subscribe to MQTT published data on ESPEasy. ......
endon
Re: Newbie Rules Question
I am using Esp Easy Mega, and the MQTT Import works very well... Excellent plugin. Thankstimsson wrote:https://github.com/ESP8266nu/ESPEasyPlu ... Import.inoStephenF wrote:Several posts showing you cannot subscribe to MQTT published data on ESPEasy. ......
endon
Who is online
Users browsing this forum: No registered users and 26 guests