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

Dear Anna users, I have released a new development-version of the Plugwise custom_component with several fixes for reported issues, https://github.com/bouwew/anna-ha
Changes in climate.py:

  • add reading direct_objects
  • read keys boiler_state, central_heating_state and cooling_state from direct_objects
  • include the boiler_state key in detecting various hvac-states

Be sure to include the manifest.json file as this points to my updated haanna-version 0.14.2:
Various fixes:

  • roll back the removed datetime- and pytz-related functionality, this is needed, without this a previous active schema cannot be re-enabled when being turned off (“new” Anna)
  • fwestenbergs fixes for more than one Anna in one HA system (both “legacy” and “new” Anna)
  • also read direct_objects as there is the boiler_state key that indicates heating on/off for certain type of installations (both)
  • add get_boiler_state function (both)
  • add working fix for illegal “&” character (both)

Please test the new code and let me know your results, thank you.

Hi!
Thanks for all the amazing work @bouwew!!

I did buy a Plugwise Adam and Lisa past week and want to look if i can help with something to integrate it into HA.
let me know if you want to make this happen :slight_smile:

I’m not a coder but probably i can help in some way…

Yes, I have the plan to add support for the Plugwise Adam and connected devices.
This might take a while, but when I have something that needs testing, I will let you know.

1 Like

Update: FYI, HA version 0.105.0 scheduled for release tomorrow(?) will indeed contain the recent Plugwise updates.

Dear Anna users, I’ve made some more, “under-the-hood”-changes to the haanna-library and because of these changes the plugwise component was updated too. This is the code that will be released into HA official (0.105.0 ?).
If you want to try it before the release: https://github.com/bouwew/anna-ha

1 Like

Just to be clear and not create false expectations: this update does not provide support for the Adam.
I’m working on that, when there is news, I will post it here as well.

1 Like

I also bought a Anna to my plugwise family, i want to integrate it but i keep getting the same error as @Mariusthvdb

2020-02-05 16:32:05 ERROR (MainThread) [homeassistant.components.climate] plugwise: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 299, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, 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 "/usr/src/homeassistant/homeassistant/components/plugwise/climate.py", line 281, in update
    self._domain_objects
  File "/usr/local/lib/python3.7/site-packages/haanna/haanna.py", line 373, in get_schedule_temperature
    return float(measurement)
TypeError: float() argument must be a string or a number, not 'NoneType'

He did mention something about a schedule you have to make. i assumed need a schedule in anna webinterface or did you guys mean something else with a schedule?

@bjornberg if you create a schedule (or schema) in the plugwise (web)interface or app it should work

i.e. open the app, press the settings cog/wheel and under schema’s there should be something in addition to “Thermostat schedule”

Thanks @CoMPaTech it seems that i bought(second hand) a old version.

found the error, i didn’t activated the schedule(schema) on Anna itself…
Anna is found in HA now! thanks guys!

@bjornberg

First, did you add the line legacy_anna: true in your config? This could be the first reason for the error that you see.

When yes, please upgrade to HA 0.105 and try the updated official Plugwise component :slight_smile:
When you remove the schedule that you have created, and restart HA, does the error return?

after home assistant update:

no more thermostat again…

Did it work before? Did you try with any of the development updates? Do you remember any details about the last working haanna-version?

it works fine except after some home assistant updates it seems. this one broke down with the latest update. the version before worked fine.

running home assistant in docker (latest version since docker auto updates)

I fixed it last christmas by deleting all configs and starting from scratch pretty much.
not going to do that again.

how do I use the development updates? it seems to work fine if I manually download a dev version but then with every official home assistant update that changes the plugwise component it also stops working.

The development version is now the same as the official HA version.

A question, how did you switch from the development version to the official version?
By changing - platform: plugise_dev to - platform: plugwise in configuration.yaml?
Or do you happen two run official and dev in parallel?

Also, which Anna+Smile do you have? Firmware 3.x or 1.x?

I used to drop the github files in home assistant and switched over to plugwise_dev.

but with this current installation I did a complete new install with docker so no dev version has been touched.

its just that with every update you get the error above. It must be a docker problem. do you run HACS yourself? it might be related to that aswell.

I do have a legacy anna 1.8xxx

Ok, clear, it sounds like your installation is OK.
I’m running Hassio in VM, but your way should work as well. I also use HACS.

I will have a look at the code, and thanks for letting me know that you have a legacy anna.
You do have the line legacy_anna: true in your configuration.yaml file, I hope?

@Belgarion I found the problem. Can you please change in the plugwise manifest.json file the line:"requirements": [...], the contents between [ and ] to:

"https://github.com/bouwew/haanna-1/archive/master.zip#haanna==0.14.2"

Then save the file and restart HA. The error should be gone.

@bouwew Where can I find the json? From my understanting the components are docker side which I cant edit. only thing that I have exposed is the configuration files.

or do I need to download it as a custom component?

PS! appreciating you looking into this. will this mean that for the next HA it will be permanently fixed? if that’s the case then I am ok waiting another week or so since I also have the thermostat in the iframe with no critical automations linked to it.

That is the goal, to permanently fix things. But as I do not have a legacy Anna, I sometimes take a stab in the dark and have to rely on users like you to be able to fix bugs.
So, you feedback is also appreciated.

I’m quite sure the update will fix your problem. I just hope no new problem comes up.
Probably today or tomorrow I will create a pull-request to HAC for this, but I’m waiting for feedback from another user. Maybe he has found an additional bug.

seems the update of the Plugwise to version 3.1.11 causes an error in HA integration (currently on HA 105.5) ?

seeing this in the logs:

2020-02-21 23:23:46 ERROR (MainThread) [homeassistant.components.climate] plugwise: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, 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 "/usr/src/homeassistant/homeassistant/components/plugwise/climate.py", line 276, in update
    self._domain_objects
  File "/usr/local/lib/python3.7/site-packages/haanna/haanna.py", line 165, in get_last_active_schema_name
    last_schema_active = self.get_last_active_name(root, rule_id)
  File "/usr/local/lib/python3.7/site-packages/haanna/haanna.py", line 552, in get_last_active_name
    schema_time = datetime.datetime.strptime(corrected, date_format)
  File "/usr/local/lib/python3.7/_strptime.py", line 577, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/lib/python3.7/_strptime.py", line 359, in _strptime
    (data_string, format))
ValueError: time data '2020-02-20T19:16:34+0100' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'

anyone else with this error?

Please update haanna to version 0.14.2 in manifest.json.
Does that solve the problem?