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
70.15k stars 29.18k forks source link

Read min/max number of showers from state in DomesticHotWaterProduction (WaterHeatingSystem) in Overkiz integration #92368

Closed vheijens closed 5 months ago

vheijens commented 1 year ago

The problem

I have an Atlantic Lineo Connected domestic hot water heater. It has build in Cozytouch. It is recognised by the Overkiz plug-in as "Lineo Boiler" "DomesticHotWaterProduction by Atlantic" connected by "Cozytouch Sauter". Hardware: modbuslink:AtlanticDomesticHotWaterProductionMBLComponent The boiler itself has a simplified interface with 5 levels of available hot water. 60%-70%-80%-90%-100%.

I think it is an updates interface from the 5 levels of available showers the older versions have.

Scherm­afbeelding 2023-05-02 om 18 52 38

In the connected app and on the boiler itself, I can change the levels of desired hot water and it shows perfectly in Home Assistant. The control in Home Assistant is labeled as "Lineo Boiler Expected number of shower" and the current level of hot water is labeled as "Lineo Boiler Number of shower remaining". However in the Home Assistant card there are only 3 levels of controls (2-3-4) possible. When I select in the app for example level 5 (100%) it also shows in Home Assistant but the slider is only available between to 2 and 4.

For automations only the selection of 2, 3 or 4 "Expected number of shower" is available. If the automation requests 1 or 5 it results in an error "Value 5.0 for number.lineo_expected_number_of_shower is outside valid range 2 - 4"

Lowest setting available in HA card

Scherm­afbeelding 2023-05-02 om 19 08 13

Highest setting available in HA card

Scherm­afbeelding 2023-05-02 om 19 09 44

After selecting level 5 (100%) in the Cozytouch app

Scherm­afbeelding 2023-05-02 om 19 06 47

What version of Home Assistant Core has the issue?

core-2023.4.6

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

overkiz

Link to integration documentation on our website

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

Diagnostics information

config_entry-overkiz-9a2f5a419f3882fda6263eb794f8ddac.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Automation:
device_id: e7cf88f1636955aac7cfa1dca9ff5d72
domain: number
entity_id: number.lineo_expected_number_of_shower
type: set_value
value: 5
Error: Value 5.0 for number.lineo_expected_number_of_shower is outside valid range 2 - 4

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @imicknl, @vlebourl, @tetienne, @nyrodev, mind taking a look at this issue 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` Renames 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.

(message by CodeOwnersMention)


overkiz documentation overkiz source (message by IssueLinks)

iMicknl commented 1 year ago

Thanks for reporting. It seems the minimum and maximum is available as a state, thus this could be implemented in the future.

[{
    "name": "core:MinimalShowerManualModeState",
    "type": 1,
    "value": 1
}, {
    "name": "core:MaximalShowerManualModeState",
    "type": 1,
    "value": 5
}]
maxhome75 commented 1 year ago

Hello, Can we implement these 2 lines ourselves in the meantime and in which file please. Thanks again for your work

iMicknl commented 1 year ago

https://github.com/home-assistant/core/blob/d66fabb5b5be1fb93016f45e2c32eb81f358ca61/homeassistant/components/overkiz/number.py#L89-L98

maxhome75 commented 1 year ago

ok change native_min_value=2, native_max_value=4, by native_min_value=1, native_max_value=5, ? that's true?

maxhome75 commented 1 year ago

Ah but we don't have access to this path through the file editor

vheijens commented 1 year ago

It should be done by overriding the Overkiz component as a custom component. I don't know how it is done for "core component".

maxhome75 commented 1 year ago

A little feedback: water_heater.malicio does not allow you to switch to Eco mode. Error message

maxhome75 commented 1 year ago

hello, do you know when will be the update for this official component? Thanks

iMicknl commented 1 year ago

@maxhome75 no ETA. Contributions are welcome.

iMicknl commented 1 year ago

Taken from another configuration, seems to be present on multiple devices. We could implement this check + fallback to a default value.

            {
              "name": "core:MinimalShowerManualModeState",
              "type": 1,
              "value": 2
            },
            {
              "name": "core:MaximalShowerManualModeState",
              "type": 1,
              "value": 4
            },
maxhome75 commented 1 year ago

Hy @iMicknl , not 4 but 5 ??? 1 to 5 Thanks

iMicknl commented 1 year ago

@maxhome75 as described above, we would read it dynamically. In your case 5, for other users 4…

maxhome75 commented 1 year ago

I don't have the knowledge to help you. I am sorry. Your work helps us a lot, thank you again. At my level, I have no solution to correct the file myself

neopsyko commented 1 year ago

Hello,

I have the same issue. Overriding the Overkiz component with a custom component works fine. I only changed the min and max values in "overkiz/number.py". I hope you can add this change in a future version.

Thank you.

maxhome75 commented 1 year ago

hello Neopsyko, so you uninstalled the official version and reinstalled the modified custom, right?

neopsyko commented 1 year ago

Hello,

No, I just added the custom version.

Here are the steps:

  1. Download the entire folder "overkiz" from GitHub.
  2. Extract it into the directory: "config/custom_components/overkiz".
  3. Add a version tag in the "manifest.json" file => https://community.home-assistant.io/t/cant-override-a-core-integration/328151
  4. Modify the min/max values in "overkiz/number.py".
  5. Reload Home Assistant.
maxhome75 commented 1 year ago

Ok thanks. manifest.json in the Overkiz folder ok but I'm a beginner, I'm not a pro yet lol I'm having trouble understanding what to do with manifest.json

{
  "domain": "overkiz",
  "name": "Overkiz",
  "codeowners": ["@imicknl", "@vlebourl", "@tetienne", "@nyroDev"],
  "config_flow": true,
  "dhcp": [
    {
      "hostname": "gateway*",
      "macaddress": "F8811A*"
    }
  ],
  "documentation": "https://www.home-assistant.io/integrations/overkiz",
  "integration_type": "hub",
  "iot_class": "cloud_polling",
  "loggers": ["boto3", "botocore", "pyhumps", "pyoverkiz", "s3transfer"],
  "requirements": ["pyoverkiz==1.7.9"],
  "zeroconf": [
    {
      "type": "_kizbox._tcp.local.",
      "name": "gateway*"
    }
  ]
}

change which path? How an where add a version tag in manifest.json ? What should I write and how to know the version? I'm lost

maxhome75 commented 1 year ago

I have add "version": "0.0.1", And it's ok Thanks

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

Avent89 commented 11 months ago

I have the same issue. it's still not solved.

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

Fabjedi commented 8 months ago

Still not solve

lamouche370 commented 6 months ago

I have the same issue and still not solve.

yanuino commented 5 months ago

Since pyoverkiz expose OverkizSate.CORE_MAXIMAL_SHOWER_MANUAL_MODE et OverkizSate.CORE_MINIMAL_SHOWER_MANUAL_MODE is there a way to use them like:

    native_min_value=_set_native_min_value(OverkizSate.CORE_MINIMAL_SHOWER_MANUAL_MODE,2) , 
    native_max_value=_set_native_max_value(OverkizSate.CORE_MAXIMAL_SHOWER_MANUAL_MODE,4), 
iMicknl commented 5 months ago

@yanuino yes, however this would require some more changes to the integration. If you are able to code, feel free to do a PR! All contributions are welcome.

yanuino commented 5 months ago

@iMicknl , as I'm not used to contributing to this project, I not sure how to do it. I did this:

--- a/homeassistant/components/overkiz/number.py
+++ b/homeassistant/components/overkiz/number.py
@@ -37,6 +37,8 @@ class OverkizNumberDescriptionMixin:
 class OverkizNumberDescription(NumberEntityDescription, OverkizNumberDescriptionMixin):
     """Class to describe an Overkiz number."""

+    native_min_key: str = None
+    native_max_key: str = None
     inverted: bool = False
     set_native_value: Callable[
         [float, Callable[..., Awaitable[None]]], Awaitable[None]
@@ -94,6 +96,8 @@ NUMBER_DESCRIPTIONS: list[OverkizNumberDescription] = [
         command=OverkizCommand.SET_EXPECTED_NUMBER_OF_SHOWER,
         native_min_value=2,
         native_max_value=4,
+        native_min_key=OverkizState.CORE_MINIMAL_SHOWER_MANUAL_MODE,
+        native_max_key=OverkizState.CORE_MAXIMAL_SHOWER_MANUAL_MODE,
         entity_category=EntityCategory.CONFIG,
     ),
     # SomfyHeatingTemperatureInterface
@@ -225,3 +229,14 @@ class OverkizNumber(OverkizDescriptiveEntity, NumberEntity):
         await self.executor.async_execute_command(
             self.entity_description.command, value
         )
+
+    async def async_added_to_hass(self) -> None:
+        """Run when this Entity has been added to HA."""
+        await super().async_added_to_hass()
+
+        if self.entity_description.native_min_key:
+            if state := self.device.states.get(self.entity_description.native_min_key):
+                self.native_min_value = cast(float, state.value)
+        if self.entity_description.native_max_key:
+            if state := self.device.states.get(self.entity_description.native_max_key):
+                self.native_max_value = cast(float, state.value)

It works for my device: image

Is it good to do a PR?