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

Add homematic STATE channel as attribute #56559

Closed
wants to merge 2 commits into from

Conversation

sVnsation
Copy link
Contributor

Proposed change

Makes homematic STATE attribute visible in home-assistant.
Needed for HmIP-BWTH added switching state for heating valve see: danielperna84/pyhomematic#415

Dependency pyhomematic 0.1.74 is already merged in PR #54613

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

Hey there @pvizeli, @danielperna84, mind taking a look at this pull request as it has been labeled with an integration (homematic) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

Copy link
Member

@pvizeli pvizeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's wrong. You need fix the model

@sVnsation
Copy link
Contributor Author

Excuse me if I'm not smart enough to understand: What model needs a fix?
danielperna84 encouraged me to start this PR. Maybe he understands more about this to judge.

@sVnsation sVnsation requested a review from pvizeli September 24, 2021 08:06
@MartinHjelmare MartinHjelmare changed the title homematic - add STATE channel as attribute Add homematic STATE channel as attribute Sep 24, 2021
@emufan
Copy link
Contributor

emufan commented Oct 11, 2021

That's wrong. You need fix the model

@pvizeli Can you explain, which change request do you see here? It's only about adding another attribute to the devices. Here esp. the valve switch state of the thermostats. And this state is only named state and @sVnsation is putting only this state with the name attriibute_state as another addition attribute to the device. the name attribute_state, because state is unfortunately the general name of different states in different devices. Here state is the valve switch state and on another device it could be whatever.

But only with this PR, we will have this state as the needed attribute in the device.

@emufan
Copy link
Contributor

emufan commented Nov 17, 2021

Is there any update here? Or explanation why it is not going to be merged?

@pahofmann
Copy link

An updated would be much appreciated. Happy to help or test if needed.

@pvizeli
Copy link
Member

pvizeli commented Nov 30, 2021

STATE is based on the device object. So if it is STATE, you need check the type of the class and decide the right information for it

@danielperna84
Copy link
Contributor

@pvizeli

I'm not sure if it's clear what this is about. This is intended to not have to create an entity based on the STATE because it's minor information not everybody needs. We just want an attribute for a parameter that's called STATE (which usually has it's own entity).

@emufan
Copy link
Contributor

emufan commented Dec 1, 2021

E.g.

image

@mglaabde
Copy link

mglaabde commented Feb 2, 2022

Shouldn't the HMIP-BWTH valve/switching state be translated to hvac_action https://developers-home--assistant-io.translate.goog/docs/core/entity/climate/?_x_tr_sl=en&_x_tr_tl=de&_x_tr_hl=de&_x_tr_pto=sc ?
with hvac_action = heating (in case HMIP-BWTH is used to actuate a heating device, and state==true)
or hvac_action = cooling (in case HMIP-BWTH is used to actuate a cooling device, and state==true)

What would be the right approach so that home assistant is able to recognize the heating automatically (e.g., to have it in the respective diagrams next to current temperature and target temperature, without the need for additional template sensors, etc.)?
image

@emufan
Copy link
Contributor

emufan commented Feb 2, 2022

From my point of view. valve closed <> cooling.

@mglaabde
Copy link

mglaabde commented Feb 2, 2022

HMIP-BWTH and HMIP-BWTH24 support heating and cooling, see https://files2.elv.com/public/15/1506/150628/Internet/150628_um.pdf section 6.6.1. They would do this by actuating the exact same switching output, just depending on the current mode. E.g., for heating hot water is let through the valve by actuating the switch; for cooling, it is assumed that the heating system can provide cold water which is then let through the valve by actuating the switch). Accordingly, it depends on the current mode, whether your current attribute_state=true is actually cooling or heating.

Based on the documentation https://developers.home-assistant.io/docs/core/entity/climate/#hvac-action, I guess we would need to use hvac_action to do a proper HA integration. Besides, supported/configured hvac_modes should be correctly provided: https://developers.home-assistant.io/docs/core/entity/climate/#hvac-modes

If so, I guess this will automatically provide heating information in climate history chart, see also https://community.home-assistant.io/t/explanation-of-climate-history-chart/73926

@emufan
Copy link
Contributor

emufan commented Feb 3, 2022

I think you are wrong or in the wrong idea.

HVAC Action
The HVAC action describes the current action. This is different from the mode, because if a device is set to heat, and the target >temperature is already achieved, the device will not be actively heating anymore.

But valve open oder closed is completely different to "temperature is already achieved". Here the valve state for such device

image

The temperature is never reached. And the device is still in heating mode of course. Take the attribute and use it in a chart.

@mglaabde
Copy link

mglaabde commented Feb 3, 2022

@emufan: My understanding is different. Exactly because of what you cited, I think hvac_action matches with the valve/switch state (depending on the general mode). Ultimately, this is the function of a thermostat, isn't it? Opening the valve (or in case of the BWTH actuating the switch) in order to heat.
What you see in your diagram is that the amount of switch on vs. switch off per time window changes, when the target temperature goes up. This is the kind of controlling behavior of the BWTH.
The fact that you may not exactly reach the target temperature depends on the hysteresis, environmental and heater conditions (e.g., supply temperature).

Sure, I can create a template sensor utilizing attribute_state and could end up with a similar diagram like yours. However, what I actually would like to see is a graph with that green areas, like here: https://community.home-assistant.io/t/explanation-of-climate-history-chart/73926 IMHO, this is how it is intended by HA, and for what we need to populate the hvac_action .

Maybe someone else can help us out in resolving the unclarity. Maybe @pvizeli?

@emufan
Copy link
Contributor

emufan commented Mar 7, 2022

Any update/outlook on this?

@mglaabde
Copy link

mglaabde commented Apr 26, 2022

Any update/outlook on this?

Would also be my question.
I don't know, whether it is implemented correctly in https://github.com/danielperna84/hahomematic, @danielperna84?
(haven't migrated to it yet)

I can only once again emphasize my understanding, which btw is exactly how, e.g., https://github.com/ScratMan/HASmartThermostat is implemented and behaving. Thus, visualization with the shaded area works correctly.
image

@github-actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Jul 29, 2022
@emufan
Copy link
Contributor

emufan commented Jul 29, 2022

I'm already in all installations on new integration, but really don't understand why this is not merged for giving the users of the core integration the valve level of the devices, which are setting this in this parameter.

@github-actions github-actions bot removed the stale label Aug 1, 2022
@GM-Alex
Copy link

GM-Alex commented Oct 5, 2022

@emufan The home assistant team somehow make strange decisions related to the homematic core integration even a security relevant change wasn't implemented, see #47609
I also don't understand why the make this ridiculous move but don't expect that something will happen here.

@github-actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 19, 2023
@github-actions github-actions bot closed this Jan 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants