NorthernMan54 / homebridge-tasmota

Plugin for Tasmota devices leveraging Home Assistant auto discovery
Apache License 2.0
35 stars 9 forks source link

Able to control lights - just back error messages being spewed. #21

Closed NickJLange closed 3 years ago

NickJLange commented 3 years ago

Describe The Bug: Initial install - this could be a MQTT config issue etc.

Logs:

Show the Homebridge logs here with the DEBUG flag set, remove any sensitive information.

Updating 'Tasmota 2' ColorTemperature to Error: src must be a string or an object describing the source
    at Template.init (/homebridge/node_modules/homebridge-tasmota/node_modules/nunjucks/src/environment.js:500:13)
    at Template.Obj (/homebridge/node_modules/homebridge-tasmota/node_modules/nunjucks/src/object.js:60:15)
    at new Template (/homebridge/node_modules/homebridge-tasmota/node_modules/nunjucks/src/environment.js:476:18)
    at Object.compile (/homebridge/node_modules/homebridge-tasmota/node_modules/nunjucks/index.js:85:12)
    at tasmotaLightService.parseValue (/homebridge/node_modules/homebridge-tasmota/src/TasmotaService.ts:188:31)
    at tasmotaLightService.statusUpdate (/homebridge/node_modules/homebridge-tasmota/src/tasmotaLightService.ts:153:31)
    at Mqtt.emit (events.js:327:22)
    at MqttClient.<anonymous> (/homebridge/node_modules/homebridge-tasmota/src/lib/Mqtt.ts:70:16)
    at MqttClient.emit (events.js:315:20)
    at MqttClient._handlePublish (/homebridge/node_modules/homebridge-tasmota/node_modules/mqtt/lib/client.js:1277:12)
    at MqttClient._handlePacket (/homebridge/node_modules/homebridge-tasmota/node_modules/mqtt/lib/client.js:410:12)
    at work (/homebridge/node_modules/homebridge-tasmota/node_modules/mqtt/lib/client.js:321:12)
    at Writable.writable._write (/homebridge/node_modules/homebridge-tasmota/node_modules/mqtt/lib/client.js:335:5)
    at doWrite (/homebridge/node_modules/homebridge-tasmota/node_modules/readable-stream/lib/_stream_writable.js:409:139)
    at writeOrBuffer (/homebridge/node_modules/homebridge-tasmota/node_modules/readable-stream/lib/_stream_writable.js:398:5)
    at Writable.write (/homebridge/node_modules/homebridge-tasmota/node_modules/readable-stream/lib/_stream_writable.js:307:11)

Tasmota Device Config:

Please include the Tasmota Module Type / Configuration and Template ( if used )

Screenshots:

Environment:


Tasmota:Service ERROR: Template Parsing error undefined {
  value_json: {
    Time: '2020-11-21T16:39:04',
    Uptime: '0T00:02:04',
    UptimeSec: 124,
    Heap: 30,
    SleepMode: 'Dynamic',
    Sleep: 50,
    LoadAvg: 19,
    MqttCount: 1,
    POWER: 'OFF',
    Dimmer: 100,
    Color: '0,0,0,0,255',
    HSBColor: '0,0,0',
    White: 100,
    CT: 500,
    Channel: [ 0, 0, 0, 0, 100 ],
    Scheme: 0,
    Fade: 'OFF',
    Speed: 1,
    LedTable: 'ON',
    Wifi: {
      AP: 1,
      Channel: 11,
      RSSI: 38,
      Signal: -81,
      LinkCount: 1,
      Downtime: '0T00:00:07'
    }
  }
}

```* **Tasmota Version**: 
* **Plugin Version**: 0.0.72
* **Homebridge Version**: v1.2.3 

* OS - OS | Alpine Linux  (3.12.1)
* Node - v14.15.0
* NPM- v6.14.8
* **Operating System**:  rpi - container
<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
NorthernMan54 commented 3 years ago

Thanks for this, but need your Tasmota device config so I can duplicate it in one of my devices to see what is triggering the error.

knowsnotmuch commented 3 years ago

@NorthernMan54 - seeing a load of these errors on newly tasmotized (tuya-convert) lights.

How can I send you my config backup ?

NorthernMan54 commented 3 years ago

Just include it here

knowsnotmuch commented 3 years ago

Here you go - attaching a couple of devices where I see this:

Archive.zip

knowsnotmuch commented 3 years ago

I am not sure if it is related, but I am seeing a difference in the template I applied when I type Template

e.g. this is the template I use: https://templates.blakadder.com/winpro_next.html

{"NAME":"WIPROBatten","GPIO":[0,0,0,0,0,37,0,0,0,47,0,0,0],"FLAG":1,"BASE":18} the result I see on the console is:

10:43:18 CMD: template
10:43:18 MQT: stat/Junaaid/RESULT = {"NAME":"WIPROBatten","GPIO":[0,0,0,0,0,416,0,0,0,449,0,0,0,4704],"FLAG":0,"BASE":18}

And here is the second one:

Applied Template: https://templates.blakadder.com/solimo_12W_B22.html

From Template:

{"NAME":"Solimo RGBCCT 12","GPIO":[0,0,0,0,37,41,0,0,38,40,39,0,0],"FLAG":0,"BASE":18}

From the console:

11:58:32 CMD: template
11:58:32 MQT: stat/wash/RESULT = {"NAME":"Solimo RGBCCT 12","GPIO":[0,0,0,0,416,420,0,0,417,419,418,0,0,0],"FLAG":0,"BASE":18}
knowsnotmuch commented 3 years ago

Further, the errors recur every 5 minutes. Which matches the teleperiod specified in Tasmota.

Including a sample message from tasmota when this is triggered:

18:26:17 MQT: tele/wash/STATE = {"Time":"2020-12-16T18:26:17","Uptime":"0T09:02:41","UptimeSec":32561,"Heap":26,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":1,"POWER":"ON","Dimmer":100,"Color":"0,0,0,210,45","HSBColor":"0,0,0","White":100,"CT":214,"Channel":[0,0,0,82,18],"Scheme":0,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"XXXX","BSSId":"XXXXXXXX","Channel":1,"RSSI":78,"Signal":-61,"LinkCount":1,"Downtime":"0T00:00:03"}}

NorthernMan54 commented 3 years ago

If you update to the latest (.77) it should now be resolved.

NorthernMan54 commented 3 years ago

PS I have never seen DMP files before and couldn't open them.

To troubleshoot the issue I used your supplied template on a test device I have ( the link to the Tasmota device page was very useful ), and was able to recreate your error messages. Then resolving was just a few minutes of coding.

knowsnotmuch commented 3 years ago

Thats great! Just updated - will let you know in 5-10 min if I see any errors. Thanks again for the immediate response.

knowsnotmuch commented 3 years ago

Ok - State does not trigger any errors now - all seems good. Thank you!

knowsnotmuch commented 3 years ago

Oops - spoke too soon. Still seeing the error

16/12/2020, 22:37:50 [Tasmota] Updating 'Green' ColorTemperature to Error: src must be a string or an object describing the source at Template.init (/hoobs/node_modules/nunjucks/src/environment.js:500:13) at Template.Obj (/hoobs/node_modules/nunjucks/src/object.js:60:15) at new Template (/hoobs/node_modules/nunjucks/src/environment.js:476:18) at Object.compile (/hoobs/node_modules/nunjucks/index.js:85:12) at tasmotaLightService.parseValue (/hoobs/node_modules/homebridge-tasmota/dist/TasmotaService.js:149:47) at tasmotaLightService.statusUpdate (/hoobs/node_modules/homebridge-tasmota/dist/tasmotaLightService.js:113:39) at Mqtt.emit (events.js:327:22) at MqttClient. (/hoobs/node_modules/homebridge-tasmota/dist/lib/Mqtt.js:66:26) at MqttClient.emit (events.js:315:20) at MqttClient._handlePublish (/hoobs/node_modules/mqtt/lib/client.js:1277:12) at MqttClient._handlePacket (/hoobs/node_modules/mqtt/lib/client.js:410:12) at work (/hoobs/node_modules/mqtt/lib/client.js:321:12) at Writable.writable._write (/hoobs/node_modules/mqtt/lib/client.js:335:5) at doWrite (/hoobs/node_modules/readable-stream/lib/_stream_writable.js:409:139) at writeOrBuffer (/hoobs/node_modules/readable-stream/lib/_stream_writable.js:398:5) at Writable.write (/hoobs/node_modules/readable-stream/lib/_stream_writable.js:307:11)

knowsnotmuch commented 3 years ago

PS I have never seen DMP files before and couldn't open them.

To troubleshoot the issue I used your supplied template on a test device I have ( the link to the Tasmota device page was very useful ), and was able to recreate your error messages. Then resolving was just a few minutes of coding.

Sorry about that - used decode_config this time - hope this helps

green.txt

knowsnotmuch commented 3 years ago

Hold on @NorthernMan54 - I may have seen some old errors. I just restarted - let me look at the log for a while and let you know

knowsnotmuch commented 3 years ago

Yes - I can confirm that I goofed up with the old log entries. Looks to be fine after the update. Thank you!

NorthernMan54 commented 3 years ago

Not sure what that decode_config file is either....

Anyway glad to hear that that it is working

NickJLange commented 3 years ago

Thank you for this fix!