I have also been working on this for a short while, altough i have not been looking at percentages, i would sugest a (Quick’N’Dirty ™?) solution as stated previously: open or close, add a delay long enaugh to completly open or close the shutter to the different direction, delay, stop invert delay stop for instance in pseudo code: -down -delay(60s) -stop -up -delay(5s) -stop
The above would be perfect just to set the blinds in their ‘vented’ position.
ofcourse trying to put the actual state or even just (top) or (bottom) half in lets say… an input_number might be nicer on the outside
Just an idea
input_number:
shutter:
name: Shutter Position
initial: 0
min: 0
max: 11
step: 1
icon: mdi:window-shutter-open
# Some snippit i found and had set asside for future use
# it will be... no it IS broken but just an idea on how wild you could go
# immagination is not a factor, time and money tough...
# icon_template: >-
# {% if states('input_number.shutter')| between 0 and 9}
# mdi:window-shutter-open
# {% else if states('input_number.shutter')| equals 10}
# mdi:window-shutter-alert
# This could be the vented position
# {% else if states('input_number.shutter')| equals 11}}
# mdi:window-shutter
# {% endif %}
see the bottom side of the picture at the bottom
See
but harder to track on the software side. <- So… that’s my take on a possible solution.
As for what i have now that i can share:
Using Zigbee2mqtt:
Recently Interlock has been added to the commands/features, so this makes it perfect for our case.
you can switch the relay by mqtt/hass or by the physical switch connection of the aqara itself using a 2 way switch 1-line with 1-open contact and 1-close contact, the last command given will be kept.
A way to get 3 push buttons up, down and stop.
A disclamer tough, stop is a group of up and down together here in lovelace it is set as a entity group with switch.turn_off service if you have no extra layer of protection firmware/hardware you might burn down your house so do not use withouth interlock ENABLED
- entity: group.studio_shutter_stop
tap_action:
action: call-service
service: switch.turn_off
service_data:
entity_id:
- group.studio_shutter_stop
type: entity-button
-> do not use switch.turn_on
cards:
~ I'm braking the configuration here to prevent blind copy which might brake
your hardware, possibly even cause the end of the world
- entity: switch.studio_shutter_up
hold_action:
action: more-info
icon: 'mdi:window-shutter-open'
icon_height: 30px
show_icon: true
show_name: false
tap_action:
action: toggle
type: entity-button
- entity: group.studio_shutter_stop
hold_action:
action: more-info
icon: 'mdi:window-shutter-alert'
icon_height: 30px
show_icon: true
show_name: false
tap_action:
action: call-service
service: switch.turn_off
service_data:
entity_id:
- group.studio_shutter_stop
type: entity-button
- entity: switch.studio_shutter_down
hold_action:
action: more-info
icon: 'mdi:window-shutter'
icon_height: 30px
show_icon: true
show_name: false
tap_action:
action: toggle
type: entity-button
icon_height: 30px
title: south window shutter
type: vertical-stack
see the top side of the picture an the bottom
at this time i hope this can give you a push in the right direction or an idea to work with.
That said my next goal us to use input_select which would be safer and just a better coded solution, but i cannot acess it with the pushbuttons and i don’t like to use a dropdown menu
There is also a little extra included at the bottom,
but for now and as it always goes for these sorts of projects… it works well enough and if/when i get some extra time i will improve on it
input_select:
shutter_do:
name: Shutter direction
options:
- stop
- up
- down
initial: stop
icon: mdi:window-shutter-open
automation:
- alias: shutter stop
trigger:
- platform: state
entity_id: input_select.shutter_do
to: "stop"
action:
service: switch.turn_off
data:
entity_id:
- switch.studio_shutter_down
- switch.studio_shutter_up
- alias: shutter up
trigger:
- platform: state
entity_id: input_select.shutter_do
to: "up"
action:
- service: switch.turn_off
data:
entity_id: switch.studio_shutter_down
- service: switch.turn_on
data:
entity_id: switch.studio_shutter_up
- alias: shutter down
trigger:
- platform: state
entity_id: input_select.shutter_do
to: "down"
action:
- service: switch.turn_off
data:
entity_id: switch.studio_shutter_up
- service: switch.turn_on
data:
entity_id: switch.studio_shutter_down
# Not required but Home automation is for the lazy tech people so might aswel use it
- alias: 'Open shutter when sun rises'
trigger:
platform: sun
event: sunrise
offset: "-00:20"
action:
- service: input_select.select_option
data_template:
entity_id: input_select.shutter_do
option: "up"
- alias: 'Close shutter when sun sets'
trigger:
platform: sun
event: sunset
offset: "00:20"
action:
- service: input_select.select_option
data_template:
entity_id: input_select.shutter_do
option: "down"
New user, so i needed to sacrefice some layout formatting as i can only put use 1 picture