ESPeasy 2.0 MQTT Broadcast
Moderators: grovkillen, Stuntteam, TD-er
ESPeasy 2.0 MQTT Broadcast
Hello,
I just discovered ESPeasy and it is wonderful: But there is one thing missing and that is the ability to subscribe to any random MQTT topic that does NOT use %sysname%.
I already have quite a few Wemos D1 Mini devices around my home, each one using software I developed myself. All these subscribe to "LED" and each returns a ACK to the controller.
I use the payload (ON or OFF) to turn the BUILTIN_LED on or off. The ACKs allow me to see that the device is alive. Alternating commands are sent every 30 seconds from my home automation.
My home automation is "Premise SYS" http://cocoontech.com/forums/forum/51-p ... e-control/ which is 20 years old, Free, but not open source.
I just discovered ESPeasy and it is wonderful: But there is one thing missing and that is the ability to subscribe to any random MQTT topic that does NOT use %sysname%.
I already have quite a few Wemos D1 Mini devices around my home, each one using software I developed myself. All these subscribe to "LED" and each returns a ACK to the controller.
I use the payload (ON or OFF) to turn the BUILTIN_LED on or off. The ACKs allow me to see that the device is alive. Alternating commands are sent every 30 seconds from my home automation.
My home automation is "Premise SYS" http://cocoontech.com/forums/forum/51-p ... e-control/ which is 20 years old, Free, but not open source.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: ESPeasy 2.0 MQTT Broadcast
MQTT Import is the answer... You can import any topic. To publish any topic you should use rules. More is found on the wiki:nigelbe wrote: ↑16 Jun 2017, 12:59 Hello,
I just discovered ESPeasy and it is wonderful: But there is one thing missing and that is the ability to subscribe to any random MQTT topic that does NOT use %sysname%.
I already have quite a few Wemos D1 Mini devices around my home, each one using software I developed myself. All these subscribe to "LED" and each returns a ACK to the controller.
I use the payload (ON or OFF) to turn the BUILTIN_LED on or off. The ACKs allow me to see that the device is alive. Alternating commands are sent every 30 seconds from my home automation.
My home automation is "Premise SYS" http://cocoontech.com/forums/forum/51-p ... e-control/ which is 20 years old, Free, but not open source.
https://www.letscontrolit.com/wiki/inde ... rial_Rules
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
Re: ESPeasy 2.0 MQTT Broadcast
Hello,
I have looked at MQTT but I don't understand it. So I tried this: and I ended up with this: What's all the 4 values about and why ADC(TOUT)?
I am bemused by it all.
I have looked at MQTT but I don't understand it. So I tried this: and I ended up with this: What's all the 4 values about and why ADC(TOUT)?
I am bemused by it all.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: ESPeasy 2.0 MQTT Broadcast
The MQTT Import plugin work as such:
You can have up to 4 imported values per device/task. This doesn't mean that you HAVE to use them all.
The name is the name you use in rules etc. internally within ESP Easy.
MQTT Topic 1-4 is the topics you want to listen to, one per imported value.
Value Name 1-4 is the name of the VALUE that you use internally within ESP Easy.
In general you wont need to use formula, and if no formula is needed you do not need to add any information to that box. So %value% is not necessary.
You may use the MQTT Import together with Rules as this: For the rules you could use the imported value as such:
I hope this gives you an idea of how to use the MQTT Import plugin.
You can have up to 4 imported values per device/task. This doesn't mean that you HAVE to use them all.
The name is the name you use in rules etc. internally within ESP Easy.
MQTT Topic 1-4 is the topics you want to listen to, one per imported value.
Value Name 1-4 is the name of the VALUE that you use internally within ESP Easy.
In general you wont need to use formula, and if no formula is needed you do not need to add any information to that box. So %value% is not necessary.
You may use the MQTT Import together with Rules as this: For the rules you could use the imported value as such:
Code: Select all
on sniff#cmdMQTT=1 do
Publish %sysname%/IP,%ip%
endon
on sniff#cmdMQTT=2 do
Publish %sysname%/Time,%systime%
endon
on sniff#cmdMQTT=3 do
Publish %sysname%/status,Rebooting
Reboot
endon
Last edited by grovkillen on 16 Jun 2017, 14:42, edited 1 time in total.
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
Re: ESPeasy 2.0 MQTT Broadcast
Further to this:
I see IMPT : BAD Import MQTT Command LED in the Log
also IMPT : Illegal Payload OFF LED
I see IMPT : BAD Import MQTT Command LED in the Log
also IMPT : Illegal Payload OFF LED
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: ESPeasy 2.0 MQTT Broadcast
You should not give both the task and the value same name. You call the task/device LED, and the value LED. You should use something like "sniff" (I personally like to call the MQTT Importer , a sniffer), and then I generally use the same value name as the topic that I'm sniffing for .
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
Re: ESPeasy 2.0 MQTT Broadcast
Code: Select all
I hope this gives you an idea of how to use the MQTT Import plugin.
Which build should I be using?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: ESPeasy 2.0 MQTT Broadcast
Also forgot. As of now ONLY NUMBERS are allowed to be imported. Thus my use of only integer.
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
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: ESPeasy 2.0 MQTT Broadcast
I've use this both for R147 and the new 2.0.0-devXX versions. No problem what so ever. Your problem is probably the use of non-integer payload (message content of MQTT topic LED should be 0 and not OFF).nigelbe wrote: ↑16 Jun 2017, 14:46I don't have the OPTIONAL section of LED importCode: Select all
I hope this gives you an idea of how to use the MQTT Import plugin.
Which build should I be using?
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
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: ESPeasy 2.0 MQTT Broadcast
I made a wikipage for this plugin: https://www.letscontrolit.com/wiki/inde ... QTT_Import
More information will probably follow...
More information will probably follow...
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
Re: ESPeasy 2.0 MQTT Broadcast
Thanks a lot
Re: ESPeasy 2.0 MQTT Broadcast
Thanks a lot, I got it working just by changing to another topic name and numeric payload as you suggested.
I've tried to compile it but I'm in Library Hell
I've tried to compile it but I'm in Library Hell
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: ESPeasy 2.0 MQTT Broadcast
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
Re: ESPeasy 2.0 MQTT Broadcast
Thanks grovkillen, that's the binary I'm using.
Who is online
Users browsing this forum: No registered users and 27 guests