[solved] Sonoff POW - Update 5.12 now MQTT not pushing?

  • Platform information:
    • Hardware: Raspberry3
    • OS: Openhabian
    • openHAB version: newest

Yesterday i Updated my Sonoff Pow, and now some things didn’t working anymore. Can you Help me?

mosquitto log pushing is working:

[17:57:21] openhabian@openHABianPi:~$ mosquitto_sub -h localhost -t "+/PowBeamer/#" -v
tele/PowBeamer/LWT Online
cmnd/PowBeamer/POWER OFF
stat/PowBeamer/RESULT {"POWER":"OFF"}
stat/PowBeamer/POWER OFF
cmnd/PowBeamer/POWER ON
stat/PowBeamer/RESULT {"POWER":"ON"}
stat/PowBeamer/POWER ON
tele/PowBeamer/STATE {"Time":"2018-03-22T17:57:43","Uptime":"0T00:23:34","Vcc":3.112,"POWER":"ON","Wifi":{"AP":1,"SSId":"WirelessAP02","RSSI":100,"APMac":"CC:5D:4E                                                  :59:AE:84"}}
tele/PowBeamer/SENSOR {"Time":"2018-03-22T17:57:43","ENERGY":{"Total":4.415,"Yesterday":0.531,"Today":0.012,"Period":0,"Power":1,"Factor":0.03,"Voltage":236,"Curre                                                  nt":0.185}}
tele/PowBeamer/STATE {"Time":"2018-03-22T17:58:08","Uptime":"0T00:23:59","Vcc":3.112,"POWER":"ON","Wifi":{"AP":1,"SSId":"WirelessAP02","RSSI":100,"APMac":"CC:5D:4E:59:AE:84"}}
tele/PowBeamer/SENSOR {"Time":"2018-03-22T17:58:08","ENERGY":{"Total":4.415,"Yesterday":0.531,"Today":0.012,"Period":0,"Power":3,"Factor":0.13,"Voltage":236,"Current":0.082}}
tele/PowBeamer/STATE {"Time":"2018-03-22T17:58:34","Uptime":"0T00:24:24","Vcc":3.112,"POWER":"ON","Wifi":{"AP":1,"SSId":"WirelessAP02","RSSI":100,"APMac":"CC:5D:4E:59:AE:84"}}
tele/PowBeamer/SENSOR {"Time":"2018-03-22T17:58:34","ENERGY":{"Total":4.415,"Yesterday":0.531,"Today":0.012,"Period":0,"Power":2,"Factor":0.06,"Voltage":236,"Current":0.119}}
tele/PowBeamer/STATE {"Time":"2018-03-22T17:58:59","Uptime":"0T00:24:49","Vcc":3.112,"POWER":"ON","Wifi":{"AP":1,"SSId":"WirelessAP02","RSSI":100,"APMac":"CC:5D:4E:59:AE:84"}}
tele/PowBeamer/SENSOR {"Time":"2018-03-22T17:58:59","ENERGY":{"Total":4.415,"Yesterday":0.531,"Today":0.012,"Period":0,"Power":1,"Factor":0.06,"Voltage":235,"Current":0.092}}
tele/PowBeamer/STATE {"Time":"2018-03-22T17:59:24","Uptime":"0T00:25:14","Vcc":3.112,"POWER":"ON","Wifi":{"AP":1,"SSId":"WirelessAP02","RSSI":100,"APMac":"CC:5D:4E:59:AE:84"}}
tele/PowBeamer/SENSOR {"Time":"2018-03-22T17:59:24","ENERGY":{"Total":4.415,"Yesterday":0.531,"Today":0.012,"Period":0,"Power":4,"Factor":0.17,"Voltage":235,"Current":0.094}}

sonoff.items

Switch PowBeamer "Beamer" <poweroutlet> (BA) { mqtt=">[broker:cmnd/PowBeamer/POWER:command:*:default], <[broker:stat/PowBeamer/POWER:state:default]" }
Number PowBeamer_Power "Beamer Power [%.1f W]" <pressure> (BA,gPower)   { mqtt="<[broker:tele/PowBeamer/ENERGY:STATE:JSONPATH($.Power)]" }
Number PowBeamer_Signal "Beamer WLAN Signal: [%d %%]" <network> (gRSSI)  { mqtt="<[broker:tele/PowBeamer/STATE:STATE:JSONPATH($.Wifi.RSSI)]" }
Number PowBeamer_Amp  "Beamer Ampere [%.3f A]" { mqtt="<[broker:tele/PowBeamer/ENERGY:state:JSONPATH($.Current)], <[broker:stat/PowBeamer/STATUS8:state:JSONPATH($.StatusPWR.Current)]" }
	Frame label="Strom Beamer Wohnzimmer"{
            Switch item=PowBeamer label="Beamer"
			Text item=PowBeamer_Power
			Text item=PowBeamer_Signal
			Text item=PowBeamer_Amp
            Switch item=Sonoff_Action mappings=[restart="Restart", queryFW="Query FW", upgrade="Upgrade FW"]
            Text item=Sonoff_Current_FW_Available
            }

The Command for “on” and “off” working… WIFI Signal working too, but the current Wattage / Ampere didnt working.

2018-03-22 17:56:19.309 [ome.event.ItemCommandEvent] - Item 'PowBeamer' received command ON
2018-03-22 17:56:19.341 [vent.ItemStateChangedEvent] - PowBeamer changed from NULL to ON
2018-03-22 17:56:21.149 [ome.event.ItemCommandEvent] - Item 'PowBeamer' received command OFF
2018-03-22 17:56:21.160 [vent.ItemStateChangedEvent] - PowBeamer changed from ON to OFF
2018-03-22 17:56:22.864 [ome.event.ItemCommandEvent] - Item 'PowBeamer' received command ON
2018-03-22 17:56:22.875 [vent.ItemStateChangedEvent] - PowBeamer changed from OFF to ON

Version 5.11.0 made the following changes:

  • Change Sonoff Pow Energy MQTT data message and consolidate Status 8 into Status 10

It’s now under Sensor -> Energy, so your .items need updating. I’ve not got one in front of me, but try this for the wattage:

Number PowBeamer_Power "Beamer Power [%.1f W]" <pressure> (BA,gPower)   { mqtt="<[broker:tele/PowBeamer/SENSOR:STATE:JSONPATH($.ENERGY.Power)]" }

You appear to have two separate incoming messages feeding the amp figure :slight_smile:

Thank you, now i understand it better! :slight_smile:

Switch PowBeamer "Beamer" <poweroutlet> { mqtt=">[broker:cmnd/PowBeamer/POWER:command:*:default], <[broker:stat/PowBeamer/POWER:state:default]" }
Number PowBeamer_Power "Beamer Power [%.1f W]" <pressure> { mqtt="<[broker:tele/PowBeamer/SENSOR:state:JSONPATH($.ENERGY.Power)]" }
Number PowBeamer_Signal "Beamer WLAN Signal: [%d %%]" <network> { mqtt="<[broker:tele/PowBeamer/STATE:state:JSONPATH($.Wifi.RSSI)]" }
Number PowBeamer_Amp  "Beamer Ampere [%.3f A]" { mqtt="<[broker:tele/PowBeamer/SENSOR:state:JSONPATH($.ENERGY.Current)]" }
Number PowBeamer_PowerOverAll "Beamer Power Overall [%.3f W]" <pressure>  { mqtt="<[broker:tele/PowBeamer/SENSOR:state:JSONPATH($.ENERGY.Total)]" }
Number PowBeamer_CV  "Aktuelle Version [%s]" { mqtt="<[broker:stat/PowBeamer/STATUS2:state:JSONPATH($.StatusFWR.Version)]" }

this is working now… the last one STATUS2 not. someone know why?

2018-03-22 19:27:20.650 [INFO ] [.smarthome.model.script.sonoff.rules] - Sonoff Maintenance on all devices: queryFW

2018-03-22 19:27:20.672 [WARN ] [b.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'PowBeamer_CV'

==> /var/log/openhab2/events.log <==

2018-03-22 19:27:20.675 [vent.ItemStateChangedEvent] - Sonoff_Action changed from queryFW to NULL

from the mosquitto

cmnd/PowBeamer/status 2
stat/PowBeamer/STATUS2 {"StatusFWR":{"Version":"5.12.0","BuildDateTime":"2018-02-09T14:54:51","Boot":31,"Core":"2_3_0","SDK":"1.5.3(aec24a**)"}}

want to show the current Version to merge with the newest :wink:

thank you

Since the item is declared as a number, there could be problems converting 5.12.0 to a proper number.
Try a text item instead

Thank you

String PowBeamer_CV  "Aktuelle Version [%s]" { mqtt="<[broker:stat/PowBeamer/STATUS2:state:JSONPATH($.StatusFWR.Version)]" }

With String it works now…

But this Command is not working…

Switch PowBeamer "Beamer" <poweroutlet> { mqtt=">[broker:cmnd/PowBeamer/POWER:command:*:default], <[broker:stat/PowBeamer/POWER:state:default]" }

This is working before i update the Pow

get the command from the original wiki

Can you give me the correct command?

thank you

Try as item Switch a different name. -> PowBeamer_Switch

Had to reinstall openhab, got many errors… now all it’s working… thank you all :slight_smile: