jheling / freeathome

Free@Home component for Home Assistant
103 stars 37 forks source link

Problems getting wireless thermostats running #97

Closed patst closed 3 years ago

patst commented 3 years ago

Hi there,

first: thanks for the great home assistant extension.

I hope you can give me a hint why most of my wireless thermostats are not working in HA.

The dashboard looks like this: image

Two of about 10 thermostats are working. In free@home I can see no difference in how they are set up.

I created a dump with the device configuration. This is the example of a working thermostat config: https://paste.ubuntu.com/p/Mw4hcf3HPB/ This is a NOT working thermostat config: https://paste.ubuntu.com/p/PxmfsDMX3v/

The log entries look a bit like https://github.com/jheling/freeathome/issues/40 :

2021-05-02 14:21:53 ERROR (MainThread) [slixmpp.basexmpp] float() argument must be a string or a number, not 'NoneType'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/slixmpp/xmlstream/xmlstream.py", line 834, in handler_callback_routine
    await cb(data)
  File "/config/custom_components/freeathome/fah/pfreeathome.py", line 454, in pub_sub_callback
    await self.update_devices(args[0])
  File "/config/custom_components/freeathome/fah/pfreeathome.py", line 551, in update_devices
    await device.after_update()
  File "/config/custom_components/freeathome/fah/devices/fah_device.py", line 27, in after_update
    await device_updated_cb(self)
  File "/config/custom_components/freeathome/climate.py", line 182, in after_update_callback
    await self.async_update_ha_state(True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 341, in _async_write_ha_state
    extra_state_attributes = self.device_state_attributes
  File "/config/custom_components/freeathome/climate.py", line 83, in device_state_attributes
    attr = {"valve":self.current_actuator,"temperature_correction":self.temperature_correction}
  File "/config/custom_components/freeathome/climate.py", line 114, in temperature_correction
    return float(self.thermostat_device.temperature_correction)
TypeError: float() argument must be a string or a number, not 'NoneType'

Any ideas what might be the problem? Thanks in advance ;-)

Tho85 commented 3 years ago

Thanks for the detailed bug report. It looks like the thermostats are missing a parameter that the component assumes to be there. I've proposed a fix in #98, could you test the code and see if it works for you?

patst commented 3 years ago

@Tho85 thanks for the time taking a look at this. I tested your fix and it works perfectly!