Viessmann Component

They are sent directly to the API.

I have uploaded a new custom component which makes use of PyViCare 0.1.10 which reduces the number of API requests towards the Viessmann services (thanks @crazyfx1 !).

Now you can set a scan_interval parameter to whatever suits your needs. The default value is 60 seconds.

Letā€™s see how it holds up.

1 Like

Nice work. I will try it out as soon as my daily ban is expired :wink:

guysā€¦could some-one please give detailed instructions how to get the custom_component installed & active ?
And, after installation - is there a way to verify that HA is actually using the custom instead of the normal integration ?

Things that I did (have installed HA in Python venv on my raspi 4 4GB):

Updating PyViCare to 0.1.10:
Login via shell then change user to homeassistant, and enter Python venv:

sudo -u homeassistant -H -s
cd /srv/homeassistant
source bin/activate

Now update PyViCare:

pip3 install --upgrade PyViCare
exit

Now clone ha_vicare custom component (https://github.com/oischinger/ha_vicare) from git:

cd ~
sudo git clone https://github.com/oischinger/ha_vicare.git

Now move downloaded folder into homeassistant custom component folder:

mv ha_vicare/vicare /home/homeassistant/.homeassistant/custom_components

Then restart HA and it will automatically choose the custom component instead of the official.

@oischinger: I saw, that SCAN_INTERVAL = 900 secs. which was introduced 8 days ago, is still alive in code. Is that correct? I thought, that from version 0.1.10, PyViCare will manage that the Viessmann api will not be fired with requests. Thanks for a short statement.

@Tommmii
Installing it is super-simple: Just download the files in here: https://github.com/oischinger/ha_vicare/tree/master/vicare and put them under HOME_ASSISTANT_CONFIG_DIR/custom_components/vicare

On startup you will get a log entry in Home Assistant that vicare is a custom component and might not have been tested, etc.
You will also notice it because the update frequency of the ViCare data is higher if you plot it on a graoh :wink:

Thanks for the hint with the SCAN_INTERVAL=900. I fixed that now on master.

Note that you should not have to manually update to pyvicare 0.1.10. In my case Home assistent did that for me because I added it to manifest.json

Ah okay, thanks for information. I didnā€™t knew, that HA will update to version concerning manifest.json :slight_smile:

Is adding vicare: to the yaml configuration needed, or is the custom component added via the Integrations page ?

well, something isnā€™t working as expected, values donā€™t update.

āžœ  vicare pwd
/config/custom_components/vicare
āžœ  vicare ls -lha
total 44K    
drwxr-xr-x    3 root     root        4.0K Mar 25 11:21 .
drwxr-xr-x    3 root     root        4.0K Mar 25 10:17 ..
-rw-r--r--    1 root     root          17 Mar 24 21:38 .gitignore
-rw-r--r--    1 root     root        2.7K Mar 24 21:38 __init__.py
drwxr-xr-x    2 root     root        4.0K Mar 25 11:21 __pycache__
-rw-r--r--    1 root     root       11.5K Mar 24 21:38 climate.py
-rw-r--r--    1 root     root         222 Mar 24 21:38 manifest.json
-rw-r--r--    1 root     root        5.9K Mar 24 21:38 water_heater.py
āžœ  vicare 
āžœ  vicare ha core restart & tail -f /config/home-assistant.log
[1] 1047
ā£¾ Processing... 
ā£Æ Processing... 2020-03-25 12:40:35 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for vicare which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
ā£Æ Processing... 2020-03-25 12:40:53 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.vicare_heatcurve_target_temperature fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/template/sensor.py", line 224, in async_update
    self._state = self._template.async_render()
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 221, in async_render
    return compiled.render(kwargs).strip()
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
Processing... Done.
Command completed successfully.

[1]  + 1047 done       ha core restart

My yaml config :

vicare:
  username: !secret vicare_email
  password: !secret vicare_password
  heating_type: gas
  scan_interval: 60

This is a failure of a sensor that is not from my integration: sensor.vicare_heatcurve_target_temperature

Does the integration also fail?

Yours didnā€™t refresh, but then I saw above that the 900s interval was still hardcoded.
Updated to the newer version, seems ok now.

I did get the sensor.vicare_heatcurve_target_temperature from you, indirectly :

The sensor.vicare_heatcurve_target_temperature seems to not cope well with None-values, which occur when there was no update from the servers yet.
The template can be written differently. Once I find some time Iā€™ll upload some better yaml examples for monitoring with individual sensors.

1 Like

So far so good, on the custom component, 24hours with scan_interval: 60 and no ban from VSMN.

Same here. Works good so farā€¦

I created a PR towards the next home assistant release. So expect this to be integrated soon.

I also documented the scan_interval feature explaining a little bit Viessmanā€™s rate limits and the consequences here:

2 Likes

Good work , thank you !!

Just letting you know ; something went wrong with the formatting of the Configuration chapter on the Github docs page.

I cant get the sensors to show up i used the config:

sensor:
 platform: template
 sensors:
   vicare_outside_temperature:
        friendly_name: "Vanjska Temperatura"
        unit_of_measurement: 'Ā°C'
        value_template: "{{ state_attr('climate.vicare_heating', 'outside_temperature') }}" 

   vicare_inside_temperature:
        friendly_name: "unutrasnja Temperatura"
        unit_of_measurement: 'Ā°C'
        value_template: "{{ state_attr('climate.vicare_heating', 'temperature') }}"

type is:
heating_type: heatpump

No logs, no errors just gets stuck on no data. Any idea what i could have done wrong?

Temparature display works without problems and heating pump alsoā€¦ so no idea what i am missing.

I can just write you for vicare. They kicked me out (maybe you too ?)

4 weeks ago they wrote me an email that they will check the API IFC because to many calls -_- 1 week ago they said they gonna turn it down.

we all got that email, no one got permanently banned. 24 hour ban is the max they handed out.

@Sangoku , do you have the vicare: integration configured ?