E-thermostaat | ICY


#21

I have the same issue


#22

Hmm, I haven’t followed the latest developments on home assistant. But from the logs it looks as if they might have converted all components to asynchronous updates and stopped supporting the way I was using here.
When I implemented the component, I used the generic thermostat as template, so maybe you can have a look there and compare the versions. The basic protocol should probably still work. As I said I don’t have the thermostat anymore so it’s difficult to debug for me.


#23

I think you are pointing in the right direction. There are some changes, to start with the setup of the platform.

I’ve tried to deal with them but since I’m not a programmer it’s mainly trial and error without knowing what I’m doing. Someone else working on it?


#24

I’ve tried this:

@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
    """Setup the e thermostat."""
    name = config.get(CONF_NAME)
    saving_temp = config.get(CONF_SAVING_TEMPERATURE)
    away_temp = config.get(CONF_AWAY_TEMPERATURE)
    comfort_temp = config.get(CONF_COMFORT_TEMPERATURE)
    username = config.get(CONF_USERNAME)
    password = config.get(CONF_PASSWORD)

    yield from async_add_devices([EThermostaat(
        name, username, password, saving_temp,
        away_temp, comfort_temp)])

But getting the error:

2017-12-09 13:31:09 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform e_thermostaat
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 171, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 352, in wait_for
    return fut.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/lib/python3.6/asyncio/tasks.py", line 179, in _step
    result = coro.send(None)
  File "/config/custom_components/climate/e_thermostaat.py", line 84, in async_setup_platform
    away_temp, comfort_temp)])
TypeError: 'NoneType' object is not iterable
2017-12-09 13:31:09 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/tasks.py", line 179, in _step
    result = coro.send(None)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 399, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 247, in async_add_entity
    yield from entity.async_update_ha_state()
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 231, in async_update_ha_state
    attr)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 333, in _attr_setter
    value = getattr(self, name)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 736, in supported_features
    raise NotImplementedError()
NotImplementedError

#25

That issue is caused by this PR https://github.com/home-assistant/home-assistant/pull/10658.

I have updated the e-thermostaat custom component and it’s working now on v0.59.2.
You can find this version here https://github.com/gerard33/home-assistant/blob/master/e_thermostaat.py.

I have justed changed it, so it’s not quite tested yet.
I noticed the following:

  • the Away switch has disappeared
  • when choosing operation mode Comfort, the correct temperature is choosen (from configuratio.yaml), but operation is shown as Away
  • when choosing operation mode Saving, the correct temperature is choosen, but operation is shown as Comfort
  • the other 2 operations are looking good

Could you please also test it and let me know if you have the same. If so, I will try to fix that.


#26

The away switch is probably gone, since you should enable “SUPPORT_AWAY_MODE”.

See:

Regarding the away/comfort issue:
These values are rather arbitrarily.

I had better luck with these:

FIXED_TEMP = 160
COMFORT = 32
AWAY = 64
SAVING = 24

#27

Good work!
I’ll update mine this afternoon to see if it works.

Before the update, the thermostat already falsely indicated the Away/Comfort mode.

It was also hopping between the two modes randomly, this could also be related.
Everyone left home during the example below.


#28

Yeah the “mode” number is probably some kind of “bit-code”. It changes depending on the other settings of the thermostat. As I said before try changing the SAVING number to 24, that solved the issue for me when I still had the thermostaat. But it could be the same for AWAY and COMFORT, that you have to change the numbers a bit there.

You can add a debug statement

   _LOGGER.debug("configuration number: {}".format(self._old_conf[0]))

here to see what number you are getting.
I match the number to the closest value and return the operation mode here:

But maybe the check should better be a range, i.e. number 0-31 is SAVING, 32-63 is COMFORT, 64-127 is AWAY and > 128 is FIXED_TEMP.


#29

Thanks! Was already trying to change this values a bit based on some other Icy plugins on Github.
Will add your logger to see which values to use.
Appreciate your help, especially now you don’t have this thermostat anymore :slight_smile:

Other question: in my latest version (which is not on Github yet) I have changed the Away mode to “lang-weg” and the Saving mode to “bespaar” as that makes more sense to me.
Any specific reason you had to link the “bespaar” mode to Away?


#30

Great job for this fix. At my system it’s working again. The away switch is shown at my place, and it seems the Away/Comfort mode are both working fine after the config suggestion of @daenny


#31

What exact values did you use?

I managed to retrieve the ‘away mode’ by adding the suggested code, but I’m not sure what values to change to fix the Away/Comfort settings.

I currently have:

# Personal settings in e-thermostaat.nl
DEFAULT_SAVING_TEMPERATURE = 15
DEFAULT_AWAY_TEMPERATURE = 12
DEFAULT_COMFORT_TEMPERATURE = 18.5

And

# Values reverse engineered for settings
FIXED_TEMP = 160
COMFORT = 32
AWAY = 64
SAVING = 0

Should I match the ‘reversed engineered’ settings to my preferences, or are they used elsewhere?
Sorry, I’m not that familiar with Python :sweat_smile:

Thanks!


#32

Thanks for your suggestion! I have implemented this in a new version which is available here https://github.com/gerard33/home-assistant/blob/master/e_thermostaat.py.
With the previous method I had a value of 60 for the Comfort state, which however was mapped to the Saving state, but with the new method this is now mapped correctly.

@sharki and others, if you want to use this version, there are some changes you need to take into consideration:

  • Changed the way operation mode is checked to get better results
  • Away mode is back again, and only applies to AWAY state, not to SAVING state anymore
  • Mapped Away mode to “lang-weg” and the Saving mode to “bespaar”
  • Changed operation modes visible in frontend to Dutch names --> if you want the English text change these lines https://github.com/gerard33/home-assistant/blob/master/e_thermostaat.py#L32-L35

Your configuration.yaml could look like this:

# E-Thermostaat Icy
climate:
  - platform: e_thermostaat
    username: !secret icy_username
    password: !secret icy_password
    comfort_temperature: 18.5
    saving_temperature: 15
    away_temperature: 12

#33

Great work on the code!

The issue remains the same, the only two options my GUI can display is the ‘vaste temperatuur’ (fixed temperature) or ‘bespaarstand’ (savings mode). Both comfort and ‘lang-weg’ directly jump to ‘bespaar’ after setting them.

The int to operation mode you wrote does look like it should have solved that. I have no idea where it goes wrong. After adding the debug line mentioned by daenny it complains that ‘self’ is non-existing.


#34

That is strange as all four options are working here.
Did you copy my complete code? Because I have made a lot of changes, also again to these values

# Values reverse engineered for settings
COMFORT = 32
SAVING = 64
AWAY = 0
FIXED_TEMP = 128

And what I did to easily track the values of the thermostat, I changed

_LOGGER.debug("E-Thermostaat configuration number: {}".format(self._old_conf[0]))

to

_LOGGER.error("E-Thermostaat configuration number: {}".format(self._old_conf[0]))

so that the values are shown in the log, without needing to change the logger component.


#35

Thanks for the quick replies!

Yes, I copied the whole code. I’ll try later if changing the default temperatures (those I did change slightly) solves the problem.

Edit:
@gerard33 After using your code without alterations it works perfectly.
Thanks again!


#36

Hi Guys,
I am new to home assistant and wanted to add this script to read and control my ICY Thermostat.
It loads the component but gives the error:
Config validating

Config error. See dev-info panel for details.

If i look in the dev log i only can see:

starting version 3.2.4
Testing configuration at /config
2018-02-09 21:51:42 ERROR (MainThread) [homeassistant.bootstrap] Unable to setup error log /config/home-assistant.log (access denied)
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up recorder
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up http
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up history
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up api
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up system_log
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain system_log took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up frontend
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up updater
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up discovery
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up map
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up sun
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up group
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up sensor
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up climate
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain updater took 0.4 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain discovery took 0.4 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain map took 0.4 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.4 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain group took 0.4 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.1 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain climate took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up conversation
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up logbook
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up tts
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up config
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up cloud
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up panel_iframe
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up automation
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setting up script
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain cloud took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain panel_iframe took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 0.0 seconds.
2018-02-09 21:51:44 INFO (MainThread) [homeassistant.setup] Setup of domain script took 0.0 seconds.

Can someone please help me?
Thanks in advance.


#37

Just added the custom component by creating a file called : e_thermostaat.py in directory /config/custom_component/climate/
Latest code can be retrieved from :

Added the following in configuration.yaml :

climate:
      - platform: e_thermostaat
        username: !secret icy_username
        password: !secret icy_password
        comfort_temperature: 20
        saving_temperature: 15
        away_temperature: 12

Et voila, I just added a thermostat to my Hass.io setup.
I can confirm this custom component works on version : v0.81.2

Thanks to @daenny & @gerard33 for your code & alterations!


#38

Anyone else having trouble controlling this component through Google Assistant via Nabu Casa?
I could control the thermostat through google assistant before a while ago. I’m not sure what changed. I tried updating my e_thermostaat.py, no go unfortunately.

The thermostat shows up in my google home app, but it cannot be controlled.
If I try to control it by voice (Hey Google, set the thermostat to 20 degrees), the response is: “That mode isn’t available for {{name}}”.

Any ideas?


#39

I don’t use Nabu Casa but I have the same problem.


#40

Hi there,

I’m pretty new with this. Does this also still work on 0.82.1. I don’t get it to work. I don’t know what I have done wrong.

Thanks in advance
Ivo Frenken