cyberjunky / home-assistant-custom-components

My custom components for Home Assistant
MIT License
71 stars 19 forks source link

Plugwise not working anymore #44

Closed Brandjuh closed 4 years ago

Brandjuh commented 4 years ago

Hello Ron,

Since the last update of home assistant the plugwise plugin is not working anymore and replies with a timeout in the logs.

Before this update I did not had any problems.

Details: Home Assistant 0.102.2 Frontend-versie: 20191119.6 - latest Hass.io 192

Logboekdetails ( ERROR )
Fri Nov 29 2019 07:27:00 GMT+0100 (Midden-Europese standaardtijd)
plugwise: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 450, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/plugwise/switch.py", line 105, in update
    self.data.update()
  File "/config/custom_components/plugwise/switch.py", line 125, in update
    self.current_consumption = plugwise.Circle(self.mac, self.stick).get_power_usage()
  File "/usr/local/lib/python3.7/site-packages/plugwise/api.py", line 177, in get_power_usage
    corrected_pulses = self.pulse_correction(pulse_1s)
  File "/usr/local/lib/python3.7/site-packages/plugwise/api.py", line 125, in pulse_correction
    self.calibrate()
  File "/usr/local/lib/python3.7/site-packages/plugwise/api.py", line 143, in calibrate
    calibration_response = self._expect_response(PlugwiseCalibrationResponse)
  File "/usr/local/lib/python3.7/site-packages/plugwise/api.py", line 114, in _expect_response
    return self._comchan.expect_response(response_class, self.mac)
  File "/usr/local/lib/python3.7/site-packages/plugwise/api.py", line 73, in expect_response
    retval = self._recv_response(resp)
  File "/usr/local/lib/python3.7/site-packages/plugwise/api.py", line 53, in _recv_response
    raise TimeoutException("Timeout while waiting for response from device")
plugwise.exceptions.TimeoutException: Timeout while waiting for response from device
cyberjunky commented 4 years ago

Are you sure nothing else is going on? Wrong serial port, plug out of range something else? I just checked my 1 circle+ + plug setup and it still works also running 0.102.2 on hassio 192 Switching an power usage measurements.

Screenshot from 2019-11-29 18-12-46

cyberjunky commented 4 years ago

Also do you run the latest version with the manifest.json file included?

Brandjuh commented 4 years ago

I will close the issue, looks like its on my side. reinstalled the plugin (I had the one with manifest.json included) and one of my circles came alive. Still strange it has some problems since the last HA update.

Thanks for the fast reply!