Nonetype error on Humifity device.

Posted on
Fri Apr 19, 2024 8:31 am
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Nonetype error on Humifity device.

Hi Glenn

I am getting a NoneType error trying to add the below device to Homekit although it shows correctly in Homekit. It does have temperature and humidity, although I was setting it up as a humidity device. Any ideas how to remove the errors?

Code: Select all
19 Apr 2024 at 14:29:27
   HomeKitLink Siri                HomekitLink Published Device: Fern bed Moisture Sensor caused a Nonetype error, this usually means device, or entire bridge has not correctly started.


Thanks..


Code: Select all
allowOnStateChange : False
allowSensorValueChange : False
batteryLevel : 70
buttonGroupCount : 0
configured : True
description :
deviceTypeId : Whisperer
displayStateId : sensorValue
displayStateImageSel : DehumidifierOff
displayStateValRaw : 91.0
displayStateValUi : 91.0 %
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState :
folderId : 694181255
globalProps : MetaProps : (dict)
     com.GlennNZ.indigoplugin.HomeKitLink-Siri : (dict)
          HomeKit_audioSelector :  (string)
          HomeKit_bridgeUniqueID :  (string)
          HomeKit_deviceSensor :  (string)
          HomeKit_deviceSubtype :  (string)
          HomeKit_inverseSelector :  (string)
          HomeKit_motionEnabled :  (string)
          HomeKit_tempSelector :  (string)
          homekit-name :  (string)
     com.simons-plugins.netro : (dict)
          NumHumidityInputs : 1 (integer)
          NumTemperatureInputs : 1 (integer)
          SupportsBatteryLevel : true (bool)
          SupportsOnState : true (bool)
          SupportsSensorValue : true (bool)
          SupportsStatusRequest : true (bool)
          SupportsTemperatureReporting : true (bool)
          address : 34865d4b1d58 (string)
          configured : true (bool)
          refresh : 5 (string)
id : 1541621752
lastChanged : 2024-04-19 14:32:34
lastSuccessfulComm : 2024-04-19 14:32:34
model : Whisperer Plant Sensor
name : Fern bed Moisture Sensor
onState : True
ownerProps : com.simons-plugins.netro : (dict)
     NumHumidityInputs : 1 (integer)
     NumTemperatureInputs : 1 (integer)
     SupportsBatteryLevel : true (bool)
     SupportsOnState : true (bool)
     SupportsSensorValue : true (bool)
     SupportsStatusRequest : true (bool)
     SupportsTemperatureReporting : true (bool)
     address : 34865d4b1d58 (string)
     configured : true (bool)
     refresh : 5 (string)
pluginId : com.simons-plugins.netro
pluginProps : emptyDict : (dict)
protocol : Plugin
remoteDisplay : True
sensorValue : 91.0
sharedProps : com.indigodomo.indigoserver : (dict)
states : States : (dict)
     api_last_active : 2024-04-19T13:32:34 (string)
     batteryLevel : 70 (integer)
     humidity : 91 (integer)
     id : 45318531 (integer)
     last_active :  (string)
     onOffState : on (on/off bool)
     readingID : 45318531 (integer)
     readingLocalDate : 13:43:28 (string)
     readingLocalTime : 2024-04-19 (string)
     readingTime : 2024-04-19T12:43:28 (string)
     sensorValue : 91.000000 (real)
     sensorValue.ui : 91.0 % (string)
     sensor_last_active : 2024-04-19T12:43:28 (string)
     serial : 45318531 (integer)
     soilMoisture : 91 (integer)
     soilTemperature : 13.1875 (real)
     sunlight : 6.192 (real)
     temperature : 13.1875 (real)
     time : 2024-04-19T13:32:34 (string)
     token_remaining : 1393 (integer)
     token_reset : 2024-04-20T00:00:00 (string)
subModel :  ui=Plant Moisture Sensor
subType :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsOnState : True
supportsSensorValue : True
supportsStatusRequest : True
version : None

Posted on
Fri Apr 19, 2024 5:57 pm
GlennNZ offline
User avatar
Posts: 1577
Joined: Dec 07, 2014
Location: Central Coast, Australia

Nonetype error on Humifity device.

Hi

A few of your statements here seem to be counterproductive to me - NoneType error, although it works correctly? I’m not quite sure how that would be the case. How sure are you that it is working?

The device info you have posted, also have no entries for the Homekitlink aspects - that certainly would cause a NoneType error. That would happen if you haven’t saved after selecting options - but even then when be surprised if all empty.

Wonder whether you might have 2 devices inadvertently?

But startup debug logging will probably tell you what is going on.


Sent from my iPad using Tapatalk

Posted on
Fri Apr 26, 2024 12:58 am
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Nonetype error on Humifity device.

Sorry.. think I published the device details after taking it out of Homekit. Here is the setup when included.
Included is the error message appearing, but I definitely see the device in Home app and it shows the correct humidity.
Then the error message from plugin debug. Looks to be a char_on attribute error.

Code: Select all
allowOnStateChange : False
allowSensorValueChange : False
batteryLevel : 67
buttonGroupCount : 0
configured : True
description :
deviceTypeId : Whisperer
displayStateId : sensorValue
displayStateImageSel : DehumidifierOff
displayStateValRaw : 88.0
displayStateValUi : 88.0 %
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState :
folderId : 694181255
globalProps : MetaProps : (dict)
     com.GlennNZ.indigoplugin.HomeKitLink-Siri : (dict)
          HomeKit_audioSelector : false (bool)
          HomeKit_bridgeUniqueID : 554265 (integer)
          HomeKit_deviceSensor : humidity (string)
          HomeKit_deviceSubtype : HumiditySensor (string)
          HomeKit_inverseSelector : false (bool)
          HomeKit_motionEnabled : true (bool)
          HomeKit_publishDevice : true (bool)
          HomeKit_tempSelector : false (bool)
          homekit-name : Fern Bed Moisture Sensor (string)
     com.simons-plugins.netro : (dict)
          NumHumidityInputs : 1 (integer)
          NumTemperatureInputs : 1 (integer)
          SupportsBatteryLevel : true (bool)
          SupportsOnState : true (bool)
          SupportsSensorValue : true (bool)
          SupportsStatusRequest : true (bool)
          SupportsTemperatureReporting : true (bool)
          address : 34865d4b1d58 (string)
          configured : true (bool)
          refresh : 5 (string)
id : 1541621752
lastChanged : 2024-04-26 07:50:12
lastSuccessfulComm : 2024-04-26 07:50:12
model : Whisperer Plant Sensor
name : Fern bed Moisture Sensor
onState : False
ownerProps : com.simons-plugins.netro : (dict)
     NumHumidityInputs : 1 (integer)
     NumTemperatureInputs : 1 (integer)
     SupportsBatteryLevel : true (bool)
     SupportsOnState : true (bool)
     SupportsSensorValue : true (bool)
     SupportsStatusRequest : true (bool)
     SupportsTemperatureReporting : true (bool)
     address : 34865d4b1d58 (string)
     configured : true (bool)
     refresh : 5 (string)
pluginId : com.simons-plugins.netro
pluginProps : emptyDict : (dict)
protocol : Plugin
remoteDisplay : True
sensorValue : 88.0
sharedProps : com.indigodomo.indigoserver : (dict)
states : States : (dict)
     api_last_active : 2024-04-26T06:50:11 (string)
     batteryLevel : 67 (integer)
     humidity : 88 (integer)
     id : 45591392 (integer)
     last_active :  (string)
     onOffState : off (on/off bool)
     readingID : 45591392 (integer)
     readingLocalDate : 07:34:40 (string)
     readingLocalTime : 2024-04-26 (string)
     readingTime : 2024-04-26T06:34:40 (string)
     sensorValue : 88.000000 (real)
     sensorValue.ui : 88.0 % (string)
     sensor_last_active : 2024-04-26T06:34:40 (string)
     serial : 45591392 (integer)
     soilMoisture : 88 (integer)
     soilTemperature : 5.625 (real)
     sunlight : 4.56 (real)
     temperature : 5.625 (real)
     time : 2024-04-26T06:50:11 (string)
     token_remaining : 1984 (integer)
     token_reset : 2024-04-27T00:00:00 (string)
subModel :  ui=Plant Moisture Sensor
subType :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsOnState : True
supportsSensorValue : True
supportsStatusRequest : True
version : None
   HomeKitLink Siri                HomekitLink Published Device: Fern bed Moisture Sensor caused a Nonetype error, this usually means device, or entire bridge has not correctly started.
   HomeKitLink Siri                HomekitLink Published Device: Fern bed Moisture Sensor caused a Nonetype error, this usually means device, or entire bridge has not correctly started.
   HomeKitLink Siri                HomekitLink Published Device: Fern bed Moisture Sensor caused a Nonetype error, this usually means device, or entire bridge has not correctly started.


Code: Select all
   HomeKitLink Siri                HomekitLink Published Device: Fern bed Moisture Sensor caused a Nonetype error, this usually means device, or entire bridge has not correctly started.
   HomeKitLink Siri Debug          (plugin.py: Function: deviceUpdated  line: 2206):    Exception :  Message : Caught exception in Device Update
   HomeKitLink Siri Debug          Traceback:
  File "plugin.py", line 2202, in deviceUpdated
    self.device_list_internal[checkindex]["accessory"].char_on.set_value(newstate)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   HomeKitLink Siri Debug          Error in plugin execution:

Traceback (most recent call last):
  File "plugin.py", line 2202, in deviceUpdated
    self.device_list_internal[checkindex]["accessory"].char_on.set_value(newstate)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'HumiditySensor' object has no attribute 'char_on'

   HomeKitLink Siri Debug         
Exc_info: (<class 'AttributeError'>, AttributeError("'HumiditySensor' object has no attribute 'char_on'"), <traceback object at 0x10948c580>)
Exc_Text: None
Stack_info: None
   HomeKitLink Siri                HomekitLink Published Device: Fern bed Moisture Sensor caused a Nonetype error, this usually means device, or entire bridge has not correctly started.
   HomeKitLink Siri Debug          (plugin.py: Function: deviceUpdated  line: 2206):    Exception :  Message : Caught exception in Device Update
   HomeKitLink Siri Debug          Traceback:
  File "plugin.py", line 2202, in deviceUpdated
    self.device_list_internal[checkindex]["accessory"].char_on.set_value(newstate)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   HomeKitLink Siri Debug          Error in plugin execution:

Traceback (most recent call last):
  File "plugin.py", line 2202, in deviceUpdated
    self.device_list_internal[checkindex]["accessory"].char_on.set_value(newstate)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'HumiditySensor' object has no attribute 'char_on'

   HomeKitLink Siri Debug         
Exc_info: (<class 'AttributeError'>, AttributeError("'HumiditySensor' object has no attribute 'char_on'"), <traceback object at 0x10767b240>)
Exc_Text: None
Stack_info: None

Posted on
Fri Apr 26, 2024 1:04 am
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Nonetype error on Humifity device.

Is this an issue with the device not having an on/off state? Conveniently its my plugin, but been a while since I have edited the code and I am a complete beginner at plugins so not sure what I need to do.

Posted on
Fri Apr 26, 2024 1:16 am
GlennNZ offline
User avatar
Posts: 1577
Joined: Dec 07, 2014
Location: Central Coast, Australia

Nonetype error on Humifity device.

Hi all,

I’m pretty sure this is my bug, well it has a slight plugin aspect to - but still 99% mine.

siclark wrote:
Is this an issue with the device not having an on/off state? Conveniently its my plugin, but been a while since I have edited the code and I am a complete beginner at plugins so not sure what I need to do.


Basically it correctly updates the humidity device, but then also sees has a OnOffValue which is then updated (which is typically switch or something similar, rather than a sensor device) and tries to update’s HKLS OnOff state - which doesn’t exist hence the fact is working, yet you are seeing this error.

If humidity plugin doesn’t use the onOffValue state then I’m not completely sure why it is being updated. It is this combo of factors, checks for onOffState and its update and then tries to report this back to HKLS where it doesn’t exist for a Homekit Humidity device.

I can update plugin to not check for OnOff states in Humidity devices (and probably the other sensors temp, light) which will be a few days away potentially. — although will test my remote connection and see if can update remotely…


Sent from my iPad using Tapatalk

Posted on
Fri Apr 26, 2024 1:39 am
GlennNZ offline
User avatar
Posts: 1577
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Nonetype error on Humifity device.

Try

https://github.com/Ghawken/HomeKitLink- ... API3.4.zip

Same as pressing Green Code button, Download Zip here:
https://github.com/Ghawken/HomeKitLink-Siri/tree/API3.4

Think it will bypass the error you are seeing for these sensors (that arguably should ignore OnOff changes). (== Humidity, Temperature and Light)

Should


Sent from my iPad using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests