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

@CoMPaTech, heater detection works for me, I’ve seen the state to show “on” when the heating is running.
Furthermore, in HA the following is shown:

climate.anna_thermostat  off	current_temperature: 21
                                min_temp: 4
                                max_temp: 30
                                temperature: 20
                                hold_mode: home
                                friendly_name: Anna Thermostat
                                icon: mdi:thermometer
                                supported_features: 257

I also have made a weekly schedule and enabled that.
Would it be possible to show this as well in the status?

I checked the code a bit, as I am getting a little familiar with parsing XML, I made my own HA-sensor for the AURUM meetstekker that I have at home, I might giving it a try to add some new feature, when I can find some time. Maybe borrow from domoticz: https://github.com/domoticz/domoticz/blob/2178bf5a8e81f0f17ed90674f0382036fa7570a6/hardware/AnnaThermostat.cpp

I already have reading and setting the presets sort-of-ready, but the domoticz part makes it a tiny bit easier. The bigger thing is waiting (or not?) for the original author, but we still could abuse the PR further, do you want commit permissions on my fork so we can work on it together?
Biggest ‘search’ for me was to figure out how to handle presets (as in the schedules), also see my comments in the PR.

UPDATE: while actually trying this I found out that the login and password must be entered every time when a new browser session is opened :frowning:

Or, I was thinking, why not put the whole webpage in HA?

panel_iframe:
  anna:
    title: Plugwise Anna
    icon: mdi:thermometer
    url: http://192.168.xxx.yyy

There is a limitation, this only works when being connected to the home network.
There might be ways around this but I haven’t had time to investigate…

Hi all, first of all, thanks for the great work on implementing this!
Im trying to add the thermostat myself using the latest PR and setting manifest.json to 0.6.1.
However, I get stuck with this error and I can’t seem to get around it:

Error while setting up platform anna
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  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 106, in setup_platform
config.get(CONF_MAX_TEMP)
  File "/config/custom_components/anna/climate.py", line 132, in __init__
self._api = haanna.Haanna(self._username, self._password, self._host, self._port)
TypeError: __init__() takes 4 positional arguments but 5 were given

I downgraded from 0.93.0 to 0.92.2, but this also does not seem to solve it. Any suggestions?

I encountered the same error. I ended up needing to edit the haanna.py file on my system, replacing the content by the updated content from the pull-request. Doing this can be a little complex when you are not familiar with how things “work under the hood”…

@Bodi you actually have to either use the native implementation of the authors plugins, or use both my PRs (https://github.com/laetificat/haanna/pull/2 and https://github.com/laetificat/anna-ha/pull/1). The easiest way though is the ‘under the hood’ as @bouwew mentions it.

Basic steps:

I’ll do a ping on both PRs to the author

@Bodi, here you can find the updated code of the haanna.py file: https://raw.githubusercontent.com/laetificat/haanna/9a3fac303b6df81c9f0bb62f0258b2794dfc99d9/haanna/haanna.py
Using an editor, copy this code into the haanna.py file on you system, after deleting the existing code.

And here you can find the updated code for the anna-ha files: https://github.com/laetificat/anna-ha/tree/dd6e0aa5a30ae3e869694edc1557ecdc1d55eabd/custom_components/anna
click on each file, and then click on the “Raw”-button to get to the “clean” code which can then be copied over.

@CoMPaTech, you could always set up your own repository/fork, this happens quite regularly with other addons, is my impression :slight_smile:
No need to give me commit permissions, I need to pay more attention to my “real life” the coming months :neutral_face: I’m sorry to say…

I’m thinking about buying one of these, but it still seems like a hassle to set it up. @CoMPaTech, any plans to release it directly under HA as a component at some point?

I suggested it to the author, but maybe @bouwew is right and we should move it forward, but as he has already done the PyPI stuff it would be useful not to clash. Let’s give the author another week on GitHub to respond before getting into gear, it’s not that much of a hassle (unless you are in hassio territory indeed).

@CoMPaTech & @bouwew, thanks a lot for your help! Finally got it working by copying the file contents from the PR into the 0.6.1 files. Not the cleanest solution, but I’m glad it works for now. Unfortunately I’m not that familiar with python, but if you require some assistance (with testing or something), I’m happy to help.

@Bodi @takje @bouwew this isn’t by any means a clean way, but to ‘control’ Anna I had to make those changes to the python module as well. I’m sincerely hoping we can get this into the correct gear to make things happening faster.

Never mind, wrote too early…

FYI
I have an older version of Anna (firmware 1.8.20), which is not compatible with the current haanna implementation. Reading the temperatures works, but setting a new temperature fails, because the domain_objects tree differs.

I am working on a ‘downgraded’ version of haanna, which does support v1.8. Once that is done, I’ll look into creating an auto-detect version of haanna, which supports both models.

Edit: WIP repo at https://github.com/plamola/haanna/blob/annav1.8x/haanna/haanna.py

Edit 2: Everything fixed, except the set_mode, which I will finish next week. Auto-detection also working. Will create a PR when done.

I tried installing the latest version of anna-ha from github, but it won’t load properly in Home Assistant.
When I try to configure the component, Home Assistant gives the following error:

Platform not found: climate.anna

The following is logged on startup though:

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.

What am I doing wrong?
I am running Home Assistant 0.93.2

@wburgers The current anna-ha on github has not been updated yet and is not compatible with Home Assistant 0.93

You will need the updated version from the pull request made by @CoMPaTech.
See the instructions by @CoMPaTech, about 7 comments above your comment.

@plamola The PRs by @CoMPaTech have been merged, so it has been updated :wink:
That is why I am confused it didn’t work.
Sorry if that was not clear.

@wburgers I had the same problem: Platform not found: climate.anna

After enabling debug logging, I found out the initialization of anna-ha failed.
The reason was, I have an older version of Anna (firmware v1.8.20) which is not supported by the haanna library. Once I fixed the library, I got it working.

So you might want to check the firmware version of your Anna.

And you might need to add

min_temp: 4
max_temp: 30

to your anna configuration, which is not mentioned in the readme.
Not sure if that breaks anything when missing, but might be worth to check out.

The Anna custom_component is now updated on github. So, follow the installation instructions and it should work, after a restart of HA.

Thanks @plamola and @bouwew for your suggestions.
I figured it out eventually.
I use this image to run HA.
It doesn’t do any fancy stuff, that is why the image is fairly small.
So there is also no automatic pip install step…
haanna.py was missing and therefore the component would not load correctly.