Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Water device class to Overkiz #87139

Conversation

tetienne
Copy link
Contributor

@tetienne tetienne commented Feb 2, 2023

Breaking change

Proposed change

Since the introduction of the device class water, we didn’t update the Overkiz integration to support it. It’s now the case, and found two sensors eligible.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link

home-assistant bot commented Feb 2, 2023

Hey there @iMicknl, @vlebourl, @nyroDev, mind taking a look at this pull request as it has been labeled with an integration (overkiz) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of overkiz can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign overkiz Removes the current integration label and assignees on the issue, add the integration domain after the command.

Copy link
Contributor

@iMicknl iMicknl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find!

@@ -92,7 +92,7 @@ class OverkizSensorDescription(SensorEntityDescription):
name="Water volume estimation at 40 °C",
icon="mdi:water",
native_unit_of_measurement=UnitOfVolume.LITERS,
device_class=SensorDeviceClass.VOLUME,
device_class=SensorDeviceClass.WATER,
Copy link
Contributor

@epenet epenet Feb 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about this one.
WATER device class relates to water meters - not to a volume in a tank.

Edit: if it really is a consumption/water meter then the state class also needs to be adjusted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct, this actually is a volume, not the consumption.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the end user, it’s look like we can read it as a comsumption device: #83736

@MassimoL06 Can you confirm?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think he has the other sensor device? Or am I missing something.

@@ -101,7 +101,7 @@ class OverkizSensorDescription(SensorEntityDescription):
name="Water consumption",
icon="mdi:water",
native_unit_of_measurement=UnitOfVolume.LITERS,
device_class=SensorDeviceClass.VOLUME,
device_class=SensorDeviceClass.WATER,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this one is a water meter, then the state_class should be TOTAL or TOTAL_INCREASING.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tetienne this would be a good one to check for other meters (like electricity) as well, not sure if everything is mapped correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epenet Since it was introduced, I’m confused with TOTAL and TOTAL_INCREASING. I read many time the definition, but still don’t get it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TOTAL goes up AND down
TOTAL_INCREASING only goes up (automatically detects reset)

Meters should probably be always TOTAL_INCREASING.

Note: for me the confusion is between TOTAL and MEASUREMENT...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name TOTAL_INCREASING is very confusing, we should have named it TOTAL_AUTO_RESET or something like that.
@tetienne did you read this part too: https://developers.home-assistant.io/docs/core/entity/sensor/#how-to-choose-state_class-and-last_reset ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, this is indeed more clear with these examples. I asked to @gbuico to explain me what’s this device. But it looks like that’s not something really clear...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be that the integration is just swapping the name of the entities??
If I check the entity sensor.dhwp_actuator_water_volume_estimation_at_40_degc , this is really an "always increasing value (i.e. I have at the moment 42428 liters)
At the same time, looking at the history of sensor.dhwp_actuator_water_consumption I see values going up and done as from the chart I sent you @tetienne and this is more likely to be the estimation of remaining water at 40 degrees.

I also had a further thought on the readings of that variable and I may have found an explanation.

Problem: in my graph I see the water consumpion value float between 60 and 140 L while me heater is 65 L

My new explanation : Since my middel water temperature is around 65° it is reasonable that a 65 L heater can provide 140 L of water at 40°

Bottom line, I think the measured values are correct... there is just a swap of names

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to my own DHWP, water consumption seem to be a volume that goes down as it's "consumed" then up as it gets replenished.

image

In the snapshot, the steep slopes are actual hot water consumption (shower, bath, ...), the slow ones are just the water cooling down on its own inside the tank! To me this means the name of the entity is actually missleading, and should be something like available hot water rather than water consumption.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the new device class VOLUME_STORAGE? It seems more accurate in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tetienne VOLUME_STORAGE sounds fine by me! Shall we make this change and see if we can merge this one in?

@MassimoL06
Copy link

Hello,
when I force "device_class: water" and "state_class: total_increasing" to my water sensor entity from the Developer Tools TAB like this, I am able to add this entity to the energy dashboard.
image

image

Hope it helps.

@vlebourl
Copy link
Contributor

I had a closer look at both dhwp_actuator_water_consumption and dhwp_actuator_water_volume_estimation_at_40_degc. Here you have both on the same timeline

image

From this, I would argue that

  • Water volume estimation at 40 °C is indeed a water consumption, altghough it's an estimate rather than a direct measurement, and its state_class should be TOTAL_INCREASING
  • Water consumption is not a water consumption and should stay a VOLUME device class (the slow decreases correspond to cooling inside the tank, not consumption).

@epenet
Copy link
Contributor

epenet commented Mar 3, 2023

Please also take a look at #88312 which adds a new device class

@MassimoL06
Copy link

Hello @vlebourl
I agree with your comment regarding dhwp_actuator_water_consumption and dhwp_actuator_water_volume_estimation_at_40_degc.
Another concern regarding dhwp_actuator_water_volume_estimation_at_40_degc is that it has a maximum value of 65535, then retarts to 0. Is it possible to extend the range value by using a 32 bits variable ?

How do you create your ApexChart-Card ?
Regards

Copy link
Contributor

@epenet epenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I gather from the discussion, I still don't think they should be set to WATER.
Maybe VOLUME is good, or maybe VOLUME_STORAGE would be better.
Either way, there still seems to be some confusion.
Is it even consistent across devices?

@home-assistant home-assistant bot marked this pull request as draft March 14, 2023 08:53
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@epenet epenet mentioned this pull request Mar 20, 2023
20 tasks
@@ -92,7 +92,7 @@ class OverkizSensorDescription(SensorEntityDescription):
name="Water volume estimation at 40 °C",
icon="mdi:water",
native_unit_of_measurement=UnitOfVolume.LITERS,
device_class=SensorDeviceClass.VOLUME,
device_class=SensorDeviceClass.WATER,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the device class available for this right now:

Suggested change
device_class=SensorDeviceClass.WATER,
device_class=SensorDeviceClass.VOLUME_STORAGE,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How that's a nice addition. Thx!

@github-actions
Copy link

github-actions bot commented Aug 2, 2023

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 2, 2023
@github-actions github-actions bot closed this Aug 9, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Aug 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Water Consumption Energy Settings - Unable to select any entity
8 participants