Hi.
I just stumbled upon this and 1st of all “Thank You” for this nice work of yours.
I would like to propose a small enhancement.
Velux windows have a “Ventilation” position. ( at least mine have)
This is when, the vent is open, but the window itself is closed.
The maximum venting value seems to be at: “Open - 15%”
So everything > 0 and <=15% should be considered “VENTING”
Only when fully closed, the windows reports “Closed”
Modifying your code slightly.
In the entity_picture:
entity_picture: |
[[[
if (entity.state == “unavailable”) {
return “/local/custom_icons/velux/roof-window-disabled.svg”;
}
else if (entity.state == “open”) {
if (entity.attributes.current_position <= 15) {
return “/local/custom_icons/velux/roof-window-venting.svg”;
}
else
{
return “/local/custom_icons/velux/roof-window-open.svg”;
}
}
else if (entity.state == “closed”) {
return “/local/custom_icons/velux/roof-window-closed.svg”;
}
else if (entity.state == “opening”) {
return “/local/custom_icons/velux/roof-window-opening.svg”;
}
else if (entity.state == “closing”) {
return “/local/custom_icons/velux/roof-window-closing.svg”;
}
]]]
show_entity_picture: true
size: 50px
and in the state_display:
state_display: |
[[[
if (entity.state == “unavailable”) {
return “unavailable”;
}
else if (entity.state == “open”) {
if (entity.attributes.current_position <= 15) {
return “venting”;
}
else if (entity.attributes.current_position == 100) {
return “open”;
}
else
{
return (entity.attributes.current_position + “% open”);
}
}
else if (entity.state == “closed”) {
return “closed”;
}
else if (entity.state == “opening”) {
return “opening”;
}
else if (entity.state == “closing”) {
return “closing”;
}
]]]
To have an additional SVG icon would also be nice.
I have not made a new icon, but propose the icon name
Cheers and thanks for your efforts
Jurgen