Issue of the topic: Sencond channel of a tasmota switch show NULL
I defined a thing with two channels using mqtt bindings. The first channel provides the correct value, the second shows always NULL.
What did I wrong ?
No, I didnât change the YAML
Yes, for testing purposes I configured exact the same Pattern, thatâs why I wonder why the first work, the second not. I also tired with Pattern âJSONPATH:$.StatusSNS.ENERGY.Todayâ and got the same result: NULL
I tried to restart and suddenly I get the value, BUT
when I change something in the second channels it will not be shown neither the value nor the unit, even when I restart
it looks now:
What type of Item are you linking to? You may not be aware that MQTT channel parameter unit:kWh is currently not applied to incoming data (that is being worked on), only to outgoing messages.
So the change you made is suspect. That would look to be your JSONPATH. What does your incoming message payload look like?
The incoming message is:
{âStatusSNSâ:{âTimeâ:â2021-07-14T08:14:20â,âENERGYâ:{âTotalStartTimeâ:â2021-07-03T14:29:02â,âTotalâ:0.659,âYesterdayâ:0.054,âTodayâ:0.001,âPowerâ:4,âApparentPowerâ:7,âReactivePowerâ:6,âFactorâ:0.59,âVoltageâ:220,âCurrentâ:0.034}}}
Did you by chance change the type manually in the YAML? This wonât work, and you have to delete and recreate the Channel.
I just wanted to let you know that I found this post searching deeply on Google for why SOME of my MQTT Thing channels were coming up NULL despite being properly coded in the YAML. You were right, you canât edit the âCodeâ version of the Thing, you need to use the UI to create/edit all the Channels. Is there a bug filed on this, as you seemed to know it was an issue so perhaps there is? Itâs not urgent to fix, but would be good to document as errata.
I guess the point is that @jschmidt hasnât seen it written anywhere that it is unsupported. And the fact that the text within the Code tab is fully editable and save-able would suggest that it is supported.