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
69.77k stars 28.91k forks source link

Emulated HUE ignoring ON/OFF commands for climate #117083

Open ivanfmartinez opened 1 month ago

ivanfmartinez commented 1 month ago

The problem

I'm trying to use my air conditioning on Emulated HUE. They are exposed but it does not work to turn on and off.

My air conditioning is configured by smartir as climate.

It should accept on/off commands also not only numbers to set temperature.

What version of Home Assistant Core has the issue?

core-2024.4.0

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

Emulated HUE

Link to integration documentation on our website

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

Diagnostics information

The climate code on emulated hue is explicit about not supporting ON/OFF commands in : https://github.com/home-assistant/core/blob/dev/homeassistant/components/emulated_hue/hue_api.py#L522

I'm using smartir to control air conditioning, and have used even the generic homeassistant turn_on and turn off. When turning on the climate service set the state to previous configured state.

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

The climate device works fine with generic homeassistant services to turn_on and turn_off . This can be used also when receiving the on/off from alexa or any other system connecting to emulated hue.

All not 'off' states from climate are being mapped to the 'on' correctly.

The integration are just not accepting the on/off command and should be accepting this.

As I only have air conditioning I can´t see a reason to not provide the on/off feature to the all climate entities instead of just ignoring the commands.

The documentation about climate service turn on/off indicates that some service does not have this support : https://www.home-assistant.io/integrations/climate/#service-climateturn_on

But in the hue emulator I dont think that calling the services will be a problem in this cases, because the climate probably will ignore or give an error in this cases.

Maybe someone that have other kind of climate entities can confirm if accepting on/off for all devices are viable.

I made some tests in my environment and is working to turn on and off. When I try to just set temperature Alexa gives an error but the change works (this happened without my code changes)

https://github.com/home-assistant/core/compare/dev...ivanfmartinez:home-assistant-core:2024.4.0_hue_climate

home-assistant[bot] commented 1 month ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (climate) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `climate` 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 climate` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


climate documentation climate source (message by IssueLinks)

home-assistant[bot] commented 1 month ago

Hey there @bdraco, @tho85, mind taking a look at this issue as it has been labeled with an integration (emulated_hue) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `emulated_hue` 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 emulated_hue` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


emulated_hue documentation emulated_hue source (message by IssueLinks)

wim-bart commented 1 month ago

I can confirm that Zha does fail on on/off calls for real devices.

ivanfmartinez commented 1 week ago

The situation still the same on 2024.6.4, and I was unable to create a development environment to run all the tests to check before a PR.

Anyone else has tested with my changes ?