binary_sensor:
- platform: template
sensors:
window_frontleft:
device_class: window
# Replace binary_sensor.windowstatus with the correct sensor name
value_template: >-
{{ is_state_attr('binary_sensor.windowstatus', 'windowstatusfrontleft', 'OPEN')
or is_state_attr('binary_sensor.windowstatus', 'windowstatusfrontleft', 'INTERMEDIATE_POSITION') }}
You can add more information, like an availability_template. With the upper config the window will appear as closed when the binary_sensor you get the information from is unavailable.
You can, in your automations if you wanted to.
As in the example I’ve pasted you should access it like state_attr('binary_sensor.windowstatus', 'windowstatusfrontleft')
This will give you OPEN, INTERMEDIATE_POSITION or CLOSED for the specified window
You could use template triggers in your automations then, however setting up binary sensors is a pretty clean way of doing it too