Hi I have just loaded a Homie script onto my Sonoff POW and the device is working as it should be.
I have added an MQTT switch as an item in OpenHAB and I can control the device, I also have the devices uptime displayed. What I can’t work out is how to show the voltage and current - it is being published on MQTT. Its just showing it in OpenHAB I am struggling with!
The switch that works:
Switch Sonoff_POW_Switch "Wall Socket" {
mqtt="<[openhabMqTT:homie/sonoff-pow/switch/on:state:MAP(onoff.map)],
>[openhabMqTT:homie/sonoff-pow/switch/on/set:command:OFF:false],
>[openhabMqTT:homie/sonoff-pow/switch/on/set:command:ON:true]",
autoupdate="false"
}
The uptime that is reported by Homie (again it works):
String Sonoff_POW_Uptime "Sonoff POW [%s]" {
mqtt="<[openhabMqTT:homie/sonoff-pow/$stats/uptime:state:JS(uptime.js)]"
}
Now I have tried several items to get it to display the voltage and current, but none seem to work:
String Sonoff_POW_Volts "Voltage [%.2f Volts]" {
mqtt="<[openhabMqTT:homie/sonoff-pow/voltage/volts]"
}
String Sonoff_POW_Volts1 "Voltage [%.2f Volts]" {
mqtt="<[openhabMqTT:homie/sonoff-pow/voltage:volts]"
}
String Sonoff_POW_Volts2 "Voltage [%.2f Volts]" {
mqtt="<[openhabMqTT:homie/sonoff-pow/voltage/volts:value]"
}
String Sonoff_POW_Volts3 "Voltage [%.2f Volts]" {
mqtt="<[openhabMqTT:homie/sonoff-pow/voltage/volts:state]"
}
String Sonoff_POW_Volts4 "Voltage [%.2f Volts]" {
mqtt="<[openhabMqTT:homie/sonoff-pow/voltage/volts:state:default]"
}
String Sonoff_POW_Volts5 "Voltage [%.2f Volts]" {
mqtt="<[openhabMqTT:homie/sonoff-pow/voltage/volts/value]"
}
String Sonoff_POW_Volts6 "Voltage [%.2f Volts]" {
mqtt="<[openhabMqTT:homie/sonoff-pow/voltage/volts/state]"
}
For example the voltage is reported on topic: homie/sonoff-pow/voltage/volts as 241.02 when using MQTT LENS to watch the topics.
Thanks in advance!