stat_tamper missing from zone mqtt publish
rtozer opened this issue · 2 comments
stat_tamper is missing from the json in the mqtt powermax/zone messages.
eg:
{ "zoneId": 4, "zoneName": "Upstairs", "zoneType": 12, "zoneTypeStr": "Interior", "sensorId": 195, "sensorType": "Motion", "sensorMake": "Visonic PIR", "enrolled": true, "signalStrength": 3, "lastEvent": true, "lastEventTime": 12888, "stat_doorOpen": false, "stat_bypased": false, "stat_lowBattery": false, "stat_active": true }
It is also not present in the /log url:
{"zoneId":4,"zoneName":"Upstairs","zoneType":12,"zoneTypeStr":"Interior","sensorId":195,"sensorType":"Motion","sensorMake":"Visonic PIR","enrolled":true,"signalStrength":3,"lastEvent":false,"lastEventTime":0,"stat_doorOpen":false,"stat_bypased":false,"stat_lowBattery":false,"stat_active":true}
It is however there on the /status url 'enroled_zones' section:
{"zoneName":"Upstairs", "zoneType":12, "zoneTypeStr":"Interior", "sensorId":195, "sensorType":"Motion", "sensorMake":"Visonic PIR", "signalStrength":3, "lastEvent":5, "lastEventAge":881, "stat_doorOpen":false, "stat_bypased":false, "stat_lowBattery":false, "stat_active":true, "stat_tamper":false}
which comes from the PowerMax lib 'Zone::DumpToJson' method, not the mqtt.ino 'void publishAlarmZone(int ix)' method. So it is there on the zone object, but doesn't get pulled out by the mqtt publishAlarmZone method. I can see that the mqtt method does include the tamper alarm, and the json path looks correct, so I'm not sure why this is being left off...
doc["stat_tamper"] = alarmZone.stat.tamper;
mqtt packet size is 512:
MQTT_MAX_PACKET_SIZE: 512 (Need more of 256)
and the zone message is ~358 bytes, so that shouldn't be the problem.
Hi!
Fixed... the problem was doc (json) definition.....
Thanks for the quick turn around. Can confirm the tamper field is in the mqtt zone json now.
And the lastEventStr is handy!