How can I reboot ESPEasy using MQTT?
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 49
- Joined: 28 Jun 2016, 05:53
How can I reboot ESPEasy using MQTT?
I have several ESP8266's running ESPEasy Build 132 and Build 147. I would like to reboot them using MQTT.
If I have a device subscribed to topic "MyDevice" with an ip of "192.168.123.123"
I can send "curl 192.168.123.123/?cmd=reboot" and it reboots
How can I get this to work with MQTT. I have tried
Publishing "reboot" to topic "MyDevice"
Publishing "reboot" to topic "MyDevice/cmd"
Publishing "cmd=reboot" to both topics
Is there an easy way of getting an MQTT reboot? If I need to update to later firmware is there a stable version that I can send over the air?
Thanks
If I have a device subscribed to topic "MyDevice" with an ip of "192.168.123.123"
I can send "curl 192.168.123.123/?cmd=reboot" and it reboots
How can I get this to work with MQTT. I have tried
Publishing "reboot" to topic "MyDevice"
Publishing "reboot" to topic "MyDevice/cmd"
Publishing "cmd=reboot" to both topics
Is there an easy way of getting an MQTT reboot? If I need to update to later firmware is there a stable version that I can send over the air?
Thanks
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: How can I reboot ESPEasy using MQTT?
I use mqtt import and rules for that.
So I just publish a number to the topic and all my units will respond.
Code: Select all
on System#Boot do
Publish %sysname%/status,Booted
Publish %sysname%/IP,%ip%
endon
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
Code: Select all
cmdMQTT
You do not have the required permissions to view the files attached to this post.
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: 49
- Joined: 28 Jun 2016, 05:53
Re: How can I reboot ESPEasy using MQTT?
Thanks for the reply, which version do I need to upgrade to for this to work? The builds I have look totally different and don't have MQTT import as an option.
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: How can I reboot ESPEasy using MQTT?
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: 49
- Joined: 28 Jun 2016, 05:53
Re: How can I reboot ESPEasy using MQTT?
Thanks, I'll keep an eye out for when the V2 release arrives as I have a lot of these to update.
-
- Normal user
- Posts: 70
- Joined: 24 Jan 2018, 15:20
Re: How can I reboot ESPEasy using MQTT?
So, I am trying to make this work and can't even make it work with MQTTfx. I am subscribing to my HA server with # as my subsciption. I am publishing cmdMQTT/1, /cmdMQTT/1 and never see a response in MQTTfx nor do I see the value change in the devices list on the ESPEasy Wemos D1. I am seeing the above as published in MQTTfx. What am I doing wrong?
-
- Normal user
- Posts: 70
- Joined: 24 Jan 2018, 15:20
Re: How can I reboot ESPEasy using MQTT?
BTW, I am running v2.0-20180121
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: How can I reboot ESPEasy using MQTT?
Topic: "cmdMQTT"
Payload/message : "1"
You try to send a blank message to topic "cmdMQTT/1"
Payload/message : "1"
You try to send a blank message to topic "cmdMQTT/1"
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: 70
- Joined: 24 Jan 2018, 15:20
Re: How can I reboot ESPEasy using MQTT?
That did it! Now, need to find out if I can set up a topic collector in home assistant to grab the responses to verify the IP to name and set a button to reboot in the interface when I want to.
Who is online
Users browsing this forum: Anthropic Claude Bot [bot] and 19 guests