pawlizio / my_velux

Custom component of velux integration for Home Assistant
32 stars 9 forks source link

Velex Windows Opener: no status update after automatic closing (rain sensor) #30

Closed Diddlik closed 1 year ago

Diddlik commented 1 year ago

I have discovered the following behavior with Velux window openers. When the window is open, open is displayed 100%. If it starts to rain, the window goes closed (ventilation position). But "Open" is still displayed as info. If one performs a stop command or open / close only then the status is updated. Would it perhaps be possible to install an extra ststus for 7% (i.e. ventilation position)? 0% - closed 7% - ventilation 8-100% - open?

dumpfheimer commented 1 year ago

I have been working in a possible fix for this (polling during heartbeat).

Would you be interested @pawlizio ?

pawlizio commented 1 year ago

@dumpfheimer: Sure, please create a Pull Request.

@Diddlik: Ventilation state is not supported by Home Assistant. Supported states are just those listed on the HA developer page: https://developers.home-assistant.io/docs/core/entity/cover

image

However a possible adjustment would be to provide config number entities, which allows to set the desired open or close position when pressing the open or close buttons. Also it would be possible to have a seperate config number entities for the opened and closed detection. Meant that once a position is smaller or greater of the configured number HA should handle this as closed or opened (i.e. < 7% = closed, > 90% = opened). An example are my Raffstore, they are opened at 50%, so when I press the open orientation button, they move to 50% instead of 100% (at 100% they are closed again, just other orientation as at 0%):

image

If you want, you can ask for a feature request in HA community: https://community.home-assistant.io/c/feature-requests

Diddlik commented 1 year ago

The distinction between Open / Close / Ventilation would be nice to have. But the correct status display after the automatic closing in the rain is already important ;)

pawlizio commented 1 year ago

@Diddlik: Have something changed in the latest Beta? So finally I hope the position will be updated automatically now.

For the distiction between Open and Ventilation you may can use a helper sensor, i.e. threshold sensor (if your window position is below 7% then this helper moves to true otherwise it is false). This helper you then can use in some kind of templates (i.e. for the icon/symbol or colors) to manipulate the UI, like:

{% if  states('template.sensor') == true %} 
   icon: mdi:weather-pouring
{% endif %}   

Or you can directly use the position of the window like this:

{% if  state_attr('cover.YOUR_WINDOW', 'current_position') < 7 } 
   icon: mdi:weather-pouring
{% endif %}   

Instead of icon, you can of course also manipulate the colors or anything else.

Diddlik commented 1 year ago

@Diddlik: Have something changed in the latest Beta? So finally I hope the position will be updated automatically now.

For the distiction between Open and Ventilation you may can use a helper sensor, i.e. threshold sensor (if your window position is below 7% then this helper moves to true otherwise it is false). This helper you then can use in some kind of templates (i.e. for the icon/symbol or colors) to manipulate the UI, like:

{% if  states('template.sensor') == true %} 
   icon: mdi:weather-pouring
{% endif %}   

Or you can directly use the position of the window like this:

{% if  state_attr('cover.YOUR_WINDOW', 'current_position') < 7 } 
   icon: mdi:weather-pouring
{% endif %}   

Instead of icon, you can of course also manipulate the colors or anything else.

Yes, status update works fine!!! Thank you

pawlizio commented 1 year ago

I assume this can be closed as well.