cyberjunky / home-assistant-custom-components

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

toon_climate not working after Home Assistant update 0.96 #37

Closed Tuncay-Ayhan closed 5 years ago

Tuncay-Ayhan commented 5 years ago

Hi,

The toon_climate component is outputting errors and the component is not being loaded anymore after changes in the Home Assistant 0.96 update.

Update for sensor.toon_room_temp fails (click to expand) `Thu Jul 18 2019 15:14:50 GMT+0200 (Midden-Europese zomertijd) Update for sensor.toon_room_temp fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 221, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 380, 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/toon_boilerstatus/sensor.py", line 149, in update self.data.update() File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 224, in wrapper result = method(*args, **kwargs) File "/config/custom_components/toon_boilerstatus/sensor.py", line 98, in update self.data = requests.get(BASE_URL.format(self._host, self._port, '/boilerstatus/boilervalues.txt'), timeout=5, headers={'accept-encoding': None}).json() File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/local/lib/python3.7/site-packages/simplejson/__init__.py", line 518, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`
Update for sensor.toon_room_temp_setpoint fails (click to expand) `Thu Jul 18 2019 15:14:50 GMT+0200 (Midden-Europese zomertijd) Update for sensor.toon_room_temp_setpoint fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 221, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 380, 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/toon_boilerstatus/sensor.py", line 149, in update self.data.update() File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 224, in wrapper result = method(*args, **kwargs) File "/config/custom_components/toon_boilerstatus/sensor.py", line 98, in update self.data = requests.get(BASE_URL.format(self._host, self._port, '/boilerstatus/boilervalues.txt'), timeout=5, headers={'accept-encoding': None}).json() File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/local/lib/python3.7/site-packages/simplejson/__init__.py", line 518, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`

More info about the changes: https://www.home-assistant.io/blog/2019/07/17/release-96/#climate

image

[EDIT] Formatting of text [EDIT 2] Correction of spelling in title.

arcidodo commented 5 years ago

same problem here!

ualex73 commented 5 years ago

@Tuncay-Ayhan The errors seem to come from the "toon_boilerstatus" component, not from the "toon_climate". But yes, the "toon_climate" doesn't load here either.

BTW - if you remove "SUPPORT_OPERATION_MODE" from the "climate.py" file, you get proper errors 👍

ualex73 commented 5 years ago

It is NOT a fix, but I made a few small changes to the "climate.py", now it will show up in the GUI ... Only the mode doesn't work yet, the list is empty ... The hack can be downloaded via: https://github.com/ualex73/toon_climate

cyberjunky commented 5 years ago

Thanks. I'm just about to fly to Malesia, so not much time to look into it, sorry. Regards, Ron.

On Thu, Jul 18, 2019 at 3:41 PM Tuncay notifications@github.com wrote:

Hi,

The toon_boiler component is outputting errors and the component is not being loaded anymore after changes in the Home Assistant 0.96 update. Update for sensor.toon_boiler_pressure fails (click to expand)

Thu Jul 18 2019 15:14:50 GMT+0200 (Midden-Europese zomertijd) Update for sensor.toon_room_temp fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 221, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 380, 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/toon_boilerstatus/sensor.py", line 149, in update self.data.update() File "/usr/src/homeassistant/homeassistant/util/init.py", line 224, in wrapper result = method(args, kwargs) File "/config/custom_components/toon_boilerstatus/sensor.py", line 98, in update self.data = requests.get(BASE_URL.format(self._host, self._port, '/boilerstatus/boilervalues.txt'), timeout=5, headers={'accept-encoding': None}).json() File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, kwargs) File "/usr/local/lib/python3.7/site-packages/simplejson/init.py", line 518, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0) Update for sensor.toon_room_temp_setpoint fails (click to expand)

Thu Jul 18 2019 15:14:50 GMT+0200 (Midden-Europese zomertijd) Update for sensor.toon_room_temp_setpoint fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 221, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 380, 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/toon_boilerstatus/sensor.py", line 149, in update self.data.update() File "/usr/src/homeassistant/homeassistant/util/init.py", line 224, in wrapper result = method(args, kwargs) File "/config/custom_components/toon_boilerstatus/sensor.py", line 98, in update self.data = requests.get(BASE_URL.format(self._host, self._port, '/boilerstatus/boilervalues.txt'), timeout=5, headers={'accept-encoding': None}).json() File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, kwargs) File "/usr/local/lib/python3.7/site-packages/simplejson/init.py", line 518, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

More info about the changes: https://www.home-assistant.io/blog/2019/07/17/release-96/#climate

[image: image] https://user-images.githubusercontent.com/28215053/61461394-e1b9eb00-a970-11e9-9e00-da782c4e2930.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cyberjunky/home-assistant-custom-components/issues/37?email_source=notifications&email_token=ABJR36LVNV2E6S4XXUCJKTDQABXJJA5CNFSM4IE3CIH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAAHLHA, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJR36LZOJOMQ3KYOJSZCGTQABXJJANCNFSM4IE3CIHQ .

wwolkers commented 5 years ago

I created a pull request which fixes more things already, needs to be tested more, but it seems to work here from a quick 15 min test :) https://github.com/cyberjunky/home-assistant-custom-components/pull/38

ualex73 commented 5 years ago

@wwolkers you should rename "set_operation_mode" to "set_preset_mode" with mode=-1 as default ... then it is near perfect ;-)

Tuncay-Ayhan commented 5 years ago

@wwolkers you should rename "set_operation_mode" to "set_preset_mode" with mode=-1 as default ... then it is near perfect ;-)

I did this and it worked for me after that. Can't see any weird things except it's working again?

ualex73 commented 5 years ago

Ok, I also updated my ualex73/toon_climate with the presets ;-) So people can choose which person they want to use, until Ron's back from his holiday.

ualex73 commented 5 years ago

The present "None" should go away with 0.96.3: Introduce PRESET_NONE for climate (@balloob - #25360)

Dennisd80 commented 5 years ago

Thx for the quick fix guys, almost works 100% . But i'm missing the attribute burner_info. For me it's a important one so i can trigger stuff when detecting running my hot water tap (shower). Could somebody point me in te right direction?

ualex73 commented 5 years ago

@Dennisd80 There is no burner information in thermostat component. So this seems a feature request? Also the tap isn't reliable, because it also shows up on my Toon, when it is pre-heating the water. I use a ESP8266 with DS18B20 to detect this.

Dennisd80 commented 5 years ago

Weird thing tho, it was working prior to the update to 0.96. But probably the best route would be the ds18b20.

wwolkers commented 5 years ago

well actually there does seem to be burner info in the info toon gives us:

{"result":"ok", "currentTemp":"2851", "currentSetpoint":"1000", "currentInternalBoilerSetpoint":"6", "programState":"1", "activeState":"0", "nextProgram":"1", "nextState":"2", "nextTime":"1563915600","nextSetpoint":"1000","randomConfigId":"1804289383","errorFound":"255","connection":"0","burnerInfo":"0","otCommError":"0","currentModulationLevel":"0"}

it was never included in the plugin, so would be a feature request. should not be too hard to include though.

ualex73 commented 5 years ago

@wwolkers yes it is in the json output, but I never saw it mapped in the climate component of HA.

Dennisd80 commented 5 years ago

My bad, it was included in the toon Google compenent

pdwonline commented 5 years ago

I use the burnerInfo by including this in my config:

  - platform: rest
    name: toon_burnerinfo
    resource: http://<toonIP>:10080/happ_thermstat?action=getThermostatInfo
    value_template: '{{ value_json.burnerInfo }}'
Dennisd80 commented 5 years ago

@pdwonline : thx, I already copied parts from the toon_google and incorporated it in the "new" toon_climate. But i'm gonna use your rest sensor.

kurniawan77 commented 5 years ago

Ok, I also updated my ualex73/toon_climate with the presets ;-) So people can choose which person they want to use, until Ron's back from his holiday.

Great job with the presets. I use 'Holiday' when the winter has past. Actually this isn't a preset but more an 'off' mode. I personally think it's best to use 'Holiday' as HVAC_MODE_OFF.

I use the burnerInfo by including this in my config:

  - platform: rest
    name: toon_burnerinfo
    resource: http://<toonIP>:10080/happ_thermstat?action=getThermostatInfo
    value_template: '{{ value_json.burnerInfo }}'

Would be a nice implementation.

cyberjunky commented 5 years ago

I have updated the component under home-assistant-custom-components/toon_climate/ Can you all have a look/test? I have implemented on/off by enable/disable schedule on/off like from pull request #36 But manual set temp is then still active, maybe have to change it to Vacation mode as suggested. Also testing with Google assistant has to be done. Attributes burner_info and modulation level are added, you can use them as sensors like so:


 - platform: template
    sensors:
      toon_burner_info:
        friendly_name: 'Ketel Driewegklep'
        value_template: >-
          {% if is_state_attr('climate.toon','burner_info', 0) %}
             Neutraal
          {% elif is_state_attr('climate.toon','burner_info', 1) %}
             CV
          {% elif is_state_attr('climate.toon','burner_info', 2) %}
             Warm Water
          {% else %}
             Onbekend
          {% endif %}
      toon_modulation_level:
        friendly_name: 'Brander Modulatie'
        value_template: "{{ states.climate.toon.attributes.modulation_level }}"
Fietspomp86 commented 5 years ago

Works fine here, just updated it! Thanks a lot for this. Using HA 0.97

I don't use Google Assistant though. But controlling Toon works as it should as far as I can see.