Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SENSOR Message Payload Variance #3778

Closed
4 tasks done
meingraham opened this issue Sep 12, 2018 · 4 comments
Closed
4 tasks done

SENSOR Message Payload Variance #3778

meingraham opened this issue Sep 12, 2018 · 4 comments
Labels
awaiting feedback Action - Waiting for response or more information troubleshooting Type - Troubleshooting

Comments

@meingraham
Copy link
Collaborator

Sonoff S31 V1.0 2017-11-10

STATUS 0

MQT: stat/power_monitor/STATUS = {"Status":{"Module":41,"FriendlyName":["Sonoff"],"Topic":"power_monitor","ButtonTopic":"0","Power":1,"PowerOnState":1,"LedState":1,"SaveData":1,"SaveState":1,"ButtonRetain":0,"PowerRetain":1}}
MQT: stat/power_monitor/STATUS1 = {"StatusPRM":{"Baudrate":4800,"GroupTopic":"sonoffs","OtaUrl":"http://sonoff.maddox.co.uk/tasmota/sonoff.bin","RestartReason":"Software/System restart","Uptime":"0T01:32:25","StartupUTC":"2018-09-12T11:31:33","Sleep":0,"BootCount":11,"SaveCount":28,"SaveAddress":"F7000"}}
MQT: stat/power_monitor/STATUS2 = {"StatusFWR":{"Version":"6.2.1.3","BuildDateTime":"2018-09-11T23:30:04","Boot":31,"Core":"2_3_0","SDK":"1.5.3(aec24ac9)"}}
MQT: stat/power_monitor/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["dd-wrt",""],"TelePeriod":300,"SetOption":["00008129","55818000","00000000"]}}
MQT: stat/power_monitor/STATUS4 = {"StatusMEM":{"ProgramSize":440,"Free":560,"Heap":13,"ProgramFlashSize":1024,"FlashSize":4096,"FlashMode":3,"Features":["00000809","0F022B90","00000001","000000CE","000002C0"]}}
MQT: stat/power_monitor/STATUS5 = {"StatusNET":{"Hostname":"power_monitor-xxxx","IPAddress":"ipAddress","Gateway":"192.168.1.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.1.1","Mac":"MyMAC","Webserver":2,"WifiConfig":5}}
MQT: stat/power_monitor/STATUS6 = {"StatusMQT":{"MqttHost":"mqttHost","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_MyMAC3","MqttUser":"mqttUser","MqttType":2,"MAX_PACKET_SIZE":1000,"KEEPALIVE":15}}
MQT: stat/power_monitor/STATUS7 = {"StatusTIM":{"UTC":"Wed Sep 12 13:03:58 2018","Local":"Wed Sep 12 2018","StartDST":"Sun Mar 11 02:00:00 2018","EndDST":"Sun Nov 04 02:00:00 2018","Timezone":99,"Sunrise":"07:07","Sunset":"19:38"}}
MQT: stat/power_monitor/STATUS9 = {"StatusPTH":{"PowerDelta":80,"PowerLow":0,"PowerHigh":0,"VoltageLow":0,"VoltageHigh":0,"CurrentLow":0,"CurrentHigh":0}}
MQT: stat/power_monitor/STATUS10 = {"StatusSNS":{"Time":"2018-09-12T09:03:58","ENERGY":{"Total":0.170,"Yesterday":0.000,"Today":0.170,"Power":28,"Factor":1.00,"Voltage":119,"Current":0.227}}}
MQT: stat/power_monitor/STATUS11 = {"StatusSTS":{"Time":"2018-09-12T09:03:58","Uptime":"0T01:32:25","Vcc":3.151,"POWER":"ON","Wifi":{"AP":1,"SSId":"ssid","BSSId":"bssID","Channel":11,"RSSI":100}}}

Why am I receiving some SENSOR MQTT messages with Period and some without?

09:02:23 MQT: tele/power_monitor/SENSOR = {"Time":"2018-09-12T09:02:23","ENERGY":{"Total":0.169,"Yesterday":0.000,"Today":0.169,"Period":3,"Power":27,"Factor":0.98,"Voltage":120,"Current":0.227}}
09:02:57 MQT: tele/power_monitor/SENSOR = {"Time":"2018-09-12T09:02:57","ENERGY":{"Total":0.170,"Yesterday":0.000,"Today":0.170,"Power":51,"Factor":1.00,"Voltage":120,"Current":0.253}}
09:03:14 MQT: tele/power_monitor/SENSOR = {"Time":"2018-09-12T09:03:14","ENERGY":{"Total":0.170,"Yesterday":0.000,"Today":0.170,"Power":51,"Factor":1.00,"Voltage":119,"Current":0.294}}
09:03:17 MQT: tele/power_monitor/SENSOR = {"Time":"2018-09-12T09:03:17","ENERGY":{"Total":0.170,"Yesterday":0.000,"Today":0.170,"Power":27,"Factor":0.73,"Voltage":119,"Current":0.309}}

This is causing issues upstream with my automation. I was expecting SENSOR to always have Period in the payload. Thus my openHAB declarations are raising an error when the JSON payload does not find that field. I understand that STATUS8 and STATUS10 would not have the field as those are "manually" invoked and not periodically triggered.

Your guidance is appreciated.

Regards.

Mike

@ascillato2 ascillato2 added the troubleshooting Type - Troubleshooting label Sep 12, 2018
@curzon01
Copy link
Contributor

curzon01 commented Sep 12, 2018

duplicated - see ENERGY.Period not always sent #3447

comment from Theo

@meingraham
Copy link
Collaborator Author

@curzon01

First, I promise that I did search all the forums... but obviously did not use the right search terms. Apologies.

Theo's comment makes complete sense. Then my question changes a bit... what is triggering the "extra" SENSOR messages? As is indicated in the sample I posted, the SENSOR messages are coming w/in seconds of each other with no other intervening message "traffic" - from any direction or source.

I didn't know that SENSOR messages could be triggered externally. I thought the only means to request ENERGY data was via STATUS8 or STATUS10. I know I'm not sending anything to the device. Could having the Console page open be triggering SENSOR messages?

Thanks.

Mike

@curzon01
Copy link
Contributor

There are about 37xx issues - may happen, no matter.

SENSOR msg default send periodically each TelePeriod sec.

Additonal SENSOR msgs can be triggered at power measurement devices like S31 if PowerDelta condition matches - defaults to 80% and for some condition you will get addtional unwanted SENSOR msgs.

If you want msgs only every TelePeriod secs, set PowerDelta 0

@ascillato2 ascillato2 added the awaiting feedback Action - Waiting for response or more information label Sep 12, 2018
@meingraham
Copy link
Collaborator Author

@curzon01 Norbert,

Thank you for the explanation. I recall now seeing the PowerDelta setting. But your explanation clarifies what the outcome of that (and previously TelePeriod). Thanks for your replies. They confirm for me that I was not inadvertently doing something in my openHAB configuration that was generating the problem. I will handle the condition of the presence of Period being variable.

Regards.

Mike

arendst added a commit that referenced this issue May 24, 2019
Change default PowerDelta from 80% to 0% on new installations (#5858, #5028, #4813, #4130, #4145, #3795, #3778, #3660, #3648)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Action - Waiting for response or more information troubleshooting Type - Troubleshooting
Projects
None yet
Development

No branches or pull requests

3 participants