thomasgermain / pymultiMATIC

Python interface with Vaillant multiMATIC
MIT License
56 stars 11 forks source link

Error in climate entity during startup #35

Closed h4de5 closed 4 years ago

h4de5 commented 4 years ago

it worked earlier today - but after some restarts of home-assistant I do only get those messages and the climate entity is gone:

2020-07-01 23:51:48 ERROR (MainThread) [homeassistant.components.climate] Error while setting up vaillant platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 443, in _async_add_entity
    entity.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
    self._async_write_ha_state()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
    state = self.state
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 173, in state
    return self.hvac_mode
  File "/config/custom_components/vaillant/climate.py", line 155, in hvac_mode
    hvac_mode = self.mode_to_hvac(self.active_mode.current)
  File "/config/custom_components/vaillant/climate.py", line 347, in active_mode
    return self._system.get_active_mode_zone(self.component)
  File "/usr/local/lib/python3.7/site-packages/pymultimatic/model/system.py", line 133, in get_active_mode_zone
    mode: ActiveMode = zone.active_mode
  File "/usr/local/lib/python3.7/site-packages/pymultimatic/model/zone.py", line 72, in active_mode
    return self.heating.active_mode
  File "/usr/local/lib/python3.7/site-packages/pymultimatic/model/common.py", line 52, in active_mode
    setting = self.time_program.get_for(datetime.now())
  File "/usr/local/lib/python3.7/site-packages/pymultimatic/model/timeprogram.py", line 107, in get_for
    tp_day = self.days[day]
KeyError: 'wednesday'
thomasgermain commented 4 years ago

Did you turn off your vrc 700 or your boiler ?

h4de5 commented 4 years ago

Just the home-assistant..app still works.

thomasgermain commented 4 years ago

yes, I understood you restarted HA, but did you turn off your vrc 700 or your boiler ?

h4de5 commented 4 years ago

Oh sorry. No i have not tried that yet. Ill do so later today

thomasgermain commented 4 years ago

ok ok; so don't turn it off. I already had the same kind of problem when I turned my vrc 700 off.

So, other question :stuck_out_tongue:, do you have any time program for Wednesday for that zone ?

h4de5 commented 4 years ago

cooling (through the floor heating system) is currently set to: monday till sunday, 0-24h and the water boiler is set to: monday till sunday, 6:30-9:00 and 15:30-19:20

for some reasons I don't get to fire the logging from that file.

h4de5 commented 4 years ago

ok - logging works now:

2020-07-02 23:13:35 INFO (MainThread) [SystemManager] Search for day thursday
2020-07-02 23:13:35 INFO (MainThread) [SystemManager] Found days {}
2020-07-02 23:13:35 INFO (MainThread) [SystemManager] Search for day thursday
2020-07-02 23:13:35 INFO (MainThread) [SystemManager] Found days {'monday': TimeProgramDay(settings=[TimePeriodSetting(start_time='00:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=0, minute=0, absolute_minutes=0), TimePeriodSetting(start_time='06:30', target_temperature=None, setting=SettingMode(name='ON'), hour=6, minute=30, absolute_minutes=390), TimePeriodSetting(start_time='09:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=9, minute=0, absolute_minutes=540), TimePeriodSetting(start_time='15:30', target_temperature=None, setting=SettingMode(name='ON'), hour=15, minute=30, absolute_minutes=930), TimePeriodSetting(start_time='19:20', target_temperature=None, setting=SettingMode(name='OFF'), hour=19, minute=20, absolute_minutes=1160)]), 'tuesday': TimeProgramDay(settings=[TimePeriodSetting(start_time='00:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=0, minute=0, absolute_minutes=0), TimePeriodSetting(start_time='06:30', target_temperature=None, setting=SettingMode(name='ON'), hour=6, minute=30, absolute_minutes=390), TimePeriodSetting(start_time='09:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=9, minute=0, absolute_minutes=540), TimePeriodSetting(start_time='15:30', target_temperature=None, setting=SettingMode(name='ON'), hour=15, minute=30, absolute_minutes=930), TimePeriodSetting(start_time='19:20', target_temperature=None, setting=SettingMode(name='OFF'), hour=19, minute=20, absolute_minutes=1160)]), 'wednesday': TimeProgramDay(settings=[TimePeriodSetting(start_time='00:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=0, minute=0, absolute_minutes=0), TimePeriodSetting(start_time='06:30', target_temperature=None, setting=SettingMode(name='ON'), hour=6, minute=30, absolute_minutes=390), TimePeriodSetting(start_time='09:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=9, minute=0, absolute_minutes=540), TimePeriodSetting(start_time='15:30', target_temperature=None, setting=SettingMode(name='ON'), hour=15, minute=30, absolute_minutes=930), TimePeriodSetting(start_time='19:20', target_temperature=None, setting=SettingMode(name='OFF'), hour=19, minute=20, absolute_minutes=1160)]), 'thursday': TimeProgramDay(settings=[TimePeriodSetting(start_time='00:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=0, minute=0, absolute_minutes=0), TimePeriodSetting(start_time='06:30', target_temperature=None, setting=SettingMode(name='ON'), hour=6, minute=30, absolute_minutes=390), TimePeriodSetting(start_time='09:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=9, minute=0, absolute_minutes=540), TimePeriodSetting(start_time='15:30', target_temperature=None, setting=SettingMode(name='ON'), hour=15, minute=30, absolute_minutes=930), TimePeriodSetting(start_time='19:20', target_temperature=None, setting=SettingMode(name='OFF'), hour=19, minute=20, absolute_minutes=1160)]), 'friday': TimeProgramDay(settings=[TimePeriodSetting(start_time='00:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=0, minute=0, absolute_minutes=0), TimePeriodSetting(start_time='06:30', target_temperature=None, setting=SettingMode(name='ON'), hour=6, minute=30, absolute_minutes=390), TimePeriodSetting(start_time='09:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=9, minute=0, absolute_minutes=540), TimePeriodSetting(start_time='15:30', target_temperature=None, setting=SettingMode(name='ON'), hour=15, minute=30, absolute_minutes=930), TimePeriodSetting(start_time='19:20', target_temperature=None, setting=SettingMode(name='OFF'), hour=19, minute=20, absolute_minutes=1160)]), 'saturday': TimeProgramDay(settings=[TimePeriodSetting(start_time='00:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=0, minute=0, absolute_minutes=0), TimePeriodSetting(start_time='06:30', target_temperature=None, setting=SettingMode(name='ON'), hour=6, minute=30, absolute_minutes=390), TimePeriodSetting(start_time='09:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=9, minute=0, absolute_minutes=540), TimePeriodSetting(start_time='15:30', target_temperature=None, setting=SettingMode(name='ON'), hour=15, minute=30, absolute_minutes=930), TimePeriodSetting(start_time='19:20', target_temperature=None, setting=SettingMode(name='OFF'), hour=19, minute=20, absolute_minutes=1160)]), 'sunday': TimeProgramDay(settings=[TimePeriodSetting(start_time='00:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=0, minute=0, absolute_minutes=0), TimePeriodSetting(start_time='06:30', target_temperature=None, setting=SettingMode(name='ON'), hour=6, minute=30, absolute_minutes=390), TimePeriodSetting(start_time='09:00', target_temperature=None, setting=SettingMode(name='OFF'), hour=9, minute=0, absolute_minutes=540), TimePeriodSetting(start_time='15:30', target_temperature=None, setting=SettingMode(name='ON'), hour=15, minute=30, absolute_minutes=930), TimePeriodSetting(start_time='19:20', target_temperature=None, setting=SettingMode(name='OFF'), hour=19, minute=20, absolute_minutes=1160)])}

it seems there is no program saved for ZONE1 which should be 0-24h monday-sunday.

the other zone is shown correctly.

h4de5 commented 4 years ago

It may be occured due to a restart thou.. The vaillant system had an error state and the reset button on the heating pump has been pressed. (Just been informed of that now)

Still the problem persists e even after a home assistant restart. I am adding that reconnect automatism right now - would that help?

h4de5 commented 4 years ago

Any news on this one? I removed everything (including the existing entities from hass) and started again - but I do no longer the working setup anymore (with both the floor-heating and the warm-water cycle) displayed correctly. I also tried to give both zones a time program - but it still does not work.

thomasgermain commented 4 years ago

Hi,

no news sorry, I had less time to focus on the project.

So, first, does it still occur ?

Do you have any heating timeprogram ? (By the way, do you have any heating system related to vaillant) ? It could actually be something hard to fix, because when starting the project, I made the (wrong) assumption there will always have a timeprogram for heating. But now, I see vaillant is selling cooling system

EDIT: By the way, it seems you are confident with python, if it's the case, can I ask you to run the script/dump.py ? Usage is dump.py user password and it creates some dump json file. It will get some raw api response that I may need to implement correctly the cooling. The script already remove the serial id of your facilities, but I also recommend to have a look and check if there is no private/personal data.

Many thanks,

Thomas

h4de5 commented 4 years ago

yes. it does still occur.

/edit: after writing this post now for like an hour and getting together all the information .. I think I can solve it already ;)

What I didn't get in the first place, was that there is a sensor for the "warmwassertemperatur speicher" which shows what I actually wanted to know. I missed that, because I thought the invalid zone/climate would give me that reading.

image

I looked into the dump result and it does show the following for ZONE 1:

{
    "body": {
        "zones": [
            {
                "heating": {
                    "configuration": {
                        "mode": "AUTO",
                        "setback_temperature": 15.0,
                        "setpoint_temperature": 30.0
                    }
                },
                "configuration": {
                    "name": "ZONE 1    ",
                    "enabled": false,
                    "active_function": "HEATING",
                    "inside_temperature": 25.8,
                    "quick_veto": {
                        "active": false,
                        "setpoint_temperature": 21.0
                    }
                },
                "_id": "Control_ZO1"
            },

"enabled": false,

Zone 1 is indeed a dead zone - somehow left by the vaillant engineers. everything heating related is configured on zone 2 (FBHZ)

image

I think it should be enough to check for this enabled flag to get rid of the error i guess.

dump_result.zip

thomasgermain commented 4 years ago

Thanks a lot for the feedback!

It should be easy to fix, I can get a fix by tomorrow.

As far as I know, there are always 2 zones (I guess this is hardcoded) but this is strange you are the only one to have the issue.

h4de5 commented 4 years ago

see: https://github.com/thomasgermain/pymultiMATIC/pull/37 and https://github.com/thomasgermain/vaillant-component/pull/14

thomasgermain commented 4 years ago

By the way, you're issue should be fix by the 1.3.1 release of the component: https://github.com/thomasgermain/vaillant-component/releases/tag/1.3.1

h4de5 commented 4 years ago

Thanks. Since a few days i do not get any connection to vaillant at all. Even the app says user not found. Is this just me or a vaillant problem?

thomasgermain commented 4 years ago

I don't have any problem, maybe you can open an issue, it could be related to authentication, so maybe I can do something

h4de5 commented 4 years ago

I just heard back from vaillant support - it seems they deactivated my account just last week, because the username (which they created for me) did not meet some criteria ..

anyways - all good now. no startup problems, and once that system error reoccurs I will see if the automations work..