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

Plugin Init Fails #7

Open turbidWaters opened 5 years ago

turbidWaters commented 5 years ago

This must be a noob mistake. Any help?

Homebridge fails to initialise. Here is the log:

Jul 30 03:22:16 HomeKitBridge homebridge[1819]: [7/30/2018, 3:22:16 AM] Homebridge is running on port 51529. Jul 30 03:22:16 HomeKitBridge homebridge[1819]: [7/30/2018, 3:22:16 AM] [Study AC] Nothing to change _hourly Jul 30 03:22:16 HomeKitBridge homebridge[1819]: [7/30/2018, 3:22:16 AM] [Study AC] Nothing to change _daily Jul 30 03:22:16 HomeKitBridge homebridge[1819]: [7/30/2018, 3:22:16 AM] [Study AC] Nothing to change _period Jul 30 03:22:17 HomeKitBridge homebridge[1819]: /usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/index.js:398 Jul 30 03:22:17 HomeKitBridge homebridge[1819]: data = null; Jul 30 03:22:17 HomeKitBridge homebridge[1819]: ^ Jul 30 03:22:17 HomeKitBridge homebridge[1819]: ReferenceError: data is not defined Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at MqttClient. (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/index.js:398:9) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at MqttClient.emit (events.js:182:13) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at MqttClient._handlePublish (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/mqtt/lib/client.js:959:12) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at MqttClient._handlePacket (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/mqtt/lib/client.js:318:12) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at work (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/mqtt/lib/client.js:274:12) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at Writable.writable._write (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/mqtt/lib/client.js:284:5) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at doWrite (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/readable-stream/lib/_stream_writable.js:428:64) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at writeOrBuffer (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/readable-stream/lib/_stream_writable.js:417:5) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at Writable.write (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/readable-stream/lib/_stream_writable.js:334:11) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at Socket.ondata (_stream_readable.js:663:20) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at Socket.emit (events.js:182:13) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at addChunk (_stream_readable.js:283:12) Jul 30 03:22:17 HomeKitBridge homebridge[1819]: at readableAddChunk (_stream_readable.js:264:11) Jul 30 03:22:17 HomeKitBridge systemd[1]: homebridge_tasmota.service: Main process exited, code=exited, status=1/FAILURE Jul 30 03:22:17 HomeKitBridge systemd[1]: homebridge_tasmota.service: Unit entered failed state. Jul 30 03:22:17 HomeKitBridge systemd[1]: homebridge_tasmota.service: Failed with result 'exit-code'.

ANY help is appreciated!

Thanks!

aschmidt74 commented 5 years ago

Same here. Is there developer power still in here?! ;)

rikray02 commented 5 years ago

Try to replace this line "patchToSave":"/root/.homebridge/", By "pathToSave":"/root/.homebridge/",

aschmidt74 commented 5 years ago

thanks! good point! changed. yet: it still doesnt start: /usr/local/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/index.js:398 data = null; ^ homebridge.service: Main process exited, code=exited, status=1/FAILURE homebridge.service: Unit entered failed state.

and you might want to change that at the npm "sample configuration" as well.

AndrzejOlender commented 5 years ago

Hi, I have the same problem.

[2019-2-4 11:57:10] [Sonoff TassPow] Nothing to change _hourly
[2019-2-4 11:57:10] [Sonoff TassPow] Nothing to change _daily
[2019-2-4 11:57:10] [Sonoff TassPow] Nothing to change _period
/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/index.js:398
                        data = null;
        ^
ReferenceError: data is not defined
    at MqttClient.<anonymous> (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/index.js:398:9)
    at emitThree (events.js:136:13)
    at MqttClient.emit (events.js:217:7)
    at MqttClient._handlePublish (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/mqtt/lib/client.js:987:12)
    at MqttClient._handlePacket (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/mqtt/lib/client.js:336:12)
    at work (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/mqtt/lib/client.js:292:12)
    at Writable.writable._write (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/mqtt/lib/client.js:302:5)
    at doWrite (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Writable.write (/usr/lib/node_modules/homebridge-mqtt-power-consumption-log-tasmota/node_modules/readable-stream/lib/_stream_writable.js:334:11)
homebridge.service: Main process exited, code=exited, status=1/FAILURE
homebridge.service: Unit entered failed state.
homebridge.service: Failed with result 'exit-code'.
rikray02 commented 5 years ago

Check here: https://github.com/MacWyznawca/homebridge-mqtt-power-consumption-log-tasmota/pull/4/files

For me, this fix my problem!