Open MarianRychtecky opened 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!
(message by CodeOwnersMention)
vicare documentation vicare source (message by IssueLinks)
Should be fixed with https://github.com/home-assistant/core/pull/122334
Thank you for your time. Can you estimate release data (roughly)?
Great! Do I need to reinitialize the sensors? I upgraded and restarted the system, but I still cannot see device_type.
It should be updated after a restart. Does this behave the same for energy (kwh) and gas (m3)?
Can you share the diagnostic info?
Yes, after restarting, I cannot see the device class on kWh or m3. Where can I send the diag info?
Select the integration and click ...
I meant how to deliver to you :D
just drop in the comment, critical data is removed already.
Everything looks good.
Can you try to remove the type gas
from the integration config and set to auto
? Reconfigure the integration or change it in the config/.storage/core.config_entries.json
and restart.
Unfortunately I still cannot see that, I deleted this device and added again with "type: auto".
@MarianRychtecky can you join the Discord to have a chat?
I'd love to, but the invite doesn't work. And no, I'm not usually trouble maker :-)
https://discord.gg/gjf5ur6u, my username is Hafenstrand.
Sorry, I'm not able to join
Would you contact me at my email:
https://paste.ec/paste/tRUwGbui#XDiTFbuY7tUA0t0ujUXRYm2qZ+LoNIpKJDzJ-rMvcHM
Thank you very much for your help.
@MarianRychtecky could you verify if the issue is solved with the latest beta release?
I installed 2024.8.0b1, but I cannot see any difference, however I'm only looking for device_class on the sensor level. Maybe you want me to test elsewhere?
Oh, just found it... the getter for the unit is not implemented correctly (looks like copy&paste issue).
Is tries to access the value with "heating.gas.consumption.summary.dhw")["properties"]["day"]["unit"]
but it should be currentDay
instead of day
.
"properties": {
"currentDay": {
"type": "number",
"unit": "cubicMeter",
"value": 0.1
},
"currentMonth": {
"type": "number",
"unit": "cubicMeter",
"value": 0.5
},
Unfortunately the library is not maintained, so we cannot expect a fix in the near future.
I would suggest, that I remove the unit getter, so you would need to set the class yourself.
@MarianRychtecky can you please verify the PR https://github.com/home-assistant/core/pull/123089 and comment on it? With this you should be able to set the device class permanently.
There is actually code in place, that should prevent https://github.com/home-assistant/core/issues/122850, but device_class
is still reset on update
.
Thank you for your effort on this. Can you please explain to me a bit more in detail what does the update mean? Does removing the getter mean the sensor won't be automatically populated in HA from API? I would rather miss device_class
(and the option to add it to the energy monitor) than not have this sensor reading. Thank you, Marian
PS: How complicated is it to patch a library?
Does removing the getter mean the sensor won't be automatically populated in HA from API?
No, the getter for the sensor value is still there, it's would just be the unit of measurement that is not set from the api anymore.
PS: How complicated is it to patch a library?
The library is unmaintained and I did not yet start to publish my own fork. I plan to do this though. Patching would be relatively easy: https://github.com/somm15/PyViCare/pull/373
Thank you for your support; I will wait until it is released and I will test.
@CFenner Christopher, can you please help me to understand how this will work? I can see your update in the DEV branch; however, after installing 20024.8.3, device_class is not there. Do I need to reinstall ViCare integration to get a new library in place? Thank you
You will need to wait till next week, it is in the monthly release.
Great, thank you for your great help. Much appreciated.
Hi Chris, can you please help to understanding a change? After upgrading to 2024.09.01 I see no difference in behaviour. Device class is still missing and adding device_class manually is rewritten instantly. Am I missing something? Thank you, Marian
@home-assistant reopen
@MarianRychtecky can you please confirm, that you have no config/custom_component/vicare
folder in your instance.
I can confirm there no such content.
Hi all, So that you know, everyone who will have a similar problem. I did a workaround, which works now.
Idea - to create a Template sensor that will "follow" the original sensor but will not change its attributes/properties.
DO NOT USE Heplers! Integration -> Helpers - for some reason, Helpers will inherit the original sensor properties, and "device_class" and "unit_of_measurement" will disappear when the original sensor value (states) is updated.
I created a manual Sensor template in "configuration.conf". I called sensors "followers."
# Templates
template:
- sensor:
# DHW GAS
- name: "DHW gas consumption follower"
device_class: gas
unique_id: dhw_gas_consumption_follower
unit_of_measurement: "m³"
state_class: total_increasing
state: >
{{ states('sensor.<name_of_your_device>_dhw_gas_consumption_today') }}
icon: mdi:gas-burner
# Heating GAS
- name: "Heating gas consumption follower"
device_class: gas
unique_id: heating_gas_consumption_follower
unit_of_measurement: "m³"
state_class: total_increasing
state: >
{{ states('sensor.<name_of_your_device>_heating_gas_consumption_today') }}
icon: mdi:gas-burner
(be careful with indentation, as always!)
Recently created sensors I named "DHW gas consumption follower" can be added to the energy dashboard:
And are tracking gas consumption:
Hi! I just installed this integration, and I have the same problem commented here. It seems the device_class
is missing in all the entities. Maybe I can help with the problem? The workaround is ok, but I think it's good to have this working out of the box.
Can you share your diagnostics?
Yes, of course, I think this is what you want: config_entry-vicare-01J87T2D0KMQ6F3SNCVGJC4B84.json
It's a Viessman Vitodens 050-W if it matters...
Is there a way to "add" logs live in my installation? I can add logs to the code to see what is happening, but I don't know if this is possible in a live Home Assistant installation.
Additionally, as a workaround, in place of using templates, it's easier to use the customize.yaml
file and simply add:
sensor.caldera_acs_gas_anual:
device_class: gas
sensor.caldera_calefaccion_gas_anual:
device_class: gas
The problem
I'm missing the energy sensors device_class for all my Vitodens 100 sensors. Adding the class manually only works for a few seconds before it is automatically rewritten.
What version of Home Assistant Core has the issue?
2024.7.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
Viessmann vicare
Link to integration documentation on our website
https://www.home-assistant.io/integrations/vicare
Diagnostics information
I wish to add gas consumption to the energy dashboard, however all entities created by ViCare integration miss
device_class
(in my case,device_class: gas
), according to:https://www.home-assistant.io/docs/energy/faq/#troubleshooting-missing-entities
I tried to add device_class manually under Developer Tools > States, and this works, however entity's settings are rewritten in about 10s or so.
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response