MacWyznawca / homebridge-mqtt-power-consumption-log-tasmota

Plugin to HomeBridge optimized for work with Itead Sonoff POW hardware with firmware Sonoff-Tasmota via MQTT with log data to file. Partially emulate Elgato Eve Energy. Measure used power and write data to log text files.
MIT License
13 stars 12 forks source link

[POW] JSON problem #18

Open JimmyEyeball opened 4 years ago

JimmyEyeball commented 4 years ago

I have had this plugin running for some time now with no issues but I have recently tried installing homebridge-mqtt-thing for a couple of contact and motion sensors... I can get everything up and running ok with on issues. All tests good but if I leave the system ideal for any length of time say more than a few hours then go back to use it at all not even MQTT it could just be logging into config-ui... the whole system completely locks up and the only way to recover is to pull the power and hard reset the Pi

So initially I was blaming mqtt-thing as this starts as soon as I install this plugin but from the very limited logs I have been able to grab the only issue I can see is showing [POW] JSON Error but that is this plugin that I have been using for a while now... So I'm thinking maybe are the 2 plugins not compatible with each other or could there be an issue with my config.

I will include what logs I have been able to get and a copy of my config and would really appreciate any ideas....

04:24:41 raspberrypi homebridge[335]: [4/30/2020, 04:24:41] [Contact Sensor 45A8A9] read data from Contact Sensor 45A8A9 : {"firstEntry":0,"lastEntry":26,"usedMemory":26,"refTime":609874978,"initialTime":1588182178,"history":["noValue",{"time":1588182178,"setRefTime":1},{"time":1588182178,"status":1},{"time":1588182209,"status":0},{"time":1588182213,"status":1},{"time":1588182233,"status":0},{"time":1588182778,"status":0},{"time":1588183378,"status":0},{"time":1588188217,"status":1},{"time":1588188237,"status":0},{"time":1588188259,"status":0},{"time":1588188859,"status":0},{"time":1588189459,"status":0},{"time":1588190059,"status":0},{"time":1588190659,"status":0},{"time":1588191259,"status":0},{"time":1588191859,"status":0},{"time":1588192459,"status":0},{"time":1588193059,"status":0},{"time":1588193659,"status":0},{"time":1588194259,"status":0},{"time":1588194859,"status":0},{"time":1588196107,"status":0},{"time":1588199893,"status":0},{"time":1588200491,"status":0},{"time":1588201091,"status":0},{"time":1588201695,"status":0}]} Apr 30 04:24:41 raspberrypi homebridge[335]: [4/30/2020, 04:24:41] [Contact Sensor 45A8A9] History Loaded from Persistant Storage Apr 30 04:24:41 raspberrypi homebridge[335]: [4/30/2020, 04:24:41] [Motion Sensor F9754E] read data from Motion Sensor F9754E : {"firstEntry":0,"lastEntry":170,"usedMemory":170,"refTime":609875036,"initialTime":1588182236,"history":["noValue",{"time":1588182236,"setRefTime":1},{"time":1588182236,"status":1},{"time":1588182238,"status":0},{"time":1588182465,"status":1},{"time":1588182467,"status":0},{"time":1588182472,"status":1},{"time":1588182474,"status":0},{"time":1588182478,"status":1},{"time":1588182480,"status":0},{"time":1588182484,"status":1},{"time":1588182486,"status":0},{"time":1588182491,"status":1},{"time":1588182493,"status":0},{"time":1588182497,"status":1},{"time":1588182499,"status":0},{"time":1588182514,"status":1},{"time":1588182516,"status":0},{"time":1588182528,"status":1},{"time":1588182530,"status":0},{"time":1588182537,"status":1},{"time":1588182539,"status":0},{"time":1588182543,"status":1},{"time":1588182545,"status":0},{"time":1588182549,"status":1},{"time":1588182551,"status":0},{"time":1588182556,"status":1},{"time":1588182558,"status":0},{"time":1588182563,"status":1},{"time":1588182565,"status":0},{"time":1588182572,"status":1},{"time":1588182574,"status":0},{"time":1588182579,"status":1},{"time":1588182581,"status":0},{"time":1588182605,"status":1},{"time":1588182607,"status":0},{"time":1588182611,"status":1},{"time":1588182613,"status":0},{"time":1588182619,"status":1},{"time":1588182621,"status":0},{"time":1588182647,"status":1},{"time":1588182649,"status":0},{"time":1588182652,"status":1},{"time":1588182654,"status":0},{"time":1588182659,"status":1},{"time":1588182661,"status":0},{"time":1588182667,"status":1},{"time":1588182669,"status":0},{"time":1588182674,"status":1},{"time":1588182676,"status":0},{"time":1588182678,"status":1},{"time":1588182680,"status":0},{"time":1588182687,"status":1},{"time":1588182689,"status":0},{"time":1588182693,"status":1},{"time":1588182695,"status":0},{"time":1588182700,"status":1},{"time":1588182702,"status":0},{"time":1588182708,"status":1},{"time":1588182710,"status":0},{"time":158818271 Apr 30 04:24:41 raspberrypi homebridge[335]: 9,"status":1},{"time":1588182721,"status":0},{"time":1588182778,"status":0},{"time":1588183186,"status":1},{"time":1588183188,"status":0},{"time":1588183196,"status":1},{"time":1588183198,"status":0},{"time":1588183203,"status":1},{"time":1588183205,"status":0},{"time":1588183211,"status":1},{"time":1588183213,"status":0},{"time":1588183217,"status":1},{"time":1588183219,"status":0},{"time":1588183229,"status":1},{"time":1588183231,"status":0},{"time":1588183236,"status":1},{"time":1588183238,"status":0},{"time":1588183242,"status":1},{"time":1588183244,"status":0},{"time":1588183249,"status":1},{"time":1588183251,"status":0},{"time":1588183256,"status":1},{"time":1588183258,"status":0},{"time":1588183266,"status":1},{"time":1588183268,"status":0},{"time":1588183329,"status":1},{"time":1588183331,"status":0},{"time":1588183341,"status":1},{"time":1588183343,"status":0},{"time":1588183348,"status":1},{"time":1588183350,"status":0},{"time":1588183356,"status":1},{"time":1588183358,"status":0},{"time":1588183362,"status":1},{"time":1588183364,"status":0},{"time":1588183369,"status":1},{"time":1588183371,"status":0},{"time":1588183378,"status":0},{"time":1588183384,"status":1},{"time":1588183386,"status":0},{"time":1588183392,"status":1},{"time":1588183394,"status":0},{"time":1588183402,"status":1},{"time":1588183404,"status":0},{"time":1588183410,"status":1},{"time":1588183412,"status":0},{"time":1588183416,"status":1},{"time":1588183418,"status":0},{"time":1588183429,"status":1},{"time":1588183431,"status":0},{"time":1588183435,"status":1},{"time":1588183437,"status":0},{"time":1588187659,"status":1},{"time":1588187661,"status":0},{"time":1588187683,"status":1},{"time":1588187685,"status":0},{"time":1588187778,"status":1},{"time":1588187780,"status":0},{"time":1588188130,"status":1},{"time":1588188132,"status":0},{"time":1588188168,"status":1},{"time":1588188170,"status":0},{"time":1588188259,"status":0},{"time":1588188286,"status":1},{"time":1588188288,"status":0},{"time":1588188297,"status":1},{"time":1588188299, Apr 30 04:24:41 raspberrypi homebridge[335]: "status":0},{"time":1588188859,"status":0},{"time":1588189459,"status":0},{"time":1588190059,"status":0},{"time":1588190659,"status":0},{"time":1588191080,"status":1},{"time":1588191082,"status":0},{"time":1588191259,"status":0},{"time":1588191302,"status":1},{"time":1588191304,"status":0},{"time":1588191859,"status":0},{"time":1588191957,"status":1},{"time":1588191959,"status":0},{"time":1588191966,"status":1},{"time":1588191968,"status":0},{"time":1588192459,"status":0},{"time":1588193059,"status":0},{"time":1588193659,"status":0},{"time":1588194259,"status":0},{"time":1588194859,"status":0},{"time":1588196107,"status":0},{"time":1588199893,"status":0},{"time":1588200491,"status":0},{"time":1588201091,"status":0},{"time":1588201691,"status":0},{"time":1588204024,"status":1},{"time":1588204054,"status":0},{"time":1588205518,"status":0},{"time":1588210434,"status":1},{"time":1588210436,"status":0},{"time":1588211034,"status":0},{"time":1588211070,"status":1},{"time":1588211072,"status":0},{"time":1588211634,"status":0},{"time":1588212231,"status":1},{"time":1588212233,"status":0},{"time":1588212234,"status":0},{"time":1588212834,"status":0},{"time":1588212962,"status":1},{"time":1588212964,"status":0},{"time":1588213434,"status":0},{"time":1588214034,"status":0},{"time":1588214189,"status":1},{"time":1588214191,"status":0},{"time":1588214789,"status":0}]} Apr 30 04:24:41 raspberrypi homebridge[335]: [4/30/2020, 04:24:41] [Motion Sensor F9754E] History Loaded from Persistant Storage Apr 30 04:24:42 raspberrypi homebridge[335]: [4/30/2020, 04:24:42] [POW] JSON problem Apr 30 04:24:44 raspberrypi homebridge[335]: [4/30/2020, 04:24:44] [Motion Sensor F9754E] lastActivation time loaded Apr 30 04:24:44 raspberrypi homebridge[335]: [4/30/2020, 04:24:44] [Contact Sensor 45A8A9] lastActivation time loaded Apr 30 04:27:58 raspberrypi systemd[1]: Stopping Node.js HomeKit Server... Apr 30 04:27:58 raspberrypi homebridge[335]: [4/30/2020, 04:27:58] Got SIGTERM, shutting down Homebridge...

{ "bridge": { "name": " HomebridgeMQTT", "username": "0E:53:6D:8E:09:09", "port": 44409, "pin": "999-99-999" }, "description": "HomebridgeMQTT", "platforms": [], "accessories": [{ "description": "POW.", "accessory": "mqtt-power-consumption-log-tasmota", "name": "POW", "url": "mqtt://192.168.1.173", "username": "1111", "password": "1111", "topics": { "statusGet": "stat/POW/POWER", "statusSet": "cmnd/POW/power", "energyGet": "tele/POW/SENSOR", "stateGet": "tele/POW/STATE" }, "onValue": "ON", "offValue": "OFF", "outletInUseBy": "current", "outletInUseCurrent": "1.65", "totalPowerResetBy": "month", "activityTopic": "tele/POW/LWT", "activityParameter": "Online", "startCmd": "cmnd/POW/TelePeriod", "startParameter": "15", "patchToSave": "/root/.homebridge/", "savePeriod": "15", "timeOffset": "-60", "manufacturer": "ITEAD", "model": "Sonoff POW", "serialNumberMAC": "84:F3:EB:3E:4E:03" }, { "accessory": "mqttthing", "type": "motionSensor", "name": "Motion Sensor F9754E", "url": "mqtt://192.168.1.173", "username": "1111", "password": "1111", "caption": "Test Motion Sensor F9754E", "topics": { "getMotionDetected": { "topic": "tele/RF/RESULT", "apply": "return( ( JSON.parse(message).RfReceived.Data == 'F9754E' ) ? 1 : null);" } }, "integerValue": true, "turnOffAfterms": 2000, "history": true }, { "accessory": "mqttthing", "type": "contactSensor", "name": "Contact Sensor 45A8A9", "url": "mqtt://192.168.1.173", "username": "1111", "password": "1111", "caption": "Contact Sensor 45A8A9", "topics": { "getContactSensorState": { "topic": "tele/RF/RESULT", "apply": "return( ( JSON.parse(message).RfReceived.Data == '45A8A9' ) ? 1 : null);" } }, "integerValue": true, "resetStateAfterms": 20000, "history": true }] }