Reading if a swich is on or off[solved]

trying to read a switch from tasmota
output to MQT is
13:35:13 MQT: tele/B_Humid/SENSOR = {“Time”:“2020-03-23T13:35:13”,“Switch1”:“OFF”,“AM2301”:{“Temperature”:15.8,“Humidity”:55.6,“DewPoint”:6.9},“TempUnit”:“C”}

and just wondering what should be put in the transformation box so i can use it else where



I use this for humidity with tasmota:


You may need to change the SI7021 to AM2301 but try both as my sensor is also AM2301.

thanks but have the humidity reading working need to read the switch status as its on a tank have the relay working and the pmw on it but it the last thing i need to read

You should have a line that starts with stat check the tasmota console or try stat/B_Humid/SENSOR with no transformation needed. You may also need to set the custom on/off value to 1 and the other to 0.

i use the stat for the power reading but i dont think it reads the switch state which is what i need thanks for trying to help

why are you reading switch state from telemetrics which is not relevant as it is provided in 2min intervals?

Read it directly from device
not familiar with paperUI
but in files like this:

Thing mqtt:topic:WallSwitchDressroom "Light Dressroom" (mqtt:broker:home) @ "Dressroom" {
    Type switch : switch        "Dressroom Lights"      [ stateTopic="home/light/dressroom/stat/POWER", commandTopic="home/light/dressroom/cmnd/POWER", on="ON", off="OFF" ]

and voala, you have this information at the time switch is toggled

tried removing it and putting it back in and it started working thanks for the help