#Is it possible to have Home Assistant show whether the window is folded ?

1 messages ยท Page 1 of 1 (latest)

dreamy lintel
#

Is there a way to see in Home Assistant whether the window is currently closed, folded or open?
Because with door or window sensors you can only see whether the window is open or closed, but not whether it is folded.

I would appreciate any help๐Ÿ˜€๐Ÿ˜๐Ÿ˜

slim stag
#

As long as you have a sensor that can tell HA that, yes

dreamy lintel
silver kestrel
#

Probably with 2 sensors one top and one bottom if top is not connected but bottom is =folded

dreamy lintel
#

@silver kestrel Do you happen to have any idea how to display this well in the home assistant app and in the web version? So on the dashboard.

harsh oak
#

Make a template sensor that combines the information from both e.g.
If top and bottom open:
Open
Else if top open:
Folded
Else:
Closed

dreamy lintel
harsh oak
#

In helpers, make a template binary sensor

dreamy lintel
harsh oak
#

select what?

#
{% set bottom_sensor = states("binary_sensor.sensor2") | bool(false) %}
{% if top_sensor and bottom_sensor %}
open
{% elif top_sensor %}
folded
{% else %}
closed
{% endif %}```
heavy oracle
#

You could use an Aqara vibration sensor that does tilt detection.

dreamy lintel
dreamy lintel
harsh oak
#

you need to change the sensor names to whatever your sensors are called

dreamy lintel
harsh oak
#

ok, well this is assuming they return true when the window is opened, you'd have to reverse the logic if they behave differently

dreamy lintel
#

This is what it looks like for me at the moment

harsh oak
#

ah - has to be a normal template sensor not a binary template sensor, as you have 3 states you want to output not 2

#

you also don't want to copy in the dashes at the start and end, that's just for discord formatting

dreamy lintel
#

But with the normal sensor there are only weird things to select, not really what I need.

#

@harsh oak But it works now, thanks๐Ÿ˜€๐Ÿ˜๐Ÿ˜

#

Now I just have to get it to display as a window

harsh oak
#

you mean for device class etc? you can ignore that

#

ah yeah, fixing the icon in your card now is separate fun ๐Ÿ™‚

dreamy lintel
harsh oak
#

If you have mushroom cards: use a template card and you can make it return an icon based on a template

#

with just standard home assistant cards - i would make separate entity cards for your window that have a fixed icon on and use condition cards to hide/show them appropriately

#

something like this:

#

but probably then shove all of them in a vertical stack so they always show up in the same place

#

depends how you want things to look of course!

dreamy lintel
#

Yeah, I have mushroom cards.
I have already used this to make the icon of my fan rotate when it is on.