Open ivanfmartinez opened 6 months 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!
(message by CodeOwnersMention)
climate documentation climate source (message by IssueLinks)
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!
(message by CodeOwnersMention)
emulated_hue documentation emulated_hue source (message by IssueLinks)
I can confirm that Zha does fail on on/off calls for real devices.
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 ?
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.
Still the same state on 2024.9.3
This is not something easy to fix as most climate devices have multiple modes. "Off" is fine, but what would "On" map to for a system that does heating, cooling and fan?
Anyway, the workaround is to create Scripts in Home Assistant and them exposing these to Alexa. Then within Alexa, create a routine with the name of the device you are trying to control. Alexa will pick your custom routine instead of trying to turn on the device via Emulated Hue.
For example an Alexa routine for "turn central heating on" which runs a Script within Home Assistant that changes that climate device to "heat" mode.
@andmcg1 I agree that its impossible to solve all conditions, HUE emulator can only provide limited data, but as the homeassistant climate devices already support on/off command this should be easily implemented. like I did here : https://github.com/home-assistant/core/compare/dev...ivanfmartinez:home-assistant-core:2024.4.0_hue_climate
I just was unable to make a correct environment to build HA and create PR on my machine.
I think that providing incomplete on/off on HUE is better than not providing and making every user that can use the standard on/off behaivour implement scripts to make the workaround.
Good point. I didn't realise that Climate devices supported Toggle action. I tried on a split system that has several different modes and it worked. I assume it lets the device decide which mode to use (likely whichever mode it was in last time it was on).
So, I retract my comments - it should be possible. I do already have some working changes to the Emulated Hue code to support this. If I ever get the time to sit down and figure out how to use Git and submit a pull request, I'll see if it can be merged into the integration. Or if someone else is willing to do some testing and take care of that, I can post my code changes here.
I also have fixed a bug where my central heating Climate device returns a "null" value for the setpoint temperature when it is switched off. This causes the integration to stop working. So I can post that bug fix too - it's just a couple of lines.
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