Sonoff Tasmota state not updating


(Didier) #1

I’m using the sonoff basic with tasmota 6.4.1 for some reason only some of the sonoff are showing the ON/OFF STATE. all configs are the same.

This is my things:

Bridge mqtt:broker:myMQTTBroker "Mosquitto" [ host="localhost", port=1883, secure=false, username="openhabian", password="xxxxxxxx", clientID="myMQTTClient" ]
{
    //Veranda Light
    Thing mqtt:topic:veranda01 "Veranda Light" @ "MQTT"  {
      Channels:
          Type switch : switch          "Power Switch"          [ stateTopic="stat/veranda01/POWER", commandTopic="cmnd/veranda01/POWER", on="ON", off="OFF" ] ]
          Type string : state01         "Switch State 01"       [ stateTopic="stat/veranda01/RESULT", transformationPattern="JSONPATH:$.POWER", on="ON", off="OFF" ]
    }


    //Outdoor Bedroom Light
    Thing mqtt:topic:OtdoorBRL "Outdoor Bedroom Light" @ "MQTT"  {
      Channels:
          Type switch : switch          "Power Switch"          [ stateTopic="stat/OtdoorBRL/POWER", commandTopic="cmnd/OtdoorBRL/POWER", on="ON", off="OFF" ]
          Type string : state01         "Switch State 01"       [ stateTopic="stat/OtdoorBRL/RESULT", transformationPattern="JSONPATH:$.POWER", on="ON", off="OFF" ]
    }

}

items

//Veranda Light
Switch veranda01_Switch        "Veranda Light"         (Lights)     [ "Switchable" ]     { channel="mqtt:topic:myMQTTBroker:veranda01:PowerSwitch", autoupdate="false" }
Switch veranda01_State         "Veranda State"                 { channel="mqtt:topic:myMQTTBroker:veranda01:state01" }

//Outdoor Bedroom Light
Switch OtdoorBRL_Switch        "Outdoor Bedroom Light"        (Lights)     [ "Switchable" ]     { channel="mqtt:topic:myMQTTBroker:OtdoorBRL:PowerSwitch", autoupdate="false" }
Switch OtdoorBRL_State         "Outdoor Bedroom State"         { channel="mqtt:topic:myMQTTBroker:OtdoorBRL:state01"}

MQTT binding, things, item and sitemap
(Elias H.) #2

I checked the doc but could not find an entry for autoupdate. Try to enable autoupdate :slight_smile:

autoupdate="true"

(Didier) #3

I just added autoupdate=“false” even without it doesn’t work.


(Elias H.) #4

But did you try with autoupdate=“true”? I don’t know the default, maybe it’s default false.

Also, are you sure your STATE topic is correct? I use this topic for my basic.
stat/sonoff-977686/POWER


(Didier) #5

autoupdate=“true” update the switch properly ON/OFF ON Basic UI is gone.

STATE topic is fine.

I will do more test and see now.


(Elias H.) #6

Wait what?
So this worked? But now it’s missing on the Basic UI :confused:?


(Jürgen Baginski) #7

I so “sense” a missunderstanding.
As far as I understood the OP the display and log-display of the textual "ON "or “OFF” is in question and not the missing update of the device state (by the text and by the icon).
IMHO this textual display can be configured in the sitemap file which is not shown.


(Didier) #8

the autoupdate=“true” updates the switch icon properly but still missing the “ON” or “OFF” for some of the switch.


(Didier) #9

All configs are the same. do you have an example on how to do it?


(Jürgen Baginski) #10

In the sitemap file use empty brackets after the Label, like “MyLabel []”. That way the “ON” or “OFF” will not be shown.


(Didier) #11

That is for label what about switch?


(Jürgen Baginski) #12

No, that is also for the label of a Switch!

See this thread.


(Didier) #13

doesn’t work for me.

switch item=LivingRML0_Switch[]


(Jürgen Baginski) #14

The correct syntax would be:

Switch item=LivingRML0_Switch label=“MyLabel[]”


(Didier) #15

This is what works for me.

Switch item=LivingRML0_Switch label="Kitchen Sink Light [%s]"

Thanks


(Jürgen Baginski) #16

That Syntax should Show the ON/OFF, mine should not!

If your question is resolved, please mark this thread as resovled by selecting square checkmark Icon on the lower end of any reply.