Hi!
I am new to HA and still absorbing the vast knowledge of this ecosystem so please bear with me.
I have a set of Graywind Motorized Day/Night Cellular Shades connected to HA via Zigbee. These identify as Tuya TS0301 covers and expose battery
, state
, position
, and tilt
(tilt is not available with these blinds as they are cellular). The blinds (lets call them daynight_blinds
) have a single motor and can be controlled via the position
such that values between [0-50] correspond to the blackout blinds opening and closing and [51-100] controls the position of the day blinds.
While this works, I would ideally like to be able to control the day and night blinds individually using two sliders in the dashboard.
My initial thought on how to achieve this is to create a cover template (lets call it daynight_custom
) which maps values between [0-50] of the position
from daynight_blinds
to values between [0-100] of the position
of daynight_costum
, and values between [51-100] from daynight_blinds
to [0-100] of the tilt
for daynight_custom
, essentially hijacking this attribute.
Ideally, this should work both ways, i.e. if I set any value on position
or tilt
of daynight_custom
, the corresponding value is set in daynight_blinds
. If I set any value in position on daynight_blinds
, the corresponding values in position
and tilt
in daynight_custom
should be set. Equally, I would need to assure that position
and tilt
do not conflict with each other, i.e. tilt
must be set to 0 if position
is any other value that 0, and position
is set to 0 if tilt
has any other value than 0.
Finally, I am planning on purchasing additional day/night blinds and it would be great if the final code could be reused by only switching the name of the blind to be controlled, e.g. using anchors.
Is the above a good approach in your opinion? What would be the best way to implement this? I have only gotten so far as to set the state
of daynight_custom
to the state of daynight_blinds
, but I am struggling to comprehend the logic of the remaining fields.
cover:
- platform: template
covers:
daynight_custom:
device_class: blind
friendly_name: "Smart Blinds Custom Controller"
value_template: "{{ states('cover.daynight_blinds') }}"
open_cover:
action: ?
close_cover:
action: ?
stop_cover:
action: ?
#use this to control blackout blind postion
set_cover_position: ?
#use tilt to control day blind position
set_cover_tilt_position: ?
Thank you in advance for your help!