signalkraft / mypyllant-component

Home Assistant component for the myVAILLANT API, controls Vaillant devices such as aroTHERM heatpumps and ecoTEC boilers
https://signalkraft.com/mypyllant-component/
MIT License
129 stars 19 forks source link

ValueError: 'none' is not a valid ControlIdentifier #207

Open Commifreak opened 3 weeks ago

Commifreak commented 3 weeks ago

Before submitting a new issue

Problem description

During setup I get:

2024-09-06 18:10:06.213 ERROR (MainThread) [custom_components.mypyllant.coordinator] Unexpected error fetching myVAILLANT data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/coordinator.py", line 213, in _async_update_data
    async for system in await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.12/site-packages/myPyllant/api.py", line 338, in get_systems
    control_identifier = await self.get_control_identifier(home.system_id)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myPyllant/api.py", line 1213, in get_control_identifier
    return ControlIdentifier(control_identifier)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/enum.py", line 757, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/enum.py", line 1171, in __new__
    raise ve_exc
ValueError: 'none' is not a valid ControlIdentifier

But the data collection works! I dont want to attached everything because of personal data, but be assured: The debug log shows all homes!

The line just before the trace is:

2024-09-06 18:10:06.100 DEBUG (MainThread) [custom_components.mypyllant] Refreshing DailyDataCoordinator
2024-09-06 18:10:06.100 DEBUG (MainThread) [custom_components.mypyllant.coordinator] Starting async update data for DailyDataCoordinator
2024-09-06 18:10:06.100 DEBUG (MainThread) [custom_components.mypyllant.coordinator] Waiting 119s until token refresh for kontakt@kluthr.de
2024-09-06 18:10:06.101 DEBUG (MainThread) [myPyllant.http_client] Starting GET to https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/homes
2024-09-06 18:10:06.157 DEBUG (MainThread) [myPyllant.http_client] Got response for GET to https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/homes: ........,"productMetadata":{"productType":"VR921","productionYear":"22","productionWeek":"42","articleNumber":"0020260962"},"state":"CLAIMED","migrationState":"FINISHED","migrationFinishedAt":"2024-03-19T20:05:30.354270431Z","onlineState":"ONLINE","firmware":{"version":"0357.40.35","connectedToOldIoTPlatform":null,"updateEnabled":true,"updateRequired":false},"nomenclature":"VR 921","cag":false,"countryCode":"DE","productInformation":"VR921","firmwareVersion":"0357.40.35"}]
2024-09-06 18:10:06.158 DEBUG (MainThread) [myPyllant.http_client] Starting GET to https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/systems/myhome/meta-info/time-zone
2024-09-06 18:10:06.212 DEBUG (MainThread) [myPyllant.http_client] Got response for GET to https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/systems/myhome/meta-info/time-zone: {"timeZone":"Europe/Berlin"}

Logs

see above

olafz commented 6 days ago

I have the same error, but in my case data collection also does not work. When I remove the integration and add it again, there are no devices or entities:

ValueError: 'none' is not a valid ControlIdentifier
2024-09-24 22:13:33.450 ERROR (MainThread) [custom_components.mypyllant.coordinator] Unexpected error fetching myVAILLANT data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/coordinator.py", line 213, in _async_update_data
    async for system in await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.12/site-packages/myPyllant/api.py", line 338, in get_systems
    control_identifier = await self.get_control_identifier(home.system_id)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myPyllant/api.py", line 1213, in get_control_identifier
    return ControlIdentifier(control_identifier)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/enum.py", line 757, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/enum.py", line 1171, in __new__
    raise ve_exc
ValueError: 'none' is not a valid ControlIdentifier
2024-09-24 22:13:34.815 WARNING (MainThread) [custom_components.mypyllant.binary_sensor] No system data, skipping binary sensors
2024-09-24 22:13:34.815 WARNING (MainThread) [custom_components.mypyllant.calendar] No system data, skipping calendar entities
2024-09-24 22:13:34.815 WARNING (MainThread) [custom_components.mypyllant.climate] No system data, skipping climate
2024-09-24 22:13:34.816 WARNING (MainThread) [custom_components.mypyllant.datetime] No system data, skipping date time entities
2024-09-24 22:13:34.816 WARNING (MainThread) [custom_components.mypyllant.number] No system data, skipping number entities
2024-09-24 22:13:34.816 WARNING (MainThread) [custom_components.mypyllant.sensor] No system data, skipping sensors
2024-09-24 22:13:34.816 WARNING (MainThread) [custom_components.mypyllant.sensor] No daily data, skipping sensors
2024-09-24 22:13:34.816 WARNING (MainThread) [custom_components.mypyllant.switch] No system data, skipping switch entities
2024-09-24 22:13:34.816 WARNING (MainThread) [custom_components.mypyllant.water_heater] No system data, skipping water heater
signalkraft commented 1 day ago

There should be a debug log for an API endpoint ending in /control-identifier:

Got response for GET to https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/systems/.../meta-info/control-identifier: {"controlIdentifier":"tli"}

Could you share that?