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

Update cover entity #7

Open
jkaberg opened this issue Mar 20, 2024 · 7 comments
Open

Update cover entity #7

jkaberg opened this issue Mar 20, 2024 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@jkaberg
Copy link

jkaberg commented Mar 20, 2024

Hi @mapero, would it be possible to update the cover entity to reflect the current state?

  • down should not be possible when position 0% aka closed
  • up should not be possible when position is 100% aka open

I also noticed you created an button to call the ventilation function, is it possible to convert this to an switch which also reflects if its currently ventilating or not (switch on=ventilating, switch off=closed)

EDIT: originally this post was something else, but after testing a bit more I changed it into the above

@jkaberg jkaberg changed the title More sensors? Update cover entity Mar 20, 2024
@mapero
Copy link
Owner

mapero commented Mar 26, 2024

The issue with the switch is, that you can only reflect two states, but you have more than two:

  • open
  • close
  • vent

What would be the switch state if door is completely open?

@14yannick
Copy link

Hi Jochen regarding the vent switch state. I had a binary approach to it. When it's in vent position it's on else it's off.

@jkaberg
Copy link
Author

jkaberg commented Mar 29, 2024

The issue with the switch is, that you can only reflect two states, but you have more than two:

  • open
  • close
  • vent

What would be the switch state if door is completely open?

I think when switch on it should always goto vent position. When off ideally previous state (maybe hard if ESP is restarted etc?) alternatively closed. Thuss fully open is never an issue/option

@jkaberg jkaberg closed this as completed Mar 29, 2024
@jkaberg jkaberg reopened this Mar 29, 2024
@mapero mapero self-assigned this Apr 2, 2024
@mapero mapero added the question Further information is requested label Apr 2, 2024
@jkaberg
Copy link
Author

jkaberg commented Apr 3, 2024

I was also wondering if it would be possible to extract the state as an separate sensor entity? An string simply reflecting the current state would suffice for my use case

@14yannick
Copy link

Hi @jkaberg, I think the value you are looking for is already contained in the conver entity.
03-04-_2024_11-27-04
In Home assistant you can then include it in your lovelace with this for example.
entities: - entity: cover.gd_atom_garage_door - type: attribute entity: cover.gd_atom_garage_door name: position icon: mdi:percent-box-outline attribute: current_position
resulting in this
03-04-_2024_11-52-10

@jkaberg
Copy link
Author

jkaberg commented Apr 3, 2024

@14yannick well sort of, if current_position is 4% then its ventilation and if current_position is 50% then is half position which is true.

However to determine if the cover is closing or opening one would need the detailed/current state. It is possible to make an template sensor in HA to mimic what the state engine already is doing based upon the % of the cover sure, but when the state is already defined but not exposed through an sensor I think it makes more sense to expose the state than creating an template sensor to do the same thing.

When I say state I mean "ventilation", "half position", "opening", "open", "closing", "closed" etc

@14yannick
Copy link

@jkaberg @MCLW implemented this text sensor and published a Pull request #8 with this functionality. I adapt his solution and create a new pull request #10 with this the functionality using templates instead of an external component. There I also implemented the vent as button and as Switch because as I like it like this:-). The request are not merged but you can change your yaml to my repo and check out here how to add Text and Switch components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants