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
73.48k stars 30.7k forks source link

Support HitachiAirToAirHeatPump (hlrrwifi:HLinkMainController) in Overkiz integration #85781

Closed Chris-NL closed 11 months ago

Chris-NL commented 1 year ago

The problem

I'm using the overkiz integration to integrate my Somfy Tahoma Pro box (firmware 2018.24.4.7). This has 2 positionable horizontal awnings, 2 sensors and 4 split unit air conditioners of Hitachi connected to it.

The overkiz integration adds the airco units as HitachiAirToAirHeatPump devices, but I only see one disabled entity for each airco (button.airco_1_start_identify). I can't seem to use them on any of the dashboard or automations.

I'm not sure if I'm doing something wrong, maybe there is a solution for the problem.

What version of Home Assistant Core has the issue?

2023.1.2

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-9a960f4ff17ee791f14ce8da40a9d67d.json.txt

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 @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` 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.

(message by CodeOwnersMention)


overkiz documentation overkiz source (message by IssueLinks)

iMicknl commented 1 year ago

You have a very complex device unfortunately. I started porting the device a while ago (https://github.com/home-assistant/core/pull/81743), but wasn't able to test and finish it yet.

iMicknl commented 1 year ago

@home-assistant rename Support HitachiAirToAirHeatPump (hlrrwifi:HLinkMainController) in Overkiz integration

chabou-san commented 1 year ago

Woot, just found out about this issue. I'm still using the custom_component ha-tahoma (deprecated as I saw the recent notice) just because I need this support, so I look forward to see it merged. Keep up the good work, thank you @iMicknl :). If you ever need help testing since I have the necessary setup and devices, I may help you (but you might need to guide into how to do it). ;)

iMicknl commented 1 year ago

OVP

{
    "typeId": 1099513069579,
    "subsystemId": 0,
    "localPairing": true,
    "commands": [{
            "commandName": "getName",
            "description": "Refresh the device internal name\n",
            "nparams": 0
        },
        {
            "commandName": "identify",
            "description": "Ask the device to identify itself by doing a slight movement or blink or beep\n",
            "nparams": 0
        },
        {
            "commandName": "setAutoManu",
            "prototype": {
                "parameters": [{
                    "optional": false,
                    "sensitive": false,
                    "valuePrototypes": [{
                        "type": "STRING",
                        "enumValues": [
                            "auto",
                            "manu"
                        ],
                        "description": "string value (auto, manu)"
                    }]
                }]
            },
            "description": "Set device mode to auto or manual mode\n",
            "nparams": 1
        },
        {
            "commandName": "setHolidays",
            "prototype": {
                "parameters": [{
                    "optional": false,
                    "sensitive": false,
                    "valuePrototypes": [{
                        "type": "STRING",
                        "enumValues": [
                            "off",
                            "on"
                        ],
                        "description": "string value (off, on)"
                    }]
                }]
            },
            "description": "Set holidays mode\n",
            "nparams": 1
        },
        {
            "commandName": "setName",
            "prototype": {
                "parameters": [{
                    "optional": false,
                    "sensitive": false,
                    "valuePrototypes": [{
                        "type": "STRING",
                        "description": "string value"
                    }]
                }]
            },
            "description": "Change the device internal name. Name length may be subject to restrictions depending on the device and underlying protocol.\n",
            "nparams": 1
        },
        {
            "commandName": "globalControl",
            "prototype": {
                "parameters": [{
                        "optional": false,
                        "sensitive": false,
                        "valuePrototypes": [{
                                "type": "STRING",
                                "enumValues": [
                                    "On",
                                    "Off"
                                ],
                                "description": "string value (On, Off)"
                            },
                            {
                                "type": "STRING",
                                "enumValues": [
                                    "off",
                                    "on"
                                ],
                                "description": "string value (off, on)"
                            }
                        ]
                    },
                    {
                        "optional": false,
                        "sensitive": false,
                        "valuePrototypes": [{
                            "type": "INT",
                            "description": "integer value"
                        }]
                    },
                    {
                        "optional": false,
                        "sensitive": false,
                        "valuePrototypes": [{
                            "type": "STRING",
                            "enumValues": [
                                "auto",
                                "hi",
                                "med",
                                "lo",
                                "silent"
                            ],
                            "description": "string value (auto, hi, med, lo, silent)"
                        }]
                    },
                    {
                        "optional": false,
                        "sensitive": false,
                        "valuePrototypes": [{
                            "type": "STRING",
                            "enumValues": [
                                "auto",
                                "heating",
                                "dehumidify",
                                "cooling",
                                "fan",
                                "circulator"
                            ],
                            "description": "string value (auto, heating, dehumidify, cooling, fan, circulator)"
                        }]
                    },
                    {
                        "optional": true,
                        "sensitive": false,
                        "valuePrototypes": [{
                            "type": "STRING",
                            "enumValues": [
                                "timer",
                                "manu",
                                "holidays"
                            ],
                            "description": "string value (timer, manu, holidays)"
                        }]
                    }
                ]
            },
            "description": "Manage device\n",
            "nparams": 5
        },
        {
            "commandName": "setMainOperation",
            "prototype": {
                "parameters": [{
                    "optional": false,
                    "sensitive": false,
                    "valuePrototypes": [{
                            "type": "STRING",
                            "enumValues": [
                                "On",
                                "Off"
                            ],
                            "description": "string value (On, Off)"
                        },
                        {
                            "type": "STRING",
                            "enumValues": [
                                "off",
                                "on"
                            ],
                            "description": "string value (off, on)"
                        }
                    ]
                }]
            },
            "description": "Set device main operating mode\n",
            "nparams": 1
        }
    ],
    "states": [{
            "name": "AutoManuModeState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "HolidaysModeState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "NameState",
            "type": "DataState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "StatusState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "TargetTemperatureState",
            "type": "ContinuousState",
            "eventBased": false,
            "persistent": false,
            "prototype": {
                "valuePrototypes": [{
                    "type": "FLOAT",
                    "minValue": 12.0,
                    "maxValue": 30.0,
                    "description": "float value between 12.0 and 30.0"
                }]
            }
        },
        {
            "name": "DiagnosticCodeState",
            "type": "DataState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "FanSpeedState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "FilterConditionState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "FilterResetState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "HLinkVirtualOperatingModeState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": true
        },
        {
            "name": "MainOperationState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "ModeChangeState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "OutdoorTemperatureState",
            "type": "ContinuousState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "RemoconControlState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "RoomTemperatureState",
            "type": "ContinuousState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "TemperatureChangeState",
            "type": "ContinuousState",
            "eventBased": false,
            "persistent": false
        },
        {
            "name": "ThermoStatusState",
            "type": "DiscreteState",
            "eventBased": false,
            "persistent": false
        }
    ],
    "controllableName": "ovp:HLinkMainController",
    "uiClass": "HitachiHeatingSystem",
    "uiProfiles": [
        "ThermostatTargetReader"
    ],
    "uiWidget": "HitachiAirToAirHeatPump",
    "controllableType": "ACTUATOR",
    "protocolType": "OVP"
}

HLRRWIFI

{
  "allResult": true,
  "devicesTypes": [
    {
      "typeId": 655360,
      "subsystemId": 0,
      "localPairing": false,
      "commands": [
        {
          "commandName": "globalControl",
          "prototype": {
            "parameters": [
              {
                "optional": false,
                "sensitive": false,
                "valuePrototypes": [
                  {
                    "type": "STRING",
                    "enumValues": [
                      "off",
                      "on"
                    ],
                    "description": "string value (off, on)"
                  }
                ]
              },
              {
                "optional": false,
                "sensitive": false,
                "valuePrototypes": [
                  {
                    "type": "INT",
                    "description": "integer value"
                  }
                ]
              },
              {
                "optional": false,
                "sensitive": false,
                "valuePrototypes": [
                  {
                    "type": "STRING",
                    "enumValues": [
                      "auto",
                      "high",
                      "low",
                      "medium",
                      "silent"
                    ],
                    "description": "string value (auto, high, low, medium, silent)"
                  }
                ]
              },
              {
                "optional": false,
                "sensitive": false,
                "valuePrototypes": [
                  {
                    "type": "STRING",
                    "enumValues": [
                      "auto",
                      "circulator",
                      "cooling",
                      "dehumidify",
                      "fan",
                      "heating"
                    ],
                    "description": "string value (auto, circulator, cooling, dehumidify, fan, heating)"
                  }
                ]
              },
              {
                "optional": false,
                "sensitive": false,
                "valuePrototypes": [
                  {
                    "type": "STRING",
                    "enumValues": [
                      "both",
                      "horizontal",
                      "stop",
                      "vertical"
                    ],
                    "description": "string value (both, horizontal, stop, vertical)"
                  }
                ]
              },
              {
                "optional": false,
                "sensitive": false,
                "valuePrototypes": [
                  {
                    "type": "STRING",
                    "enumValues": [
                      "off",
                      "on"
                    ],
                    "description": "string value (off, on)"
                  }
                ]
              }
            ]
          },
          "description": "p1: Main operation => on|off\np2: Temperature in Celsius\np3: Fan speed => auto|high|medium|low|silent\np4: Mode => auto|heating|dehumidify|cooling|fan|circulator|leaveHome\np5: Swing => stop|vertical|horizontal|both\np6: Leave home => on|off\n",
          "nparams": 6
        }
      ],
      "states": [
        {
          "name": "FilterConditionState",
          "type": "DiscreteState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "ProductModelNameState",
          "type": "DataState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "RSSILevelState",
          "type": "ContinuousState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "TargetTemperatureState",
          "type": "ContinuousState",
          "eventBased": false,
          "persistent": false,
          "prototype": {
            "valuePrototypes": [
              {
                "type": "FLOAT",
                "minValue": 12,
                "maxValue": 30,
                "description": "float value between 12.0 and 30.0"
              }
            ]
          }
        },
        {
          "name": "DiagnosticCodeState",
          "type": "DataState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "FanSpeedState",
          "type": "DiscreteState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "LeaveHomeState",
          "type": "DiscreteState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "MainOperationState",
          "type": "DiscreteState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "ModeChangeState",
          "type": "DiscreteState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "OutdoorTemperatureState",
          "type": "ContinuousState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "RemoconControlState",
          "type": "DiscreteState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "RoomTemperatureState",
          "type": "ContinuousState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "SwingState",
          "type": "DiscreteState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "TemperatureChangeState",
          "type": "ContinuousState",
          "eventBased": false,
          "persistent": false
        }
      ],
      "controllableName": "hlrrwifi:HLinkMainController",
      "uiClass": "HitachiHeatingSystem",
      "uiProfiles": [
        "ThermostatTargetReader"
      ],
      "uiWidget": "HitachiAirToAirHeatPump",
      "controllableType": "ACTUATOR",
      "protocolType": "HLRR_WIFI"
    },
    {
      "typeId": 8589934592,
      "subsystemId": 0,
      "localPairing": false,
      "commands": [
        {
          "commandName": "getName",
          "description": "Refresh the device internal name\n",
          "nparams": 0
        },
        {
          "commandName": "setName",
          "prototype": {
            "parameters": [
              {
                "optional": false,
                "sensitive": false,
                "valuePrototypes": [
                  {
                    "type": "STRING",
                    "description": "string value"
                  }
                ]
              }
            ]
          },
          "description": "Change the device internal name. Name length may be subject to restrictions depending on the device and underlying protocol.\n",
          "nparams": 1
        }
      ],
      "states": [
        {
          "name": "LocalModeState",
          "type": "DiscreteState",
          "eventBased": false,
          "persistent": false
        },
        {
          "name": "NameState",
          "type": "DataState",
          "eventBased": false,
          "persistent": false
        }
      ],
      "controllableName": "hlrrwifi:HLRRWifiBridge",
      "uiClass": "ProtocolGateway",
      "uiProfiles": [
        "Specific"
      ],
      "uiWidget": "HLRRWifiBridge",
      "controllableType": "PROTOCOL_GATEWAY",
      "protocolType": "HLRR_WIFI"
    }
  ]
}
Chris-NL commented 1 year ago

Hi Mick,

What is the status of this change? When can I start using it?

Best regards,

Chris

iMicknl commented 1 year ago

@Chris-NL no ETA. I currently don't have time.

Chris-NL commented 1 year ago

Ok, no worries. I'll wait. Thanks for the support.

iMicknl commented 1 year ago

@chabou-san which device do you own? I am looking for users of the hlrrwifi:HLinkMainController, not the OVP version.

chabou-san commented 1 year ago

I believe I have the HLRR version. How can I be sure ?

iMicknl commented 1 year ago

@chabou-san on your device page, it should list 'hardware'. You can there also download your diagnostics.

chabou-san commented 1 year ago

@iMicknl Thanks for the info, I can confirm that I have Hardware: hlrrwifi:HLinkMainController.

iMicknl commented 1 year ago

Do we have anyone here with the ovp hardware version?

@Chris-NL, do you want to help testing some stuff?

Manu0742 commented 1 year ago

Do we have anyone here with the ovp hardware version?

@Chris-NL, do you want to help testing some stuff?

Hi there, I have 4 units with hardware name "ovp:HLinkMainController"

iMicknl commented 1 year ago

@Manu0742 / @rbrackel are you on Discord by any chance? Or do you know how to run a dev version of Home Assistant? This PR https://github.com/home-assistant/core/pull/95706 has changes for your device.

Chris-NL commented 1 year ago

Hi iMicknl,

I have a test-instance of HA where I can install something like this. Can you please tell me the steps on how to download and install your testversion in my test-instance?

P.S. I don't use discord.

iMicknl commented 1 year ago

Perhaps you can use https://github.com/alandtse/pr_custom_component (see instructions) and use https://github.com/home-assistant/core/pull/95706 as the link.

Chris-NL commented 1 year ago

I've installed the PR Custom Component and added an integration with the PR link. I can't seem to find where it asks me for my Tahoma username and password, only configuration items are Binary Sensor enabled, Sensor enabled and Switch enabled. Am I missing something?

iMicknl commented 1 year ago

@Chris-NL, if you remove your current Overkiz entry, you should be able add a new one which is called something like custom Overkiz.

I haven't used this method myself, but many other did use this with success.

Chris-NL commented 1 year ago

That was the last step was missing. Thanks it works. I can also now see the airco's with all options. But clicking on one of the options (eg. cooling icon for example) gives me the following message: "Kan service climate/set_hvac_mode niet aanroepen. {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p5 : expected (optional) string value (timer, manu, holidays) but got stop (String)'}"

iMicknl commented 1 year ago

@dotvav FYI

dotvav commented 1 year ago

Great, thanks for testing this. I will look into that error it this week. Could you download the logs of the component and share?

Chris-NL commented 1 year ago

config_entry-overkiz-89823676d993f69d576c3e9340ae1ec4.json.txt

Attached file contains the downloaded diagnostics of the "Custom Overkiz PR#95706" integration.

dotvav commented 1 year ago

The error message is confusing:

  1. What we pass to globalControl as param 5 is the swing mode, but the API seems to be expecting hvac_mode
  2. According to the diagnostic file, there are no states that expect (timer, manu, holidays).

Testing with my device I find that API error responses are not reliable: when an unexpected value is passed to one of the parameters, the API may complain about another parameter which was correct. So I am not too worried about point 1. Point 2 might similarly be a bad error reporting from the remote API.

@Chris-NL when you operate your AC unit from the remote controller or mobile app, do you see the state change in HomeAssistant? Can you put it on and, then, test the HomeAssistantcontrols one by one until you find which one is having a bug? Otherwise, what may help is if you use the hi-kumo web app and record the network traffic with your browser's developer tools so I can compare it with what HomeAssistant is producing.

Chris-NL commented 1 year ago

Hi Dotvav,

Thanks for your investigation. I did some tests as you requested. All changes to the AC with the remote are reflected in HomeAssistant except for the Auto mode (the one I onle use ;)). Trying to change something to the AC via HomeAssistant at any stage gives me the same error message (or at least they look the same).

I don't have the hi-kumo app. I'm using these AC's on the Somfy Tahoma box with the Somfy App.

Hope this helps. Let me know if I need to test more.

dotvav commented 1 year ago

OK, that's helpful. Comparing your diagnostic and mine is showing something that is aligned with what you say. It looks like the operation mode on the OVP protocol (your device) has one less possible value than on the HLLRWIFI (my device) and the ones in common have slightly different spellings.

OVP:

              {
                "type": "DiscreteState",
                "values": [
                  "auto cooling",
                  "auto heating",
                  "circulator",
                  "cooling",
                  "dehumidify",
                  "fan",
                  "heating"
                ],
                "qualifiedName": "ovp:ModeChangeState"
              }

HLLRWIFI:

              {
                "type": "DiscreteState",
                "values": [
                  "auto",
                  "autoCooling",
                  "autoHeating",
                  "circulator",
                  "cooling",
                  "dehumidify",
                  "fan",
                  "heating"
                ],
                "qualifiedName": "hlrrwifi:ModeChangeState"
OVP HLLRWIFI
"auto"
"auto cooling" "autoCooling"
"auto heating" "autoHeating"
"circulator" "circulator"
"cooling" "cooling"
"dehumidify" "dehumidify"
"fan" "fan"
"heating" "heating"

I am going to double check the rest of the parameters and then I'll update the CR in the coming days. I will need you to test again when I am done.

dotvav commented 1 year ago

@Chris-NL I have pushed a fix in my branch, which should fix the "auto" mode issue. Please let me know the outcome whenever you can test.

Though I feel like there are other differences in potocols that are not covered in the code. In particular, for the "swing mode".

Chris-NL commented 1 year ago

Hi dotvav,

I've removed the "Custom Overkiz PR#95706", restarted and added it again. After adding I only see one device (TaHoma Pro) and get the following notification: image

Hope this helps.

dotvav commented 1 year ago

Any chance that you could share messages from the logs?

Chris-NL commented 1 year ago
2023-08-12 18:54:13.884 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration overkiz which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-08-12 18:56:02.286 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.alarm_control_panel: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.317 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.binary_sensor: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.324 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.button: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.327 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.climate: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.331 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.cover: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.333 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.light: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.334 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.lock: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.336 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.number: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.339 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.select: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.342 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.sensor: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.349 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.siren: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.354 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.switch: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-08-12 18:56:02.356 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform overkiz.water_heater: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
Chris-NL commented 1 year ago

I could give you direct access to my HA test instance if you want. Maybe easier. Is there a way to communicate in private on this topic?

iMicknl commented 1 year ago

@dotvav the issue here is that there has been a breaking change in core (dev branch), and you rebased on this dev branch. @Chris-NL is running the latest version that doesn't contain this change yet, thus the integration is broken.

dotvav commented 1 year ago

@iMicknl that makes sense.

@Chris-NL would you be comfortable deploying the head of the dev branch on your test env instead of the 'latest' release of HomeAssistant?

Chris-NL commented 1 year ago

Probably, it's just a test env. You have to tell me how to do it.

dotvav commented 1 year ago

If you are using VSCode it is as simple as following the steps from this help page: https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume

with the URL of my PR for the git url: https://github.com/home-assistant/core/pull/95706

Otherwise, I don't think this thread is the right place to discuss HA deployment methods, and you can reach out to me on Discord (dotvav).

Chris-NL commented 1 year ago

Hi dotvav,

I've looked at it, but this doesn't make any sense to me. I think I'm pretty technical, but this is something I have to dive into and will cost me a lot of time for something that should be pretty straightforward. Isn't it possible to merge your changes in the PR, so I can test it with the setup I currently have?

dotvav commented 1 year ago

No problem, @Chris-NL. I don't know what are the breaking changes that I have rebased into my PR branch, and I don't think it makes too much sense for me (given the short amount of time that I have at the moment) to rebase again to an older release version of HA, then forth again before a merge.

The easiest, in my opinion is to wait another 2 or 3 weeks until the next beta or stable version is released, and you can upgrade your test env.

dotvav commented 1 year ago

Hi @Chris-NL, Homeassistant version 2023.8.4 was released on August 24th. Do you think that you can upgrade your test instance and test my PR again?

Chris-NL commented 1 year ago

I just removed the custom overkiz pr95706, restarted and added it again. I get the same errors as before: image

From the logs: Logger: homeassistant.setup Source: setup.py:379 First occurred: 16:46:40 (13 occurrences) Last logged: 16:46:40

Unable to prepare setup for platform overkiz.select: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)). Unable to prepare setup for platform overkiz.sensor: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)). Unable to prepare setup for platform overkiz.siren: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)). Unable to prepare setup for platform overkiz.switch: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)). Unable to prepare setup for platform overkiz.water_heater: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).

overkiz-bdb0dfe9ab23de0272cf628ba3efd7a7-TaHoma-4c20f855dbe188aeac30b98d62e3f3b7.json.txt

Also included diagnostics if it hels.

Hope this helps.

dotvav commented 1 year ago

Thanks for testing. This should help. I'll get back on that when I can, during the next week-end.

dotvav commented 1 year ago

@Chris-NL from your logs, it seems like your test instance is still running HomeAssistant version 2023.8.4. In order to test this PR, you will need to upgrade HomeAssistant to the lastest stable version: 2023.9.2. Not urgent, though, as my PR has a bug that, I think, requires an update of the underlying pyoverkiz library. That could take a few minutes or a few days. I will ping here again when I think the PR is ready for testing.

dotvav commented 1 year ago

@Chris-NL the PR is now ready to test with HomeAssistant version 2023.9.2.

Chris-NL commented 1 year ago

Hi dotvav,

Thank you for taking the time (again ;)). I've upgraded the test environment and removed and reinstalled the component. It's looking better, but still no good. Attached are the diagnostics.

The changes made by App or remote are reflected in HA, including Automatic this time. But when I try to modify a change through HA, I get the message "Kan service climate/set_hvac_mode niet aanroepen. {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p4 : expected string value (auto, heating, dehumidify, cooling, fan, circulator) but got auto cooling (String)'}" My translatin: Can't call service climate/set_hvac_mode.

Hopefully enough info to resolve it. Please let me know if I need to test again.

The log reports: Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/overkiz/executor.py:91 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 17:00:38 (17 occurrences) Last logged: 17:09:07

[139736576869184] {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p4 : expected string value (auto, heating, dehumidify, cooling, fan, circulator) but got auto cooling (String)'} [139736576869184] {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p5 : expected (optional) string value (timer, manu, holidays) but got stop (String)'} [139736576869184] {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p4 : expected string value (auto, heating, dehumidify, cooling, fan, circulator) but got Auto heating (String)'} [139736576869184] {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p4 : expected string value (auto, heating, dehumidify, cooling, fan, circulator) but got Dehumidify (String)'} [139736576869184] {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p4 : expected string value (auto, heating, dehumidify, cooling, fan, circulator) but got Cooling (String)'} Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 227, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call response_data = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/overkiz/climate_entities/hitachi_air_to_air_heat_pump.py", line 212, in async_set_hvac_mode await self._global_control( File "/config/custom_components/overkiz/climate_entities/hitachi_air_to_air_heat_pump.py", line 443, in _global_control await self._global_control_ovp( File "/config/custom_components/overkiz/climate_entities/hitachi_air_to_air_heat_pump.py", line 368, in _global_control_ovp await self.executor.async_execute_command( File "/config/custom_components/overkiz/executor.py", line 91, in async_execute_command exec_id = await self.coordinator.client.execute_command( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry ret = await target(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry ret = await target(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py", line 620, in execute_command response: str = await self.execute_commands(device_url, [command], label) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry ret = await target(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py", line 648, in execute_commands response: dict = await self.post("exec/apply", payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py", line 789, in post await self.check_response(response) File "/usr/local/lib/python3.11/site-pa config_entry-overkiz-5ad866c4f624516510524c2a23fd9d50.json.txt ckages/pyoverkiz/client.py", line 899, in check_response raise OverkizException(result) pyoverkiz.exceptions.OverkizException: {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p4 : expected string value (auto, heating, dehumidify, cooling, fan, circulator) but got auto cooling (String)'}

dotvav commented 1 year ago

Awesome. This protocol is quite cumbersome but I think I am finally getting a hold of it. I have fixed a bug, please refresh the PR and test again :)

Chris-NL commented 1 year ago

I can't really see if an update is installed (I did remove, restart and added everything again), because the behavior is more or less similar.

Attached are the diagnostics and below are the logs.

Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/overkiz/executor.py:91 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 17:37:10 (11 occurrences) Last logged: 17:37:59

[139808769724992] {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p5 : expected (optional) string value (timer, manu, holidays) but got stop (String)'} [139808769724992] {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p4 : expected string value (auto, heating, dehumidify, cooling, fan, circulator) but got Cooling (String)'} Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 227, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call response_data = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/overkiz/climate_entities/hitachi_air_to_air_heat_pump.py", line 209, in async_set_hvac_mode await self._global_control( File "/config/custom_components/overkiz/climate_entities/hitachi_air_to_air_heat_pump.py", line 432, in _global_control await self._global_control_ovp( File "/config/custom_components/overkiz/climate_entities/hitachi_air_to_air_heat_pump.py", line 358, in _global_control_ovp await self.executor.async_execute_command( File "/config/custom_components/overkiz/executor.py", line 91, in async_execute_command exec_id = await self.coordinator.client.execute_command( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry ret = await target(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry ret = await target(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py", line 620, in execute_command response: str = await self.execute_commands(device_url, [command], label) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry ret = await target(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py", line 648, in execute_commands response: dict = await self.post("exec/apply", payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py", line 789, in post await self.check_response(response) File "/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py", line 899, in check_response raise OverkizException(result) pyoverkiz.exceptions.OverkizException: {'errorCode': 'INCOMPATIBLE_VALUE', 'error': 'globalControl() : Invalid value for command parameter p5 : expected (optional) string value (timer, manu, holidays) but got stop (String)'} config_entry-overkiz-2ab2b7d9cdbdd13b42a4e9ffee35c8fb.json.txt

dotvav commented 1 year ago

It is very helpful. The globalControl operation is taking 5 parameters:

@Chris-NL can you confirm that:

  1. Your device is not allowing you to change the direction in which the fan is blowing (horizontally or vertically)?
  2. When you are in Holidays mode, then Auto or Manu don't matter anymore; and when you go to Auto or Manu, then you are not in Holidays anymore?
Chris-NL commented 1 year ago

There are a lot of options on the device, most of them I don't really use. So I've seen that the Somfy App for the Tahoma Box that currently drives the Airco units do have a Timer and Holiday function, but they don't seem to work. The remote (Hitachi RAR-6N2) is very complex (see pictures on https://nl.aliexpress.com/item/32813227923.html) and we only use them to turn airco on (on auto mode at certain temperature) of off again. In winter sometimes on heating mode.

So to answer your questions:

  1. I can select swing mode. It basically sets the flap in fron of the blower to move up and down or fixes it at a certain point. So this only works vertically, there doesn't seem to be a horizontal mode
  2. I can't seem to get the holiday mode working (or don't know how). It also not in this manual: https://www.manualslib.com/manual/2109912/Hitachi-Rar-6ne2.html?page=20#manual (not 100% correct remote number, but it looks damn the same ;)

Maybe an option to leave the holidays function out of it? What should that do anyway? Any logic related to holiday would come from HA right? Just as the timer. Als long as I can turn the units on and off, set the mode,, set the temperature, maybe also control the swing and strength of the blower I have all I need.

Hope this helps.

dotvav commented 1 year ago

It does help. Though, Hitachi/Overkiz have made things extremely confusing.

I've got pretty much the same remote controller. It has 2 swing mode buttons, 1 for horizontal and 1 for vertical. If your unit does only vertical, then I wonder what the horizontal button does. Also, your diagnostic file says nothing about swing mode.

If you enable the swing mode, does it reflect on HomeAssistant?

Chris-NL commented 1 year ago

See below a photo of my remote. I only have a swing button. The unit does have something to direct the air horizontal, but that seems to be fixed inside the airco. Don't see any option to change the horizontal airflow.

Don't see the swing reflected in HA when I turn it on or off. These are the attributes according to HA (dont know what supported_features: 25 mean) image

This is a photo of my remote. image

dotvav commented 1 year ago

Hi @Chris-NL, I feel like I have a fix. If it works, the code will probably need a clean-up before it is merged into HomeAssistant, but at least we will know. Feel free to refresh the PR again and test whenever. Thanks.