home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.05k stars 29.71k forks source link

vicare integration is not working anymore #121429

Open huebnerthomas opened 2 months ago

huebnerthomas commented 2 months ago

The problem

The vicare integration entities were not available anymore. After a new installation of the integration the integration throw errors.

What version of Home Assistant Core has the issue?

2024.7.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

vicare

Link to integration documentation on our website

https://www.home-assistant.io/integrations/vicare/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Errors in the LOG's

ogger: ViCare
Quelle: components/vicare/button.py:44
Erstmals aufgetreten: 12:45:13 (4 Vorkommnisse)
Zuletzt protokolliert: 12:48:54

Missing 'data' property when fetching data.

Logger: homeassistant.components.button
Quelle: helpers/entity_platform.py:364
Integration: Taste ([Dokumentation](https://www.home-assistant.io/integrations/button), [Probleme](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+button%22))
Erstmals aufgetreten: 12:45:13 (4 Vorkommnisse)
Zuletzt protokolliert: 12:48:54

Error while setting up vicare platform for button
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/usr/src/homeassistant/homeassistant/components/vicare/button.py", line 76, in async_setup_entry
    await hass.async_add_executor_job(
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/vicare/button.py", line 63, in _build_entities
    if is_supported(description.key, description, device.api)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/vicare/utils.py", line 37, in is_supported
    entity_description.value_getter(vicare_device)
  File "/usr/src/homeassistant/homeassistant/components/vicare/button.py", line 44, in <lambda>
    value_getter=lambda api: api.getOneTimeCharge(),
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareUtils.py", line 55, in feature_flag_wrapper
    return wrapper(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareUtils.py", line 48, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareHeatingDevice.py", line 275, in getOneTimeCharge
    return self.service.getProperty("heating.dhw.oneTimeCharge")["properties"]["active"]["value"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareCachedService.py", line 24, in getProperty
    data = self.__get_or_update_cache()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareCachedService.py", line 45, in __get_or_update_cache
    raise PyViCareInvalidDataError(data)
PyViCare.PyViCareUtils.PyViCareInvalidDataError: {'viErrorId': '|00-de68ed18ebee4ca59f33edd448ac8e1a-bc980c246514448c-01.588c25fb_', 'statusCode': 400, 'errorType': 'DEVICE_COMMUNICATION_ERROR', 'message': '', 'extendedPayload': {'httpStatusCode': 'NotFound', 'code': '404', 'reason': 'GATEWAY_OFFLINE'}}

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (button) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `button` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign button` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


button documentation button source (message by IssueLinks)

home-assistant[bot] commented 2 months ago

Hey there @cfenner, mind taking a look at this issue as it has been labeled with an integration (vicare) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `vicare` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign vicare` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


vicare documentation vicare source (message by IssueLinks)

huebnerthomas commented 2 months ago

I suppose i've found the rootcause. I have a hybrid solution with a Vitocal 250-AH and a Vitodens 100-W.
I switched of the Vitodens 100-W. If I switch on the Vitodens 100-W again - Everything is working. Is there a solution that I can switch off the Vitodens 100-W and the integration is still running ?

CFenner commented 2 months ago

Interesting…! Can you post the diagnostic info from both states?

CFenner commented 2 months ago

I guess each platform iterates over all devices without caring about any error, this all devices that are in line after an error occurs are not initialized.

I have two devices myself and should be able to reproduce this.

huebnerthomas commented 2 months ago

Hi please find attached the Diagnostic information of the two devices.

config_entry-vicare1.json config_entry-vicare2.json

I have now deicsonnected the communication module in the VICare-App of the Vitodens 100-W. Let's see if the AH-250 is now still delivering data.

CFenner commented 2 months ago

The files are actually the same, could be that the device was turned on, but the state was not (yet) reflected in the API response.

Can you please have a look at the beginning of the vicare logs. Is any of the devices marked as offline?

2024-07-08 05:48:26.877 DEBUG (SyncWorker_4) [custom_components.vicare] Found device: VScotHO1_40 (online: False)
2024-07-08 05:48:26.877 DEBUG (SyncWorker_4) [custom_components.vicare] Found device: VScotHO1_72 (online: True)
huebnerthomas commented 2 months ago

Hi Christopher,

I have disonnected the communication module in the ViCare-App of the Vitodens 100-W and turned the Vitodens off. The AH-250 is still deliverung now data. This is fine for me. Thx a lot.

riessal commented 1 month ago

Hello there,

Unfortunately it got me last night. Same problem as @huebnerthomas and I only have one device - a Vitocal 250-A. Any ideas? Log Details below.

Regards, Alex

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:364 integration: Sensor (documentation, issues) First occurred: 14:47:19 (5 occurrences) Last logged: 16:47:37

Error while setting up vicare platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform await asyncio.shield(awaitable) File "/usr/src/homeassistant/homeassistant/components/vicare/sensor.py", line 932, in async_setup_entry await hass.async_add_executor_job( File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/vicare/sensor.py", line 868, in _build_entities entities.extend(_build_entities_for_device(device.api, device.config)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/vicare/sensor.py", line 900, in _build_entities_for_device if is_supported(description.key, description, device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/vicare/utils.py", line 37, in is_supported entity_description.value_getter(vicare_device) File "/usr/src/homeassistant/homeassistant/components/vicare/sensor.py", line 88, in value_getter=lambda api: api.getOutsideTemperature(), ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareUtils.py", line 55, in feature_flag_wrapper return wrapper(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareUtils.py", line 48, in wrapper return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareHeatingDevice.py", line 70, in getOutsideTemperature return self.service.getProperty("heating.sensors.temperature.outside")["properties"]["value"]["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareCachedService.py", line 24, in getProperty data = self.__get_or_update_cache() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareCachedService.py", line 45, in __get_or_updatecache raise PyViCareInvalidDataError(data) PyViCare.PyViCareUtils.PyViCareInvalidDataError: {'viErrorId': '|00-fcce34d44c21425f81121f80b91fc539-e05aaa0539484aff-01.82c82ede', 'statusCode': 400, 'errorType': 'DEVICE_COMMUNICATION_ERROR', 'message': '', 'extendedPayload': {'httpStatusCode': 'NotFound', 'code': '404', 'reason': 'GATEWAY_OFFLINE'}}

CFenner commented 1 month ago

@riessal

PyViCare.PyViCareUtils.PyViCareInvalidDataError: {
  'viErrorId': '|00-fcce34d44c21425f81121f80b91fc539-e05aaa0539484aff-01.82c82ede', 'statusCode': 400, 
  'errorType': 'DEVICE_COMMUNICATION_ERROR', 
  'message': '', 
  'extendedPayload': {
    'httpStatusCode': 'NotFound', 
    'code': '404', 
    'reason': 'GATEWAY_OFFLINE'
  }
}

The Viessmann API is very unstable, you got a GATEWAY_OFFLINE message. This has nothing to do with the HA integration.

Try to restart your device if this persists otherwise you need to wait till it comes online again.

riessal commented 1 month ago

Thank you so much for your fast response! This calms me down a little 👍

CFenner commented 1 month ago

Is this resolved?

riessal commented 1 month ago

Yes, thank you!On 27. Jul 2024, at 14:18, Christopher Fenner @.***> wrote: Is this resolved?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

jarekgrzabel commented 1 month ago

I have exactly the same issue for over 2 weeks now. It's hard to believe it's not a problem with the integration, as the curl api calls work without any issues. Integration debug suggests it found my devices but they just not appear and the log contains errors mentioned above:

2024-07-29 17:10:09.198 DEBUG (MainThread) [custom_components.vicare] Setting up ViCare component
2024-07-29 17:10:09.433 DEBUG (SyncWorker_17) [custom_components.vicare] Found True devices, adjusting cache duration to 60
2024-07-29 17:10:09.683 DEBUG (SyncWorker_17) [custom_components.vicare] Found device: E3_Vitodens_050_0822 (online: False)
2024-07-29 17:10:09.683 DEBUG (SyncWorker_17) [custom_components.vicare] Found device: E3_TCU41_x04 (online: False)
2024-07-29 17:10:09.683 DEBUG (SyncWorker_17) [custom_components.vicare] Found device: E3_TCU41_x04 (online: True)
2024-07-29 17:10:09.683 DEBUG (SyncWorker_17) [custom_components.vicare] Found device: E3_Vitodens_100_HC_0421 (online: True)
2024-07-29 17:10:09.872 ERROR (SyncWorker_33) [ViCare] Missing 'data' property when fetching data.
2024-07-29 17:10:09.874 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up vicare platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/vicare/binary_sensor.py", line 184, in async_setup_entry
    await hass.async_add_executor_job(
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/vicare/binary_sensor.py", line 120, in _build_entities
    entities.extend(_build_entities_for_device(device, device_config))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/vicare/binary_sensor.py", line 152, in _build_entities_for_device
    if is_supported(description.key, description, device)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/vicare/utils.py", line 36, in is_supported
    entity_description.value_getter(vicare_device)
  File "/config/custom_components/vicare/binary_sensor.py", line 88, in <lambda>
    value_getter=lambda api: api.getSolarPumpActive(),
                             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareUtils.py", line 55, in feature_flag_wrapper
    return wrapper(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareUtils.py", line 48, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareHeatingDevice.py", line 269, in getSolarPumpActive
    status = self.service.getProperty("heating.solar.pumps.circuit")[
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareCachedService.py", line 24, in getProperty
    data = self.__get_or_update_cache()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareCachedService.py", line 45, in __get_or_update_cache
    raise PyViCareInvalidDataError(data)
PyViCare.PyViCareUtils.PyViCareInvalidDataError: {'viErrorId': '|00-c32ba3cd99df4349a1118e90c5067846-7b0e6b61314644fc-01.c3430a0e_', 'statusCode': 400, 'errorType': 'DEVICE_COMMUNICATION_ERROR', 'message': '', 'extendedPayload': {'httpStatusCode': 'NotFound', 'code': '404', 'reason': 'GATEWAY_OFFLINE'}}

Also the output from the integration suggests 404 error not connection issue:

{'httpStatusCode': 'NotFound', 'code': '404', 'reason': 'GATEWAY_OFFLINE'}}
CFenner commented 1 month ago

@jarekgrzabel one of your two devices is offline. Due to the way the entities are created in HA this is preventing all devices from being setup correctly. Do you have the ability to turn on both devices till this is fixed?

jarekgrzabel commented 1 month ago

Yes after turning both on, it worked. It would be good to see the workaround as it's very often that one of the appliaces are completely turned off during the summer, as the water heating goes from the solar panels.

Frintrop commented 21 hours ago

After update of vicare cloud i get following error: 2024-09-05 16:07:00.242 ERROR (MainThread) [homeassistant.components.water_heater] Error while setting up vicare platform for water_heater Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform await asyncio.shield(awaitable) File "/usr/src/homeassistant/homeassistant/components/vicare/water_heater.py", line 90, in async_setup_entry await hass.async_add_executor_job( File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/vicare/water_heater.py", line 71, in _build_entities ViCareWater( File "/usr/src/homeassistant/homeassistant/components/vicare/water_heater.py", line 116, in init super().init(circuit.id, device_config, device) File "/usr/src/homeassistant/homeassistant/components/vicare/entity.py", line 39, in init serial_number=device.getSerial(), ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareUtils.py", line 55, in feature_flag_wrapper return wrapper(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareUtils.py", line 48, in wrapper return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareDevice.py", line 17, in getSerial return self.service.getProperty("device.serial")["properties"]["value"]["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareCachedService.py", line 26, in getProperty return readFeature(entities, property_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCareService.py", line 17, in readFeature raise PyViCareNotSupportedFeatureError(property_name) PyViCare.PyViCareUtils.PyViCareNotSupportedFeatureError: device.serial

@CFenner ... is that a new issue?

CFenner commented 21 hours ago

Hi @Frintrop, yes, it's a different one. Seems that your heating device does not support the device.serial data point that is now used to distinguish the devices. Can you share the diagnostics file?