mypyllant-component
mypyllant-component copied to clipboard
VR921 internet module, with VR33 OpenTherm controller
Problem description
Hello, I have a VR921 internet module which is returned over the API in /homes call, but then since control id is missing, no other data is fetched (see logs below). Also there is an an error which asks to report itself as an issue, not sure if its just about the control id or something else. I am controlling the heater over VR33 OpenTherm interface, and the mobile app also does not show any control information.
- Howevere the mobile app does show electric energy and gas consumption over time, is there no way to access these statistics in absence of controller?
- Or would be even more fun if VR33 controller was accessible somehow over another API, surely it has quote some data and sensors too. Let me know if I can poke around with some other API calls / debug something else.
Logs
2024-06-22 10:30:03.972 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-06-22 10:30:03.972 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration mypyllant which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-06-22 10:30:06.091 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues
2024-06-22 10:30:06.336 DEBUG (MainThread) [custom_components.mypyllant] Starting mypyllant component v0.7.3 (library 0.8.12) with homeassistant 2024.6.4, pydantic 1.10.15, and aiohttp 3.9.5
2024-06-22 10:30:06.336 DEBUG (MainThread) [custom_components.mypyllant] Creating API and logging in with xxx in realm belgium
2024-06-22 10:30:07.982 DEBUG (MainThread) [custom_components.mypyllant] Refreshing SystemCoordinator
2024-06-22 10:30:07.982 DEBUG (MainThread) [custom_components.mypyllant.coordinator] Starting async update data for SystemCoordinator
2024-06-22 10:30:07.982 DEBUG (MainThread) [custom_components.mypyllant.coordinator] Waiting 119s until token refresh for xxx
2024-06-22 10:30:07.983 DEBUG (MainThread) [myPyllant.http_client] Starting request TraceRequestStartParams(method='GET', url=URL('https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/homes')
2024-06-22 10:30:08.704 DEBUG (MainThread) [myPyllant.http_client] Got response [{"homeName":"hname","address":{"street":"street","extension":null,"city":"city","postalCode":"zip","countryCode":"BE"},"serialNumber":"sn","systemId":"sysid","productMetadata":{"productType":"VR921","productionYear":"22","productionWeek":"07","articleNumber":"0020260965"},"state":"CLAIMED","migrationState":null,"migrationFinishedAt":null,"onlineState":"ONLINE","firmware":{"version":"0357.40.35","connectedToOldIoTPlatform":null,"updateEnabled":true,"updateRequired":false},"nomenclature":"VR 921","cag":false,"countryCode":"BE","productInformation":"VR921","firmwareVersion":"0357.40.35"}]
2024-06-22 10:30:08.705 DEBUG (MainThread) [myPyllant.http_client] Starting request TraceRequestStartParams(method='GET', url=URL('https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/systems/sid/meta-info/time-zone'), headers=auth, 'x-app-identifier': 'VAILLANT', 'Accept-Language': 'en-GB', 'Accept': 'application/json, text/plain, /', 'x-client-locale': 'en-GB', 'x-idm-identifier': 'KEYCLOAK', 'ocp-apim-subscription-key': 'key', 'User-Agent': 'okhttp/4.9.2', 'Connection': 'keep-alive')>)
2024-06-22 10:30:09.293 DEBUG (MainThread) [myPyllant.http_client] Got response {"timeZone":"Europe/Brussels"}
2024-06-22 10:30:09.300 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'mypyllant' at custom_components/mypyllant/coordinator.py, line 169: data = [ (offender: /usr/local/lib/python3.12/site-packages/dateutil/tz/tz.py, line 464: fileobj = open(fileobj, 'rb')), please create a bug report at https://github.com/signalkraft/mypyllant-component/issues
Traceback (most recent call last):
File "
2024-06-22 10:30:09.302 DEBUG (MainThread) [myPyllant.http_client] Starting request TraceRequestStartParams(method='GET', url=URL('https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/systems/sid/meta-info/control-identifier'), headers=auth, 'x-app-identifier': 'VAILLANT', 'Accept-Language': 'en-GB', 'Accept': 'application/json, text/plain, /', 'x-client-locale': 'en-GB', 'x-idm-identifier': 'KEYCLOAK', 'ocp-apim-subscription-key': 'key', 'User-Agent': 'okhttp/4.9.2', 'Connection': 'keep-alive')>) 2024-06-22 10:30:09.635 DEBUG (MainThread) [myPyllant.http_client] Got response {"controlIdentifier":"none"} 2024-06-22 10:30:09.635 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 312, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mypyllant/coordinator.py", line 169, in _async_update_data data = [ ^ File "/usr/local/lib/python3.12/site-packages/myPyllant/api.py", line 335, 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 1068, in get_control_identifier return ControlIdentifier(control_identifier) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/enum.py", line 744, in call return cls.new(cls, value) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/enum.py", line 1158, in new raise ve_exc ValueError: 'none' is not a valid ControlIdentifier 2024-06-22 10:30:09.641 DEBUG (MainThread) [custom_components.mypyllant.coordinator] Finished fetching myVAILLANT data in 1.659 seconds (success: False) 2024-06-22 10:30:09.641 DEBUG (MainThread) [custom_components.mypyllant] Refreshing DailyDataCoordinator 2024-06-22 10:30:09.641 DEBUG (MainThread) [custom_components.mypyllant.coordinator] Starting async update data for DailyDataCoordinator 2024-06-22 10:30:09.641 DEBUG (MainThread) [custom_components.mypyllant.coordinator] Waiting 118s until token refresh for [email protected] 2024-06-22 10:30:09.642 DEBUG (MainThread) [myPyllant.http_client] Starting request TraceRequestStartParams(method='GET', url=URL('https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/homes'), headers=auth, 'x-app-identifier': 'VAILLANT', 'Accept-Language': 'en-GB', 'Accept': 'application/json, text/plain, /', 'x-client-locale': 'en-GB', 'x-idm-identifier': 'KEYCLOAK', 'ocp-apim-subscription-key': 'key', 'User-Agent': 'okhttp/4.9.2', 'Connection': 'keep-alive')>) 2024-06-22 10:30:10.060 DEBUG (MainThread) [myPyllant.http_client] Got response [{"homeName":"home","address":{"street":"street","extension":null,"city":"city","postalCode":"zip","countryCode":"BE"},"serialNumber":"sn","systemId":"sid","productMetadata":{"productType":"VR921","productionYear":"22","productionWeek":"07","articleNumber":"0020260965"},"state":"CLAIMED","migrationState":null,"migrationFinishedAt":null,"onlineState":"ONLINE","firmware":{"version":"0357.40.35","connectedToOldIoTPlatform":null,"updateEnabled":true,"updateRequired":false},"nomenclature":"VR 921","cag":false,"countryCode":"BE","productInformation":"VR921","firmwareVersion":"0357.40.35"}] 2024-06-22 10:30:10.060 DEBUG (MainThread) [myPyllant.http_client] Starting request TraceRequestStartParams(method='GET', url=URL('https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/systems/sid/meta-info/time-zone'), headers=auth 'x-app-identifier': 'VAILLANT', 'Accept-Language': 'en-GB', 'Accept': 'application/json, text/plain, /', 'x-client-locale': 'en-GB', 'x-idm-identifier': 'KEYCLOAK', 'ocp-apim-subscription-key': 'key', 'User-Agent': 'okhttp/4.9.2', 'Connection': 'keep-alive')>) 2024-06-22 10:30:10.780 DEBUG (MainThread) [myPyllant.http_client] Got response {"timeZone":"Europe/Brussels"} 2024-06-22 10:30:10.780 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 312, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mypyllant/coordinator.py", line 203, 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 335, 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 1068, in get_control_identifier return ControlIdentifier(control_identifier) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/enum.py", line 744, in call return cls.new(cls, value) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/enum.py", line 1158, in new raise ve_exc ValueError: 'none' is not a valid ControlIdentifier 2024-06-22 10:30:10.782 DEBUG (MainThread) [custom_components.mypyllant.coordinator] Finished fetching myVAILLANT data in 1.141 seconds (success: False)
the mobile app also does not show any control information
So there's nothing in the MyVAILLANT app? Or is it working? If it works, you would probably need to reverse engineer the API to find out what values are being sent.
The MyVAILLANT app is not gshowing any controls, but it does show statistics of gas and electricity usage.
I wasn't aware that this case exists. Could you try reverse engineering to find out what API calls are being made and what they return in your case?
Generating test data may also help.
Hello again. Took me some time to try (btw those instructions to reverse engineer api calls are a bit outdated, apk won't work for latest versions and xapk did give an error in the generated binary manifest, had to edit it passing --wait argument to remove that faulty line) - but I extracted the relevant requests and responses, the way to get the heating/water heating usage data is to go after the emf-system API and then call consumption endpoints using the emf uuid. requests-responses.zip it would be great to see consumption data displayed in Home Assistant...
@signalkraft did the data from @girtsn help?
@signalkraft poke