krocat / ToonHA

Home-Assistant component for Toon by Eneco

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module borked, installation instructions wrong, no custom components, and so forth

henriz opened this issue · comments

I am installing Home Assistant with Toon. This simply does not work (yet).

I installed the latest home assistant version on a raspberry pi running raspbian. Home assistant is working.

When setting up toon in the configuration.yaml, it only allowes client_id and client_secret as config values (which are the toon API key/secret). So you can't link a contract.

After some searching, I found this github. I understand that the included toon version in homeassistant is obsolete.

So I tried installing it. This does not work. The unstructions say to copy the files to config/custom_components, however, on a fresh installation THERE IS NO SUCH FOLDER

After looking, I found toon here:
/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/toon

So I placed the files there, overwriting the existing ones. Now I can set all the correct configuration.yaml items (like consumer_key, and so forth).

However, this produces this error on startup:
Unable to prepare setup for platform toon.sensor: Platform not found (No module named 'custom_components.toon').

So I removed the folder
/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/toon
all together, and created a custom_components/toon folder in my config folder, and put the files there.

This works, but now I get:
Unable to prepare setup for platform toon.climate: Platform not found (cannot import name 'STATE_AUTO' from 'homeassistant.components.climate.const'

This was a bug which is supposed to be fixed, but apparently is not.

I do now get some toon data into home assistant, but still errors.

I realy appreciate people making stuff for hassio, but please, make sure they work or there are correct installation instructions. This is getting rediculous.

In fact, grepping the entire code for home assistant, "STATE_AUTO" does not occur anywhere. IT's not an existing const anymore, apparently.

After adding:

STATE_AUTO = "auto"
STATE_HEAT = "heat"
STATE_ECO = "eco"
STATE_COOL = "cool"
SUPPORT_OPERATION_MODE = 1

To the bottom of /srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/climate/const.py

the constants are found again. The above ones were missing.

But.. then hassio sais this:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 254, in async_update_ha_state
self._async_write_ha_state()
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 278, in _async_write_ha_state
state = self.state
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/climate/init.py", line 176, in state
return self.hvac_mode
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/climate/init.py", line 279, in hvac_mode
raise NotImplementedError()
NotImplementedError

I think I found the issue. The consts have probably been renamed to HVAC_MODE_AUTO and so forth

There's more issues. The ECO mode does not exist anymore, and apparently a task exception was not implemented.

Basically, what it boils down to is that the current version of Home Assistant does NOT work with this module anymore.

I'm in the process of changing the module so it will work again. Apparently, they have changed a lot in the climate section.

The climate section now knows presets, and the mentioned modes do not exist anymore, of have been replaced by hvac_mode stuff. Also the async call is not implemented.

In short; I'm going to take the nest climate.py and use it to rebuild the HA climate.py.

You are totally right that this component does not work anymore. A lot has been changed after the 0.88 update.

I was the last person who worked on this. I made it work for HA 0.88
After that I left this alone because @frenck integrated a really nice new version in HA

If you are running the latest version of HA I would advice you to use the intergrated component in HA

If you are using a older version of HA I could help you.

Aargh :)

I came here because the integrated version does not work, or has incomplete installation instructions :)

It has (in the documentation at least) no way to link the tenant contract to the developersaccount.

You do not need to link both accounts.

Preform this step in HA

  • 7Add the Toon integration to your configuration.yaml and restart Home Assistant. Then, go to Configuration > Integrationsand select CONFIGURE next to Toon and follow the setup instructions
    (Login with your tenant account)

As mentioned this is only historical and does not work for a long time now, since things are properly integrated in HA,