Finally got around to learning the upgraded MQTT. I am now on 2.5 and working through it. I am using the embedded broker (did not not install mosquito). I am trying to do this without using the things file. I was able to connect a POW and can turn it on and off using this cmnd and state in the configured channel and added an item in the PaperUI… awesomeness…
Now I am stumped as to how to get the values for the POW by using just the PaperUI. I assume I create a new channel and then I can have each value as an item? Or do I need a new channel for each value? The value in the console is typical. Its a tele. Do you use tele like you use stat and cmnd?
What you may have done here is create channels belonging directly to the broker Thing.
That can be done, but it’s more conventional (and likely easier to manage in the long run) to make generic “sub” Things to the broker.
I changed over to mosquito and deleted the embedded.
I have two things:
The Heater Thing works great at turning the POW on and off…
Created the second Thing to bring in the values…
I added all the values for the POW as items under the Thing
This is how I configured the Thing. Didnt know whether it should go in cmnd or state, maybe neither…
And my items:
//Heater
Number heater_POW_Load "Heater Power load [%.1f W]" <voltage> {mqtt="<[broker:/tele/sonoff-DVES_7FFAF2/SENSOR:state:JSONPATH($.ENERGY.Power)]"}
Number heater_V "Heater Line voltage [%.1f V]" <voltage> {mqtt="<[broker:/tele/sonoff-DVES_7FFAF2/SENSOR:state:JSONPATH($.ENERGY.Voltage)]"}
Number heater_POW_Current "Heater Line current [%.3f A]" <current> {mqtt="<[broker:/tele/sonoff-DVES_7FFAF2/SENSOR:state:JSONPATH($.ENERGY.Current)]"}
Number heater_POW_Today "Heater Total energy today [%.3f kWh]" <total_energy> {mqtt="<[broker:/tele/sonoff-DVES_7FFAF2/SENSOR:state:JSONPATH($.ENERGY.Today)]"}
Number heater_Yesterday "Heater Total energy yesterday [%.3f kWh]" <total_energy> {mqtt="<[broker:/tele/sonoff-DVES_7FFAF2/SENSOR:state:JSONPATH($.ENERGY.Yesterday)]"}
Number heater_POW_Total "Heater Total energy [%.3f kWh]" <total_energy> {mqtt="<[broker:/tele/sonoff-DVES_7FFAF2/SENSOR:state:JSONPATH($.ENERGY.Total)]"}
And the controls:
and the log:
Incoming payload '{"Time":"2020-02-29T22:00:19","ENERGY":{"TotalStartTime":"2020-02-27T22:32:14","Total":0.000,"Yesterday":0.000,"Today":0.000,"Period":0,"Power":0,"ApparentPower":0,"ReactivePower":0,"Factor":0.00,"Voltage":0,"Current":0.000}}' not supported by type 'NumberValue'
Also, notice there is no leading / in the topic. If you copy the channel from PaperUI it will be correct in your file e.g. channel=“mqtt:topic:6d8a8fd1:heater_power”
Hi @H102, I tried that but no luck. Not sure I had it right. But I really need to back up on this.
So starting from the basics, to get the power values, do I create one channel that is the state topic for the POW Sensor and then add items to it?
MQTT State Topic
tele/sonoff-DVES_7FFAF2/SENSOR
Or, do you create a channel for each of the values?
MQTT State Topic - something like this…