[solved]Tasmota MQTT Wall Plug: When using Text instead of Switch in Sitemap, ON/Off state is NULL

Hi,
I have a strange behaviour with Tasmota Wall Plugs and their ON/OFF state.
When using
Text item=Wall_Plug_T1_Switch
instead of
Switch item=Wall_Plug_T1_Switch
in the Sitemap, the ON/Off state is NULL.
Other channels like power or energy work.
This works for other (Zwave) Wall Plugs.
Background: Some Plugs should not be switchable via Openhab, but I would like to see the switch state (plus power, energy,…).

The thing code is
UID: mqtt:topic:cb20ae88ab:Tasmota_Wall_Plug_1
label: Tasmota_Wall_Plug 1
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:cb20ae88ab
channels:

  • id: Tasmota_Wall_Plug_1_onoff_switch
    channelTypeUID: mqtt:switch
    label: Tasmota_Wall_Plug_1_onoff_switch
    description: null
    configuration:
    commandTopic: cmnd/Tasmota_NOUS_A1T_1/POWER
    postCommand: false
    qos: 0
    stateTopic: stat/Tasmota_NOUS_A1T_1/POWER
    off: OFF
    on: ON
  • id: Tasmota_Wall_Plug_1_Power
    channelTypeUID: mqtt:number
    label: Tasmota_Wall_Plug_1_Power
    description: null
    configuration:
    qos: 0
    stateTopic: tele/Tasmota_NOUS_A1T_1/SENSOR
    transformationPattern: JSONPATH:$.ENERGY.Power
  • id: Tasmota_Wall_Plug_1_Energy_Total
    channelTypeUID: mqtt:number
    label: Tasmota_Wall_Plug_1_Energy_Total
    description: null
    configuration:
    qos: 0
    stateTopic: tele/Tasmota_NOUS_A1T_1/SENSOR
    transformationPattern: JSONPATH:$.ENERGY.Total
  • id: Tasmota_Wall_Plug_1_Energy_Today
    channelTypeUID: mqtt:number
    label: Tasmota_Wall_Plug_1_Energy_Today
    description: null
    configuration:
    qos: 0
    stateTopic: tele/Tasmota_NOUS_A1T_1/SENSOR
    transformationPattern: JSONPATH:$.ENERGY.Today
  • id: Tasmota_Wall_Plug_1_Energy_Yesterday
    channelTypeUID: mqtt:number
    label: Tasmota_Wall_Plug_1_Energy_Yesterday
    description: null
    configuration:
    qos: 0
    stateTopic: tele/Tasmota_NOUS_A1T_1/SENSOR
    transformationPattern: JSONPATH:$.ENERGY.Yesterday

Assuming the above is a Switch type Item, can you confirm that the Item itself shows the correct state?

The item itself shows NULL when the sitemap shows Text and also after changing to switch:


But another plug that is configured identically (but switch in sitemap) shows it correctly:

As said, Power and Energy are shown correctly:

Found the solution:
I had to change the state topic to
stateTopic: tele/Tasmota_NOUS_A1T_1/STATE
transformationPattern: JSONPATH:$.POWER
Now it works - should have looked more in detail to the MQTT explorer…

1 Like