Announcement

Collapse
No announcement yet.

How can I restart a Tasmota device via MQTT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I restart a Tasmota device via MQTT

    I have one device that's at the fringe of my WiFi signal that occasionally hangs up. I'd like to publish a restart command to this device periodically, but not sure if it's feasible. Any help would be appreciated.

    #2
    The command is “restart 99”
    The MQTT command depends on how you setup the MQTT topics for the device.
    The default is cmnd/topic/restart with payload of 99.
    This would be event action of Send MQTT Message with text box cmnd/topic/restart=99
    The topic format I setup for my devices does not use a prefix of stat, tele, or cmnd. For this format the syntax is topic/cmnd/restart with payload 99.
    in both syntaxes the word topic is replaced by the device topic setup for the device in Tasmota.

    While Tasmota supports remote restart, it will be problematic to use it in your case. If Tasmota has lost WiFi signal then it will not be able to receive the command. If it still has WiFi then no need to send the command.

    Comment


      #3
      Tried it both ways and this is what I get when I use "cmnd/Access1/restart = 99" ------- "stat/Access1/RESULT = {"Command":"Unknown"}"

      This format is the only one that the device responds to, any other gets no response.

      Ray

      Comment


        #4
        The following setoptions are intended for this type of scenario:

        SetOption56 Wi-Fi network scan to select strongest signal on restart (network has to be visible)
        0 = disable (default)
        1 = enable
        SetOption57 Wi-Fi network re-scan every 44 minutes with alternate to +10dB stronger signal if detected (only visible networks)
        0 = disable
        1 = enable (default)

        https://tasmota.github.io/docs/Commands/#setoptions

        Comment


          #5
          I tried it on one of my Tasmota devices and it performed as intended. With the response you are showing for unknown command then the topic syntax that you are using should be correct.

          In your event action there should be no quotes and no spaces. See it that makes a difference.

          You can also go to the Console window of the Tasmota device and enter "restart 99" without quotes. It should cause the device to be non-responsive to the browser during its restart sequence.

          Comment


            #6
            Typed Reset 99 in the console and it resets but still get stat/Access1/RESULT = {"Command":"Unknown"}when I Publish it. I swear my PC is haunted!

            Comment


              #7
              Hello
              I have a lot of Tasmota devices and they will "reset or "restart" with the following command: Restart 1
              Just tried it at the console of one of the devices and the device restarted. If the topic /cmnd/device/restart 1 is sent across the network to the mqtt broker, it will
              work as well.
              Hope this may be of use
              Bruce

              Comment


                #8
                Got it to finally work, for some reason spaces were input when I saved the event. That's what I get for doing it remotely using TightVNC. Got a chance to actually sit down at my server and type it in right.

                Comment

                Working...
                X