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
72.81k stars 30.51k forks source link

ViCare gas consumption not available using "ViCare Heating gas consumption current day" #88961

Closed fredtj closed 9 months ago

fredtj commented 1 year ago

The problem

When setting up Gas Consumption, statistics from the ViCare integration are not available to add.

https://www.home-assistant.io/more-info/statistics/

The page above explains this is an integration issue, therefore I am reporting this.

What version of Home Assistant Core has the issue?

2023.2.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

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?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @oischinger, 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.

(message by CodeOwnersMention)


vicare documentation vicare source (message by IssueLinks)

aurelmarius commented 1 year ago

Same problem in 2023.3.1 Can't add vicare sensors to HA Energy Dashboard.

mmolenda commented 1 year ago

Same in 2023.4.6.

mmolenda commented 1 year ago

Apparently vicare sensors storing consumption data are missing device_class property. I managed to fix it by adding following customization to my configuration.yaml (this is for daily gas consumption in m³) and I was able to use them in my energy dashboard.

homeassistant:
  customize:
    sensor.vicare_heating_gas_consumption_current_day:
      device_class: gas
    sensor.vicare_hot_water_gas_consumption_current_day:
      device_class: gas
eerootsus commented 1 year ago

https://github.com/home-assistant/core/issues/88961#issuecomment-1551341311

@mmolenda Works perfectly after restart! Thanks for this!

issue-triage-workflows[bot] commented 1 year 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.

fredtj commented 1 year ago

not stale, requires integration fix, thanks

modem-man-gmx commented 1 year ago

Hmm, with 2023.10.3 and Vitodens 200 I have in my energy dashboard for 7 days this:

image (do not look at the electrical values, my meters are not supported so far)

I mistakenly used the "year" consumption, but as you can see it does fit well to this card: image

So, when not using the current_day consumption, at least it is doing something. I will observe, if it will work with daily usage - just edited now ;-)

truwer commented 1 year ago

Same issue for me. I can't add any heat or hot water gas to the dashboard. The values are available in HA in general, but not in the energy dashboard.

Home Assistant 2023.10.3 Vitodens 300

Thank you for your support.

modem-man-gmx commented 1 year ago

Same issue for me. I can't add any heat or hot water gas to the dashboard. The values are available in HA in general, but not in the energy dashboard.

Sure you know where to edit the Energy Dashboard?

It is here:

image

do not click at the red X, do klick at the O

truwer commented 1 year ago

Hi @modem-man-gmx ,

these are the only 4 (+1 already add on the screenshot) values I could add to the GAS Consumption within the dashboard: image But these values are shown and available in HA in general for the "keyword" gas: image

Do you have an idea what is missing or I am doing wrong? Thank you for your support.

modem-man-gmx commented 1 year ago

I have these two here:

image

with 'ViCare Heating gas consumption today' (sensor.vicare_heating_gasconsumption...) and with 'ViCare Hot water gas consumption today' (sensor.vicare_hot_water_gasconsumption...)

Those are the same, you have in the states developers view. My Vitodens is of 2023 and I use the free registration api key (1440 calls/day)

I don't know if this is helpful, but I often use the developers view "template" and put the jinja state_attr('...') in, to see, what a sensor is offering.

When I start typing sometimes a drop-down widget appears and is showing different entities!?: image this way I found a lot of useful details. Will not say that I have any knowledge about the commands and terms possible there, only played with state_attr so far.

truwer commented 1 year ago

Hi @modem-man-gmx , your comment didn't actual solved the issue, but still put me on the right track. Seem like there was an issue with the statistics in my instance. In developer view, statistics where something to fix. After correcting this, it works fine. image

Thank you.

CFenner commented 1 year ago

@mmolenda is it just the device class that needs to be added in the integration? That would be a quick fix. But I would not have the ability to test it as my heating does not provide these values.

mmolenda commented 1 year ago

@CFenner I guess so. That's the only fix I applied through customisation and got it working with energy dashboard.

CFenner commented 1 year ago

@mmolenda I created a PR to add the missing device classes. Can you verify if this fixes your issue? I do not have the hardware to check myself.

To test this, you simply need to download the code of that PR and copy the folder vicare from home assistant/components/ to config/custom_components/ on you HA instance.

CFenner commented 1 year ago

But these values are shown and available in HA in general for the "keyword" gas: image

Do you have an idea what is missing or I am doing wrong? Thank you for your support.

@truwer there is an automation inside the integration that determines the device class (Gas or Energy) by the unit, which is in my eyes wrong as gas can be kWh or m^3.

https://github.com/home-assistant/core/blob/870e38e8ba9265021b6010b16e5afdf7be1539ad/homeassistant/components/vicare/sensor.py#L708-L710

Edit:

From https://developers.home-assistant.io/docs/core/entity/sensor#available-device-classes: Gas consumption measured as energy in kWh instead of a volume should be classified as energy.

issue-triage-workflows[bot] commented 9 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.