Could someone please help with what am doing wrong?
firstly i am sorry and understand am using a very old MQTT way (it works) and i plan to update this this year however i have started this project to see my Energy
i am trying to use the below to pull the Active power from my Tasmota sensor
Number Power "Power" <light> ["Lighting"] {mqtt=">[mqttoh2:cmnd/sonoffpower/POWER:command:*:default],
<[mqttoh2:stat/sonoffpower/POWER:sensor:default]" }
however what ever i try it wont work, any help would be amazing
i do have a the item in the sitemap however its not showing any value
Well, beside the ancient mqtt1 binding the POWER topic ist either ON or OFF, because that’s the switch.
I guess you want to get voltage, current, active power, energy today and so on.
That data is sent through tele prefix to topic SENSOR. This is a JSON Object with all data in it.
i seen that active power was showing as power on the sensor line and tried to get that to OH. i have lights that work with tasmota and they send the state (on/off) so i tried to amend the item using (stat) to work with this and clearly have it wrong
would i be right in thinking i cant do this with the mqtt1 or is it just my item is completely wrong, am trying to look up JSON Object and how that would work
Just install JSONPATH transformation service.
On the Desktop, use MQTT Explorer or some similar tool to get the complete SENSOR Payload.
I’m using VisualStudio Code with JSON Path Status Bar plugin to analyze the correct psonpath “path”.
That is: paste the whole JSON object to an editor window, choose “format document” from context menu, then set the cursor to the value you are interested in (the value of active power, not the label) and take a look at the status bar (right), the correct path is shown and you can copy the path with a simple click.
Please be aware that openHAB needs a $. as root for the path, so e.g. a path MT681.Power_p2 is $.MT681.Power_p2 in openHAB.