Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dyson.py unable to handle "OFF" humidity state #8569

Closed
TheBrickster opened this issue Jul 20, 2017 · 4 comments · Fixed by #8826
Closed

dyson.py unable to handle "OFF" humidity state #8569

TheBrickster opened this issue Jul 20, 2017 · 4 comments · Fixed by #8826

Comments

@TheBrickster
Copy link

Home Assistant release (hass --version):
0.49.0

Python release (python3 --version):
Python 3.5.2

Component/platform:
Dyson

Description of problem:
dyson.py script is expecting a numeric value for the "humidity sensor" reading, however when provided with "OFF" the script crashes and HASS does not load.

Expected:
It is expected that the dyson.py script can cope with the status provided by the humidity sensor and allow HASS to load without issue.

Problem-relevant configuration.yaml entries and steps to reproduce:

dyson:
  username: XXX
  password: XXX
  language: GB
  devices:
    - device_id: PE9-UK-XXXXXXXX
      device_ip: 192.168.86.32

Traceback (if applicable):

Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 2606, in _thread_main
    self.loop_forever(retry_first_connection=True)
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 1470, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 995, in loop
    rc = self.loop_read(max_packets)
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 1273, in loop_read
    rc = self._packet_read()
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 1838, in _packet_read
    rc = self._packet_handle()
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 2285, in _packet_handle
    return self._handle_publish()
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 2456, in _handle_publish
    self._handle_on_message(message)
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 2603, in _handle_on_message
    self.on_message(self, self._userdata, message)
  File "/Users/ollie/.homeassistant/deps/libpurecoollink/dyson.py", line 267, in on_message
    device_msg = DysonEnvironmentalSensorState(payload)
  File "/Users/ollie/.homeassistant/deps/libpurecoollink/dyson.py", line 679, in __init__
    self._humidity = int(self.__get_field_value(data, 'hact'))
ValueError: invalid literal for int() with base 10: 'OFF'

Additional info:
Discussed on https://community.home-assistant.io/t/dyson-link-action-and-sensor/10145/65

The fix was to edit the file /components/dyson.py

and update the line

REQUIREMENTS = ['libpurecoollink==0.2.0']

With

REQUIREMENTS = ['libpurecoollink==0.3.0']

@bachya
Copy link
Contributor

bachya commented Jul 20, 2017

Based on there being a fix that you've identified, are you comfortable making the change and submitting a PR?

@CharlesBlonde
Copy link
Contributor

I confirm the issue and I'll submit a PR soon.

One possible other workaround is to enable continuous monitoringon the Dyson devices (not tested yet, can not confirm).

@TheBrickster
Copy link
Author

Hi Charles, I am unable to comment on the HA forum - apparently a 3 post limit for newbies...

I've turned on continuous monitoring, and after a short while the dashboard reflected that the humidity detected is 49% (the same as reported in my app).

Also, to check that it was a viable workaround, I left continuous monitoring switched on, and reverted the setting back to

REQUIREMENTS = ['libpurecoollink==0.2.0']

I was able to start HASS without any issues.

However, for my purposes, I will switch it back to 0.3.0 so I don't need to leave continuous monitoring switched on.

CharlesBlonde added a commit to CharlesBlonde/home-assistant that referenced this issue Aug 4, 2017
Fixes home-assistant#8569

Upgrade libpurecoolink libraries without unused enum34 dependency
@CharlesBlonde CharlesBlonde mentioned this issue Aug 4, 2017
5 tasks
@CharlesBlonde
Copy link
Contributor

Sorry for the delay, I just submit a PR to fix this issue if devices are configured with standby monitoring disable.

balloob pushed a commit that referenced this issue Aug 4, 2017
Fixes #8569 (#8826)

Upgrade libpurecoolink libraries without unused enum34 dependency
@fabaff fabaff mentioned this issue Aug 12, 2017
dethpickle pushed a commit to dethpickle/home-assistant that referenced this issue Aug 18, 2017
Fixes home-assistant#8569 (home-assistant#8826)

Upgrade libpurecoolink libraries without unused enum34 dependency
@home-assistant home-assistant locked and limited conversation to collaborators Dec 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants