Advice how to load sensor info from Plugwise Anna thermostat web interface XML

I have to correct myself: the trick/work-around I described above is still needed

I just updated to 0.94.4 and the climate.anna_thermostat was gone.
I could only get it back after using the work-around.

Hi bouwew, I just wanted to donwload the file from your GitHub but when clicking on it i get 404 page not found?

ok so i have do exactly what you said. Also updated to 0.94.4.
Now before i rebooted HASS when “checking the configuration” it sais:
"invalid configuration CONTROLEER CONFIGURATIE
Platform not found: climate.anna

I assume you need the configurator add-on log?
This is a part of the configurator add-on log where anna is mentioned:

    INFO:2019-06-20 23:04:34,089:hass_configurator.configurator:127.0.0.1 - "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:04:34 +0200] "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 190 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:04:39,120:hass_configurator.configurator:127.0.0.1 - "POST /api/newfile HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:04:39 +0200] "POST /api/newfile HTTP/1.1" 200 108 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:04:39,184:hass_configurator.configurator:127.0.0.1 - "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:04:39 +0200] "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 469 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:04:53,627:hass_configurator.configurator:127.0.0.1 - "POST /api/newfile HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:04:53 +0200] "POST /api/newfile HTTP/1.1" 200 107 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:04:53,687:hass_configurator.configurator:127.0.0.1 - "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:04:53 +0200] "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 747 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:05:04,953:hass_configurator.configurator:127.0.0.1 - "POST /api/newfile HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:05:04 +0200] "POST /api/newfile HTTP/1.1" 200 110 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:05:05,017:hass_configurator.configurator:127.0.0.1 - "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:05:05 +0200] "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 1031 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:05:06,630:hass_configurator.configurator:127.0.0.1 - "GET /api/file?filename=/config/custom_components/anna/__init__.py HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:05:06 +0200] "GET /api/file?filename=/config/custom_components/anna/__init__.py HTTP/1.1" 200 5 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:05:16,448:hass_configurator.configurator:127.0.0.1 - "GET /api/file?filename=/config/custom_components/anna/__init__.py HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:05:16 +0200] "GET /api/file?filename=/config/custom_components/anna/__init__.py HTTP/1.1" 200 5 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:05:22,671:hass_configurator.configurator:127.0.0.1 - "POST /api/save HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:05:22 +0200] "POST /api/save HTTP/1.1" 200 119 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:05:22,731:hass_configurator.configurator:127.0.0.1 - "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:05:22 +0200] "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 1030 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:05:25,797:hass_configurator.configurator:127.0.0.1 - "GET /api/file?filename=/config/custom_components/anna/climate.py HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:05:25 +0200] "GET /api/file?filename=/config/custom_components/anna/climate.py HTTP/1.1" 200 5 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:05:53,985:hass_configurator.configurator:127.0.0.1 - "POST /api/save HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:05:53 +0200] "POST /api/save HTTP/1.1" 200 118 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:05:54,046:hass_configurator.configurator:127.0.0.1 - "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:05:54 +0200] "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 1033 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:05:57,032:hass_configurator.configurator:127.0.0.1 - "GET /api/file?filename=/config/custom_components/anna/manifest.json HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:05:57 +0200] "GET /api/file?filename=/config/custom_components/anna/manifest.json HTTP/1.1" 200 5 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:06:09,459:hass_configurator.configurator:127.0.0.1 - "POST /api/save HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:06:09 +0200] "POST /api/save HTTP/1.1" 200 121 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:06:09,516:hass_configurator.configurator:127.0.0.1 - "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 -
172.30.32.2 - - [20/Jun/2019:23:06:09 +0200] "GET /api/listdir?path=/config/custom_components/anna HTTP/1.1" 200 1035 "htps://kumalic.duckdns.org:8123/api/hassio_ingress/4pVovzk2ctVIEFF56fglsGIRbIHn3PR78MkbTcmweYI/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
INFO:2019-06-20 23:07:06,384:hass_configurator.configurator:127.0.0.1 - "GET /api/listdir?path=/config/custom_components HTTP/1.1" 200 -

Should i reboot with invalid configuration?
Or do the trick/workaround?

Waiting for your awnser :grimacing:

tnx for your time!

Now you must use the work-around:

  • use the configuration-text starting with anna:, see my post above
  • restart HA, there should be an error in the HA log (the log shown on the i-developer page)
  • return to the original configuration-text starting with climate:
  • restart HA once more, now everything should be working

Hi Bouwe,

Thank for your help.

I have done the workaround.

And like you said got an error with configuration-text starting with anna:
019-06-22 09:44:28 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for anna which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-06-22 09:44:34 ERROR (MainThread) [homeassistant.setup] Setup failed for anna: No setup function defined.

But after the filnal reboot stil no entity for anna is shown in state-developer page.

This is the i-dev page log error:

> 
> 019-06-22 09:51:49 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for anna which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
> 2019-06-22 09:51:58 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform anna
> Traceback (most recent call last):
>   File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
>     SLOW_SETUP_MAX_WAIT)
>   File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
>     return fut.result()
>   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/anna/climate.py", line 104, in setup_platform
>     config.get(CONF_MAX_TEMP)
>   File "/config/custom_components/anna/climate.py", line 137, in __init__
>     self.update()
>   File "/config/custom_components/anna/climate.py", line 156, in update
>     self._hold_mode = self._api.get_current_preset(domain_objects)
>   File "/usr/local/lib/python3.7/site-packages/haanna/haanna.py", line 155, in get_current_preset
>     return active_rule.find("directives/when/then").attrib['icon']
> AttributeError: 'NoneType' object has no attribute 'attrib'

This is my configurator text. This is ok right?

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# anna:
#   username: smile
#   password: xxxxxxx
#   host: xxxxxxxxxx
#   port: 80
#   scan_interval: 10

homekit:

ssdp: 
zeroconf:

climate:
  platform: anna
  name: Anna Thermostat
  username: smile
  password: xxxxxxx
  host: xxxxxxx
  port: 80
  scan_interval: 10

It should be:

climate:
  - platform: anna
    name: ...
    username: ...

etcetera.

made the change… restarted HA -> same error
Done the trick/workaround again restarted HA but stil the same problem:

log:

Sat Jun 22 2019 18:04:31 GMT+0200 (Midden-Europese zomertijd)
Error while setting up platform anna
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
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/anna/climate.py”, line 104, in setup_platform
config.get(CONF_MAX_TEMP)
File “/config/custom_components/anna/climate.py”, line 137, in init
self.update()
File “/config/custom_components/anna/climate.py”, line 156, in update
self._hold_mode = self._api.get_current_preset(domain_objects)
File “/usr/local/lib/python3.7/site-packages/haanna/haanna.py”, line 155, in get_current_preset
return active_rule.find(“directives/when/then”).attrib[‘icon’]
AttributeError: ‘NoneType’ object has no attribute ‘attrib’

The haanna.py file mentioned in the log, did you download that one yourself?
And on what version of HA are you on?

don’t know anything about haanna.py file??
In the GitHub download there are only 3 files in de custom_components/anna folder.
and non of them are called haanna.py, right? Where can i find haanna.py file?

im on 0.94.4

also when i go to /usr/local/lib/python3.7/site-package/ there is no folder called /haanna
that is mentioned in the log?

Ok, I understand what is wrong, I think you did not download the manifest.json file from the github? When you open this file on your system in the editor, it should show: "haanna==0.8.0" but it likely does not.
When not, please update the file, you can do this by changing the 7 by an 8, then save the file and then restart HA.
You might need to perform the work-around once more.

Yes i did, well i copied the manifest.json raw code to a file i created via configurator.
And my manifest.json file also shows `“haanna==0.8.0”.

Not sure if that is the problem @Kumalixis having … looking at the errors the get_current_preset fails, that might be the issue. Let me see if I can reproduce that.

@Kumalix which firmware are you on?

hi,

I have Anna firmware version: 1.8.20
HASSIO version 0.94.4

Hoop you can help.

tnx

I don’t have a 1.8 (or experience with that) but I see some updates in https://github.com/laetificat/haanna/pull/3 I did create https://github.com/laetificat/haanna/issues/4 to see if we can figure this out further, otherwise I might bug you to generate the XML for us, but let’s first see if we can get it working :slight_smile:

Just to make sure it (generally) works, can you edit the custom_components/anna/climate.py file and around line 156 add a # in front of the get_presets statement so it looks like the below (the # in front of that specific line) and then restart HASS to pick up the change?

        self._temperature = self._api.get_target_temperature(domain_objects)
        #self._hold_mode = self._api.get_current_preset(domain_objects)
        if self._api.get_mode(domain_objects) == True:

I quickly looked at the haanna code and the error message above. Looks to me that the function get_current_preset performs the non-legacy_anna function, while to should perform the legacy_anna function, because Kumalix has an older Anna. So, there might be something wrong with the legacy_anna detection. Maybe @plamola can help?

Not entirely … it’s within the legacy-loop as I read it, just the if active_rule is None: not picking up right. So apparently the Anna of Kumalix has an active_rule but the dictionary doesn’t have the attribute key.

@Kumalix sorry forgot to mention you on Advice how to load sensor info from Plugwise Anna thermostat web interface XML

Yes, I see what you mean.

yeeeeeey with the edit of climate.py like Compatech suggested i now finally see Anna entity :smiley:

So it works but without preset settings? what to do now?
Is it possible to upgrade firmware of Anna? Mabye that is the easy way?
Im paying for Anna monthly so i could contact the company and ask? or?

On witch firmware version you guys run Anna?

thanx for the help

Good to hear we made some progress!

I’m on 3.1.5 with mine (bought through a store here in NL named after it’s owner) Maybe @plamola can shed some light on how or why, otherwise we’d have to figure out how to get the data from your device to interpret how/why it’s going wrong.