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

Climate support for hardware buttons #2421

Open
SirEndii opened this issue Dec 4, 2024 · 2 comments
Open

Climate support for hardware buttons #2421

SirEndii opened this issue Dec 4, 2024 · 2 comments
Labels
Enhancement For suggestions that add new features or improve existing functionalities.
Milestone

Comments

@SirEndii
Copy link

SirEndii commented Dec 4, 2024

Enhancement Summary

Turn off climate element/toggle to heating mode with hardware buttons.

Detailed Description

Greetings

I currently have a climate element using two heaters in a room. For convenience, I wanted to install the ns panel into the wall so the employees can just click the right hardware button to turn off the climate element instead the need of using the app.

But this does not really work, I selected the climate element for the right button but when I click it, nothing happens. I am not sure if this is simply a me issue and I did something wrong or it really does not work with the panel.

I know that there is currently #2394 open, but I would just prefer a simple click to disable heating/enable it for the older/not so techie employees

Screenshot_20241204-094521

Additional Context

I am not an expert with HA, only used it for some months now. So I am sorry for anything I may didn't know

@SirEndii SirEndii added the Enhancement For suggestions that add new features or improve existing functionalities. label Dec 4, 2024
@edwardtfn
Copy link
Collaborator

I just realized that no action is executed with a short press in a climate entity:

- &short_press-service_call
if: '{{ true }}'
then:
- service: >
{% if entity_domain in ["cover"]
and states(last_click_button.entity) in ["opening", "closing"]
and state_attr(last_click_button.entity, "supported_features") | int(0) | bitwise_and(4) == 0 %}
{{ entity_domain }}.stop_cover
{% elif entity_domain in ["light", "switch", "cover", "input_boolean", "fan", "remote"] %}
{{ entity_domain }}.toggle
{% elif entity_domain in ["automation"] %}
{{ entity_domain }}.{{ domain_automation_button_action if domain_automation_button_action is string else "toggle"}}
{% elif entity_domain in ["button", "input_button"] %}
{{ entity_domain }}.press
{% elif entity_domain in ["lock"] and states(last_click_button.entity) in ["locked"] %}
{{ entity_domain }}.unlock
{% elif entity_domain in ["lock"] and states(last_click_button.entity) in ["unlocked"] %}
{{ entity_domain }}.lock
{% elif entity_domain in ["scene", "script"] %}
{{ entity_domain }}.turn_on
{% elif entity_domain in ["media_player"] %}
{{ entity_domain }}.media_play_pause
{% else %}
homeassistant.update_entity
{% endif %}
data:
entity_id: '{{ last_click_button.entity }}'
continue_on_error: true

It will just refresh the entity status.

I can easily add an action to this, but I'm unsure if a "toggle" action would be the best here. I'm not 100% sure about this, but I think it was a toggle in the past and we changed that for some reason...

@edwardtfn edwardtfn added this to the v4.4.0 milestone Dec 4, 2024
@SirEndii
Copy link
Author

SirEndii commented Dec 4, 2024

Not sure if I overlooked something, but a toggle sounds okay if it would only toggle the heating mode
Screenshot_20241204-110536.png

My automation to turn the climate element on/off also uses this, so it at least would fit there perfectly (for my purpose)

Maybe someone else knows why it was changed in the past

edwardtfn added a commit that referenced this issue Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For suggestions that add new features or improve existing functionalities.
Projects
None yet
Development

No branches or pull requests

2 participants