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.73k stars 29.99k forks source link

No device or entities after reinstall of the integration #107847

Closed ltaferner closed 5 months ago

ltaferner commented 8 months ago

The problem

Hi all!

The day before yesterday Viessmann had problems with their app. After a view hours everything worked fine again. Yesterday I mentioned that the values of my entities didn’t show up again, after a restart of my ha instance. So I tried several times to reload the integration, but nothing worked. So I decided to reinstall the integration and to reconfigure it. After that, the integration showed up again, but there were no device and either no entity.

What version of Home Assistant Core has the issue?

core-2024.1.2

What was the last working version of Home Assistant Core?

core-2024.1.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Viessmann 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?

No response

Additional information

No response

sswierczyna commented 8 months ago

Awesome @CFenner 🎉 I have back the Heat Pump entity compressor_phase, and i can observe how often Pump is doing Defrost ❤️

CFenner commented 8 months ago

Intentionally this change is about having multiple devices. If someone has input around that please post in the PR. Especially I would like to know how E3 systems behave. Do you have duplicated devices?

4stepup commented 8 months ago

Excellent; it works again

THX @neikk & @CFenner

Pajuris commented 8 months ago

Hi,

After curl -o- -L https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d vicare -p 96044 entities back... but logs show errors: Screen Shot 2024-01-14 at 18 23 49

CFenner commented 8 months ago

@Pajuris can you share your diagnostic information (select vicare device > click on '...' > download)?

Pajuris commented 8 months ago

config_entry-vicare-1a91b30902c8189787639d52554232c6.json.txt

CFenner commented 8 months ago

@Pajuris what devices do you have? It' printed at the beginning of the vicare logs.

Pajuris commented 8 months ago

Viessmann device? It's Viessmann Vitodens 100-w B1KC with Vitoconnect OT2.

CFenner commented 8 months ago

Ok, the issue is that both your devices provide the same data endpoints. I've a similar setup but with a opto1, there the gateway does not expose any data points.

I guess in your case the default integration should work! Did you have issues with no entities in Ha before?

Bottom line is that the way vicare entities are named in HA is wrong, it always uses the gateway serial in the name and not the device serial. And as both devices expose the same data point you end up adding all entities twice.

Pajuris commented 8 months ago

Yes, I have... without update, gone entities: binary_sensor.ot_heating_system_burner sensor.ot_heating_system_boiler_supply_temperature sensor.ot_heating_system_burner_hours sensor.ot_heating_system_burner_starts and... climate.heatbox2_heating always show waiting... even if boiler is running (after update too).

neikk commented 8 months ago

Yes, I have... without update, gone entities: binary_sensor.ot_heating_system_burner sensor.ot_heating_system_boiler_supply_temperature sensor.ot_heating_system_burner_hours sensor.ot_heating_system_burner_starts and... climate.heatbox2_heating always show waiting... even if boiler is running (after update too).

Ahh, I think you have the same stuff I experienced. Thought it is my personal case.

Some stuff was renamed in my environment.

Heating and hot water with different names

In my case:

Heating something like: climate.${NAME}_heating Hot water: water_heater.${NAME}_domestic_hot_water

Eventually you have to delete and install the integration again. Just an idea.

Sorry, you are still dived in deeper. Ignore me.

fire4you commented 8 months ago

Hi, everything works again. Many thanks!

agvdberg commented 8 months ago

Here also working again, after running curl & restart.

Pajuris commented 8 months ago

Ok, the issue is that both your devices provide the same data endpoints. I've a similar setup but with a opto1, there the gateway does not expose any data points.

I guess in your case the default integration should work! Did you have issues with no entities in Ha before?

Bottom line is that the way vicare entities are named in HA is wrong, it always uses the gateway serial in the name and not the device serial. And as both devices expose the same data point you end up adding all entities twice.

Problem solved. Removed you curl udpate, Viessmann integration and added it again. All entities back. Thanks.

Keffu3636 commented 8 months ago

When is it safe to switch back to official integration?

4stepup commented 8 months ago

@CFenner ; Unfortunately, I cannot find current temperature of "domestic hot water" sensor. I already had this issue before last weekend. Where can I find it? THX!

sswierczyna commented 8 months ago

Side effect after applying change from @CFenner branch:

Vicare API rate limit exceeded: (PyViCareRateLimitError(...), 'API rate limit development portal "xxx-xxx-xxx" daily limit exceeded. Max 1450 calls in timewindow. Limit reset at 2024-01-16T00:00:05.008000.')

Limit was exhausted in 18 hours.

CFenner commented 8 months ago

@sswierczyna I prepared another PR that keeps connecting to just once device, if that's sufficient for you.

https://github.com/home-assistant/core/pull/107906

sswierczyna commented 8 months ago

Thank You so much @CFenner for yours great support 🙇

I have already applied changes from #96044 Shall U apply changes from #107906 using similar command ?

curl -o- -L https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d vicare -p 107906 
CFenner commented 8 months ago

Yes, just replace the PR number at the end.

Igor01-Tech commented 8 months ago

I pulled your PR, deleted the device and then tried to add the integration again and got this error. I used this command: curl -o- -L https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d vicare -p 107906

in root/homeassistant without any errors.

what went wrong?

image

`Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421 First occurred: 15:41:55 (8 occurrences) Last logged: 15:55:52

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 233, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle result = await handler(request, request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin return await func(self, request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 213, in post return await super().post(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post result = await self._flow_mgr.async_init( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 292, in async_init result = await self._async_handle_step(flow, flow.init_step, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 416, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/vicare/config_flow.py", line 230, in async_step_init self.available_devices = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/vicare/config_flow.py", line 65, in _get_device_list return get_device_serial_model_list(hass, device_list) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/vicare/utils.py", line 112, in get_device_serial_model_list return [ ^ File "/config/custom_components/vicare/utils.py", line 113, in (get_serial(device_config), device_config.getModel()) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/vicare/utils.py", line 105, in get_serial return device_config.asAutoDetectDevice().getSerial() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/PyViCare/PyViCareUtils.py", line 55, in feature_flag_wrapper return wrapper(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/PyViCare/PyViCareUtils.py", line 48, in wrapper return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/PyViCare/PyViCareHeatingDevice.py", line 44, in getSerial return self.service.getProperty("device.serial")["properties"]["value"]["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/PyViCare/PyViCareCachedService.py", line 26, in getProperty return readFeature(entities, property_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/PyViCare/PyViCareService.py", line 17, in readFeature raise PyViCareNotSupportedFeatureError(property_name) PyViCare.PyViCareUtils.PyViCareNotSupportedFeatureError: device.serial`

Any idea?

CFenner commented 8 months ago

@Igor01-Tech what type of devices do you have?

Can you please post the log part that states "detected xyz as ..." and the diagnostic information.

PeetersJan commented 8 months ago

curl -o- -L https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d vicare -p 96044

... did it for me as well. Thank you; ViCare up and running again.

config_entry-vicare-2dd7aca4678f98f6fe5ba3bba66b9376.json.txt

asfasty commented 8 months ago

strangely around the same time my entities show up as renamed. but within the same time some core updates came out and i applied them immediately. So apart from the renaming (not the vicare.scensor_naming)) everything seemed to work/display values..

Was is always the case that there is no 'rücklauf' entity ( so the cooled down water getting back to the burner)? Since I would need that to prove my heating builder wrong. I have too many burnerstarts (around 1 start / 4 min) which in my opinion is not good for the hardware. heating builder says this is normal - My opinion on that is different

issue-triage-workflows[bot] commented 5 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.