apatsufas / homebridge-tapo-p100

Homebridge TP-LINK Tapo P100 Platform Plugin
Apache License 2.0
64 stars 14 forks source link

P110 warnings - power consumption related #33

Closed vasileio closed 2 years ago

vasileio commented 2 years ago

Describe The Bug: Homebridge logs get filled with this message [homebridge-tapo] This plugin generated a warning from the characteristic 'Total Consumption': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.

To Reproduce: Always reproducible with a P110 configured

Expected behavior: No warning messages and 'Total Consumption' gets passed in

Logs:

[24/03/2022, 22:30:57] [homebridge-tapo] This plugin generated a warning from the characteristic 'Total Consumption': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.
[24/03/2022, 23:30:50] [homebridge-tapo] This plugin generated a warning from the characteristic 'Total Consumption': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.
[24/03/2022, 23:30:50] [homebridge-tapo] This plugin generated a warning from the characteristic 'Total Consumption': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.

Debug logs:

[26/03/2022, 09:19:56] [homebridge-tapo] This plugin generated a warning from the characteristic 'Total Consumption': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.
[26/03/2022, 09:19:56] [homebridge-tapo] Error: 
    at Characteristic.characteristicWarning (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2142:105)
    at Characteristic.validateUserInput (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2030:14)
    at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1617:24
    at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:10:18
    at P110Accessory.getTotalConsumption (/usr/lib/node_modules/homebridge-tapo/src/platformP110Accessory.ts:197:5)
    at Characteristic.emit (node:events:390:28)
    at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1592:14
    at new Promise (<anonymous>)
    at Characteristic.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1590:12)
    at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)

Plugin Config:

            "name": "Tapo Smart Platform",
            "username": "",
            "password": "",
            "devices": [
                {
                    "name": "Dishwasher",
                    "host": "192.168.1.54",
                    "type": "PowerPlug",
                    "updateInterval": 30,
                    "timeout": 2
                },
                {
                    "name": "Washing Machine",
                    "host": "192.168.1.115",
                    "type": "PowerPlug",
                    "updateInterval": 30,
                    "timeout": 2
                }
            ],
            "platform": "TapoP100"
        }

Screenshots: N/A

Environment:

sparkplug37 commented 2 years ago

I too get the same issue with my two P110 power plugs.

This is my log: [3/27/2022, 9:41:34 AM] [homebridge-tapo] This plugin generated a warning from the characteristic 'Current Consumption': Characteristic not in required or optional characteristic section for service Outlet. Adding anyway.. See https://git.io/JtMGR for more info. [3/27/2022, 9:41:34 AM] [homebridge-tapo] This plugin generated a warning from the characteristic 'Total Consumption': Characteristic not in required or optional characteristic section for service Outlet. Adding anyway.. See https://git.io/JtMGR for more info. [3/27/2022, 9:41:34 AM] [homebridge-tapo] This plugin generated a warning from the characteristic 'Current Consumption': Characteristic not in required or optional characteristic section for service Outlet. Adding anyway.. See https://git.io/JtMGR for more info. [3/27/2022, 9:41:34 AM] [homebridge-tapo] This plugin generated a warning from the characteristic 'Total Consumption': Characteristic not in required or optional characteristic section for service Outlet. Adding anyway.. See https://git.io/JtMGR for more info. [3/27/2022, 9:46:16 AM] [homebridge-tapo] This plugin generated a warning from the characteristic 'Total Consumption': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info. [3/27/2022, 9:46:16 AM] [homebridge-tapo] This plugin generated a warning from the characteristic 'Total Consumption': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.

The last two lines get repeated in the log.