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

Fix for ON states for climate entities #278 #283

Merged
merged 4 commits into from
Jan 28, 2024

Conversation

anarion80
Copy link
Contributor

Fixes #278

I left all the heat, dry, cool in onStates for now as I'm not sure if they are not used for something else to determine state.

Now only hvac_action is taken for climate state and then it shows as I would expect it to:
obraz

@matt8707
Copy link
Owner

matt8707 commented Jan 25, 2024

States are determined here
https://github.com/matt8707/ha-fusion/blob/main/src/lib/Components/StateLogic.svelte

look at "Humidifier"

@anarion80
Copy link
Contributor Author

Yes, but isn't state to display determined there? And my issue is with lighting the button up as if the entity is ON.

Unless you suggest to override the display state (currently the mode) as well and show there current state from hvac_action? That would make sense and I can do that.

@anarion80
Copy link
Contributor Author

Assuming we override the display state as well - HA already has translations for all hvac_action states except preheating. What do you expect in such situation? Should I just add the whole bunch as to fetch.py like so:

(  # CLIMATE
        f"{COMPONENTS}/climate/translations/",
        [
            ...
            ("climate_action_heating", ["entity_component", "_", "state_attributes", "hvac_action", "state", "heating"]),
            ("climate_action_preheating", ["entity_component", "_", "state_attributes", "hvac_astion", "state", "preheating"]),
            ....

@matt8707
Copy link
Owner

Hmm, but what is the state of you climate entity? I think you're right that eg heating isnt an onState, but there is still 'on' in that list. So 'on' state would light up the button, and then in StateLogic.svelte you can display the correct state from hvac_action or am I confused?

@anarion80
Copy link
Contributor Author

The climate entity state is always the mode, so in my case heat, so it always shows as ON (button lighted up). The current state is only in entity attribute hvac_action and it never gets into entity state. So I think we need to update both the Button and StateLogic as it is currently in the PR - button state and state display taken from hvac_action. What would remain is the translation.

obraz

@matt8707
Copy link
Owner

The 'heat' state for an entity represents an 'on' state, so you would need to turn it 'off' to prevent the button from lighting up. What is the state, as opposed to the action, when the climate displays 'idle'?

Skärmavbild 2024-01-28 kl  13 47 54

Can you post attributes yaml in different scenarios?

@anarion80
Copy link
Contributor Author

anarion80 commented Jan 28, 2024

That's the thing - it is still heat as that is the mode set:
obraz
and as this is only heating element the mode stays in heat for the whole season lets say (or as this is underfloor heating, I never change the mode) obscuring the actual, current state.

@matt8707
Copy link
Owner

Does these changes work for you?

@anarion80
Copy link
Contributor Author

Yes, thanks 👍🏻

@matt8707 matt8707 merged commit 57ed153 into matt8707:main Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

State ON for climate entities
2 participants