Ghawken / HomeKitLink-Siri

8 stars 3 forks source link

Error message in log ('key hvacHeaterIsOn not found in dict') #23

Open jaknudsen opened 2 years ago

jaknudsen commented 2 years ago

The Indigo log window periodically gives this message:

HomeKitLink Siri Error Plugin Setter Exception Traceback (most recent call last): File "plugin.py", line 2386, in Plugin_getter_callback if indigodevice.states["hvacHeaterIsOn"] == False: KeyError: 'key hvacHeaterIsOn not found in dict' HomeKitLink Siri Error Plugin Setter Exception Traceback (most recent call last): File "plugin.py", line 2386, in Plugin_getter_callback if indigodevice.states["hvacHeaterIsOn"] == False: KeyError: 'key hvacHeaterIsOn not found in dict'

Ghawken commented 2 years ago

Hi This will likely be because you have added a non Indigo thermostat device as a Thermostat in Homekit. If you meant to do this…. will see what can do even if it’s not ideal, and a lot of functionality won’t work. If was accident - then that will be why and delete and problem solved.

But should be easy to check and add a fix - I’ll have a look and update.

Ghawken commented 2 years ago

Hmm It appears you Thermostat device has "hvacOperationModeIsHeat" but then does not have a state "hvacHeaterIsOn"... Perhaps Cooler only?

Can you right click on the device in Indigo and Print Device Details to Log and then post here?

Can't do much more without this. Thanks

Thanks

jaknudsen commented 2 years ago

Hi again, sorry for the late reply! I have about 10 thermostats in Indigo (some model variations). Here's the device details for a random one:

19 Oct 2022 at 22:29:12 Embedded script executor host2 started Script address : 34 batteryLevel : None buttonGroupCount : 0 configured : True coolIsOn : False coolSetpoint : 27.0 dehumidifierIsOn : False description : deviceTypeId : zwThermostatType displayStateId : temperatureInputsAll displayStateImageSel : HvacHeatMode displayStateValRaw : 17.7 displayStateValUi : 17.7 enabled : True energyAccumBaseTime : 2022-03-27 05:36:19 energyAccumTimeDelta : 17859106 energyAccumTotal : 1856.4 energyCurLevel : 0.16 errorState : fanIsOn : False fanMode : Auto folderId : 115612620 globalProps : MetaProps : (dict) com.GlennNZ.indigoplugin.HomeKitLink-Siri : (dict) HomeKit_audioSelector : false (bool) HomeKit_bridgeUniqueID : 604419 (integer) HomeKit_deviceSubtype : Thermostat (string) HomeKit_inverseSelector : false (bool) HomeKit_publishDevice : true (bool) HomeKit_tempSelector : false (bool) homekit-name : Astrid gulv (string) com.perceptiveautomation.indigoplugin.zwave : (dict) NumHumidityInputs : 1 (integer) ShowCoolHeatEquipmentStateUI : false (bool) SupportsEnergyMeter : true (bool) SupportsEnergyMeterCurPower : true (bool) TempUnits : 1 (integer) address : 34 (integer) disableModeChangeLogging : false (bool) disableSetpointLogging : false (bool) disableTempLogging : false (bool) indigoObjVersion : 10 (integer) modelNameAndFirmware : Thermostat (TRM2fx), firmware 3.06 (string) propsPushTickler : 1 (string) tempAlwaysFalse : false (bool) userEnergyPollingEnabled : false (bool) userPollAfterActivity : true (bool) userPollInterval : 0 (integer) userPollingEnabled : true (bool) userWakeInterval : 60 (integer) version : 3.06 (string) zwAppVersMajor : 3 (integer) zwAppVersMinor : 6 (integer) zwAssociationsMap : (dict) g1 : (list) Item : 1 (integer) g2 : (list) g3 : (list) g4 : (list) zwAssociationsMapStr : 1:[1] 2:[] 3:[] 4:[] (string) zwClassCmdBase : 64 (integer) zwClassCmdMap : (dict) c108 : 1 (integer) c112 : 1 (integer) c114 : 1 (integer) c115 : 1 (integer) c122 : 1 (integer) c133 : 1 (integer) c134 : 1 (integer) c142 : 1 (integer) c152 : 1 (integer) c159 : 1 (integer) c32 : 1 (integer) c50 : 3 (integer) c64 : 1 (integer) c67 : 1 (integer) c85 : 1 (integer) c89 : 1 (integer) c90 : 1 (integer) c94 : 1 (integer) c96 : 4 (integer) zwClassCmdMapStr : 20v1 40v1 43v1 85v1 86v1 60v4 6Cv1 32v3 8Ev1 70v1 72v1 73v1 55v1 98v1 59v1 5Av1 7Av1 5Ev1 9Fv1 (string) zwClassIds : (list) Item : 4 (integer) Item : 8 (integer) Item : 6 (integer) zwClassInstanceCountMap : (dict) zwClassInstanceCountMapStr : - none - (string) zwClassName : General Thermostat (v2) (string) zwConfigVals : (dict) zwConfigValsStr : - none - (string) zwDevEndPoint : 1 (integer) zwDevSubIndex : 0 (integer) zwEncryptClassCmdMap : (dict) zwEncryptClassCmdMapStr : - none - (string) zwEncryptionStatusStr : Supported but not Enabled (string) zwEndpointClassMap : (dict) e1 : (list) Item : 94 (integer) Item : 133 (integer) Item : 89 (integer) Item : 142 (integer) Item : 108 (integer) Item : 67 (integer) Item : 64 (integer) e2 : (list) Item : 94 (integer) Item : 133 (integer) Item : 89 (integer) Item : 142 (integer) Item : 108 (integer) Item : 49 (integer) e3 : (list) Item : 94 (integer) Item : 133 (integer) Item : 89 (integer) Item : 142 (integer) Item : 108 (integer) Item : 49 (integer) e4 : (list) Item : 94 (integer) Item : 133 (integer) Item : 89 (integer) Item : 142 (integer) Item : 108 (integer) Item : 37 (integer) Item : 50 (integer) zwEndpointClassMapStr : 1:[5E 85 59 8E 6C 43 40], 2:[5E 85 59 8E 6C 31], 3:[5E 85 59 8E 6C 31], 4:[5E 85 59 8E 6C 25 32] (string) zwEndpointDevTypeMap : (dict) e1 : (list) Item : 8 (integer) Item : 6 (integer) e2 : (list) Item : 33 (integer) Item : 1 (integer) e3 : (list) Item : 33 (integer) Item : 1 (integer) e4 : (list) Item : 16 (integer) Item : 1 (integer) zwEndpointDevTypeMapStr : 1:(08 : 06), 2:(21 : 01), 3:(21 : 01), 4:(10 : 01) (string) zwFeatureListStr : routing, beaming, security, energyMeter (string) zwLibType : 3 (integer) zwManufactureId : 411 (integer) zwManufactureName : HeatIT (string) zwMeterSubTypeFlags : 21 (integer) zwMeterSupportsReset : false (bool) zwMeterType : 1 (integer) zwModelDefnVers : 1 (integer) zwModelId : 197122 (integer) zwModelName : Thermostat (TRM2fx) (string) zwNodeNeighbors : (list) Item : 18 (integer) Item : 19 (integer) Item : 20 (integer) Item : 21 (integer) Item : 30 (integer) Item : 32 (integer) Item : 33 (integer) Item : 35 (integer) Item : 36 (integer) Item : 37 (integer) Item : 45 (integer) Item : 49 (integer) zwNodeNeighborsStr : 18, 19, 20, 21, 30, 32, 33, 35, 36, 37, 45, 49 (string) zwProtoVersMajor : 5 (integer) zwProtoVersMinor : 3 (integer) zwShowDumpDevToLog : true (bool) zwShowEnergyPollingUI : true (bool) zwShowMainUI : true (bool) zwShowManualModifyConfigParmUI : true (bool) zwShowPollingUI : true (bool) zwShowSubmitModelInfoUI : false (bool) zwShowWakeIntervalUI : false (bool) zwWakeInterval : 0 (integer) heatIsOn : False heatSetpoint : 16.0 humidifierIsOn : False humidities : [0.0] humiditySensorCount : 1 hvacMode : Heat id : 362294647 lastChanged : 2022-10-19 22:28:06 lastSuccessfulComm : 2022-10-19 22:28:06 model : Thermostat (TRM2fx) name : Gulv Astrid v2 ownerProps : com.perceptiveautomation.indigoplugin.zwave : (dict) NumHumidityInputs : 1 (integer) ShowCoolHeatEquipmentStateUI : false (bool) SupportsEnergyMeter : true (bool) SupportsEnergyMeterCurPower : true (bool) TempUnits : 1 (integer) address : 34 (integer) disableModeChangeLogging : false (bool) disableSetpointLogging : false (bool) disableTempLogging : false (bool) indigoObjVersion : 10 (integer) modelNameAndFirmware : Thermostat (TRM2fx), firmware 3.06 (string) propsPushTickler : 1 (string) tempAlwaysFalse : false (bool) userEnergyPollingEnabled : false (bool) userPollAfterActivity : true (bool) userPollInterval : 0 (integer) userPollingEnabled : true (bool) userWakeInterval : 60 (integer) version : 3.06 (string) zwAppVersMajor : 3 (integer) zwAppVersMinor : 6 (integer) zwAssociationsMap : (dict) g1 : (list) Item : 1 (integer) g2 : (list) g3 : (list) g4 : (list) zwAssociationsMapStr : 1:[1] 2:[] 3:[] 4:[] (string) zwClassCmdBase : 64 (integer) zwClassCmdMap : (dict) c108 : 1 (integer) c112 : 1 (integer) c114 : 1 (integer) c115 : 1 (integer) c122 : 1 (integer) c133 : 1 (integer) c134 : 1 (integer) c142 : 1 (integer) c152 : 1 (integer) c159 : 1 (integer) c32 : 1 (integer) c50 : 3 (integer) c64 : 1 (integer) c67 : 1 (integer) c85 : 1 (integer) c89 : 1 (integer) c90 : 1 (integer) c94 : 1 (integer) c96 : 4 (integer) zwClassCmdMapStr : 20v1 40v1 43v1 85v1 86v1 60v4 6Cv1 32v3 8Ev1 70v1 72v1 73v1 55v1 98v1 59v1 5Av1 7Av1 5Ev1 9Fv1 (string) zwClassIds : (list) Item : 4 (integer) Item : 8 (integer) Item : 6 (integer) zwClassInstanceCountMap : (dict) zwClassInstanceCountMapStr : - none - (string) zwClassName : General Thermostat (v2) (string) zwConfigVals : (dict) zwConfigValsStr : - none - (string) zwDevEndPoint : 1 (integer) zwDevSubIndex : 0 (integer) zwEncryptClassCmdMap : (dict) zwEncryptClassCmdMapStr : - none - (string) zwEncryptionStatusStr : Supported but not Enabled (string) zwEndpointClassMap : (dict) e1 : (list) Item : 94 (integer) Item : 133 (integer) Item : 89 (integer) Item : 142 (integer) Item : 108 (integer) Item : 67 (integer) Item : 64 (integer) e2 : (list) Item : 94 (integer) Item : 133 (integer) Item : 89 (integer) Item : 142 (integer) Item : 108 (integer) Item : 49 (integer) e3 : (list) Item : 94 (integer) Item : 133 (integer) Item : 89 (integer) Item : 142 (integer) Item : 108 (integer) Item : 49 (integer) e4 : (list) Item : 94 (integer) Item : 133 (integer) Item : 89 (integer) Item : 142 (integer) Item : 108 (integer) Item : 37 (integer) Item : 50 (integer) zwEndpointClassMapStr : 1:[5E 85 59 8E 6C 43 40], 2:[5E 85 59 8E 6C 31], 3:[5E 85 59 8E 6C 31], 4:[5E 85 59 8E 6C 25 32] (string) zwEndpointDevTypeMap : (dict) e1 : (list) Item : 8 (integer) Item : 6 (integer) e2 : (list) Item : 33 (integer) Item : 1 (integer) e3 : (list) Item : 33 (integer) Item : 1 (integer) e4 : (list) Item : 16 (integer) Item : 1 (integer) zwEndpointDevTypeMapStr : 1:(08 : 06), 2:(21 : 01), 3:(21 : 01), 4:(10 : 01) (string) zwFeatureListStr : routing, beaming, security, energyMeter (string) zwLibType : 3 (integer) zwManufactureId : 411 (integer) zwManufactureName : HeatIT (string) zwMeterSubTypeFlags : 21 (integer) zwMeterSupportsReset : false (bool) zwMeterType : 1 (integer) zwModelDefnVers : 1 (integer) zwModelId : 197122 (integer) zwModelName : Thermostat (TRM2fx) (string) zwNodeNeighbors : (list) Item : 18 (integer) Item : 19 (integer) Item : 20 (integer) Item : 21 (integer) Item : 30 (integer) Item : 32 (integer) Item : 33 (integer) Item : 35 (integer) Item : 36 (integer) Item : 37 (integer) Item : 45 (integer) Item : 49 (integer) zwNodeNeighborsStr : 18, 19, 20, 21, 30, 32, 33, 35, 36, 37, 45, 49 (string) zwProtoVersMajor : 5 (integer) zwProtoVersMinor : 3 (integer) zwShowDumpDevToLog : true (bool) zwShowEnergyPollingUI : true (bool) zwShowMainUI : true (bool) zwShowManualModifyConfigParmUI : true (bool) zwShowPollingUI : true (bool) zwShowSubmitModelInfoUI : false (bool) zwShowWakeIntervalUI : false (bool) zwWakeInterval : 0 (integer) pluginId : com.perceptiveautomation.indigoplugin.zwave pluginProps : emptyDict : (dict) protocol : ZWave remoteDisplay : True sharedProps : com.indigodomo.indigoserver : (dict) states : States : (dict) accumEnergyTimeDelta : 17859106 (integer) accumEnergyTimeDelta.ui : 17859106 seconds (string) accumEnergyTotal : 1856.4 (real) accumEnergyTotal.ui : 1856.4 kWh (string) curEnergyLevel : 0.16 (real) curEnergyLevel.ui : 0.16 W (string) humidityInput1 : 0 (real) humidityInputsAll : 0 (string) hvacFanMode : 0 (integer) hvacFanModeIsAlwaysOn : false (bool) hvacFanModeIsAuto : false (bool) hvacOperationMode : 1 (integer) hvacOperationMode.ui : heat on (string) hvacOperationModeIsAuto : false (bool) hvacOperationModeIsCool : false (bool) hvacOperationModeIsHeat : true (bool) hvacOperationModeIsOff : false (bool) hvacOperationModeIsProgramAuto : false (bool) hvacOperationModeIsProgramCool : false (bool) hvacOperationModeIsProgramHeat : false (bool) setpointCool : 27 (real) setpointCool.ui : 27.0 °C (string) setpointHeat : 16 (real) setpointHeat.ui : 16.0 °C (string) temperatureInput1 : 17.7 (real) temperatureInput1.ui : 17.7 °C (string) temperatureInputsAll : 17.7 (string) zwaveHvacOperationModeID : 1 (integer) zwaveHvacOperationModeName : heat (string) subModel : ui=Thermostat subType : supportsAllLightsOnOff : False supportsAllOff : False supportsCoolSetpoint : True supportsHeatSetpoint : True supportsHvacFanMode : True supportsHvacOperationMode : True supportsStatusRequest : True temperatureSensorCount : 1 temperatures : [17.7] version : 3.06

Ghawken commented 2 years ago

Thanks. Fixing the error message should be fairly straight forward.

However is it reporting correctly?

Your device does not have a hvacHeaterIsOn. Likewise hvacCoolerIsOn...

But it does have a (I presume state) HeatIsOn and a CoolIsOn — Hmm… https://wiki.indigodomo.com/doku.php?id=indigo_2022.1_documentation:device_class#thermostatdevice

Didn’t think that was ideal? Should be able to work around though

Ghawken commented 2 years ago

Ok

Have a look at new version 0.4.2 — download the code from Github and install. Remember to run the xattr as per log after first install.

It appears these thermostat’s do NOT report the state they are in eg. Heater On, Cooler On etc. So Indigo has left this info blank - which is where the error is coming from.

The new version should just check for existence and skip if not there. If may mean however that you cannot change the state of the thermostat - that may not be that important if they are floor heaters (which seem to be).
But give it a test and report back. (I believe the way I have addressed shouldn’t cause a cascade of other issues … testing at my end regarding demo thermostats are working fine…)

jaknudsen commented 1 year ago

Hi again!

I've updated to 0.5.4, ran the xattr command. This is the log entry when I reload the plugin:

Started plugin "HomeKitLink Siri 0.5.4" HomeKitLink Siri Finding devices to publish to HomeKit Given Startup... HomeKitLink Siri Starting accessory HomeKitLink Bridge 604419 on address 10.0.119.12, port 51826. HomeKitLink Siri Error (plugin.py: Function: Plugin_getter_callback line: 2563): Exception : Message : Plugin Setter Exception HomeKitLink Siri Error File "plugin.py", line 2466, in Plugin_getter_callback temptosend = sum(listtemps) / len(listtemps) ##average of all values HomeKitLink Siri Error (<class 'ZeroDivisionError'>, ZeroDivisionError('division by zero'), <traceback object at 0x10d0c3400>) None None HomeKitLink Siri Error (plugin.py: Function: Plugin_getter_callback line: 2563): Exception : Message : Plugin Setter Exception HomeKitLink Siri Error File "plugin.py", line 2466, in Plugin_getter_callback temptosend = sum(listtemps) / len(listtemps) ##average of all values HomeKitLink Siri Error (<class 'ZeroDivisionError'>, ZeroDivisionError('division by zero'), <traceback object at 0x10d0d4940>) None None HomeKitLink Siri A total of 32 devices are currently selected to be published to HomeKit HomeKitLink Siri 32 Home Kit Accessories are now Started.

Ghawken commented 1 year ago

Hi I presume it is the same device…. BUT really need that confirmed? What device is causing this issue?

This error would only occur if there was a empty list instead of temperature.

If this in the same device In which case this is the next error, after fixing the first..

Not sure whether this device particularly cut out to be a “thermostat” in Homekit given it

Again I can catch the error - but so far this thermostat, isnt reporting temperature (at least some of the time), and isnt reporting state or allowing state change. It’s really not cut out to be a thermostat!

I’ll have a look

Ghawken commented 1 year ago

Can try 0.5.6 But who knows what will be missing next! (from your thermostat that isn't a indigo thermostat...)