1
0

Change brightness and move blinds to scripts

This commit is contained in:
Przemek Grondek 2022-09-26 21:33:44 +02:00
parent ae0e6ad3d7
commit 1269579f82
3 changed files with 44 additions and 35 deletions

View File

@ -22,10 +22,10 @@
trigger: trigger:
- platform: numeric_state - platform: numeric_state
entity_id: sensor.office_illuminance entity_id: sensor.office_illuminance
below: '140' below: '160'
for: for:
hours: 0 hours: 0
minutes: 1 minutes: 2
seconds: 0 seconds: 0
condition: condition:
- condition: or - condition: or
@ -72,8 +72,8 @@
- service: cover.open_cover - service: cover.open_cover
target: target:
entity_id: entity_id:
- cover.office_blinds
- cover.dining_blinds - cover.dining_blinds
- service: script.office_blinds_up
- id: brightness-bright - id: brightness-bright
alias: '[Brightness] Bright - close covers' alias: '[Brightness] Bright - close covers'
@ -81,7 +81,7 @@
trigger: trigger:
- platform: numeric_state - platform: numeric_state
entity_id: sensor.office_illuminance entity_id: sensor.office_illuminance
above: '1200' above: '1300'
for: for:
hours: 0 hours: 0
minutes: 1 minutes: 1
@ -90,5 +90,5 @@
- service: cover.close_cover - service: cover.close_cover
target: target:
entity_id: entity_id:
- cover.office_blinds
- cover.dining_blinds - cover.dining_blinds
- service: script.office_blinds_down

View File

@ -7,21 +7,7 @@
type: remote_button_short_press type: remote_button_short_press
subtype: turn_on subtype: turn_on
action: action:
- choose: - service: script.office_blinds_down
- conditions:
- condition: numeric_state
entity_id: cover.office_blinds
attribute: current_position
below: 51
sequence:
- service: cover.close_cover
entity_id: cover.office_blinds
default:
- service: cover.set_cover_position
data:
position: 50
target:
entity_id: cover.office_blinds
mode: single mode: single
- id: office-blinds-button-up - id: office-blinds-button-up
@ -33,21 +19,7 @@
type: remote_button_short_press type: remote_button_short_press
subtype: turn_off subtype: turn_off
action: action:
- choose: - service: script.office_blinds_up
- conditions:
- condition: numeric_state
entity_id: cover.office_blinds
attribute: current_position
above: 49
sequence:
- service: cover.open_cover
entity_id: cover.office_blinds
default:
- service: cover.set_cover_position
data:
position: 50
target:
entity_id: cover.office_blinds
mode: single mode: single
- id: office-blinds-button-down-all - id: office-blinds-button-down-all

View File

@ -0,0 +1,37 @@
office_blinds_up:
alias: '[Office] Blinds up'
sequence:
- choose:
- conditions:
- condition: numeric_state
entity_id: cover.office_blinds
attribute: current_position
above: 49
sequence:
- service: cover.open_cover
entity_id: cover.office_blinds
default:
- service: cover.set_cover_position
data:
position: 50
target:
entity_id: cover.office_blinds
office_blinds_down:
alias: '[Office] Blinds down'
sequence:
- choose:
- conditions:
- condition: numeric_state
entity_id: cover.office_blinds
attribute: current_position
below: 51
sequence:
- service: cover.close_cover
entity_id: cover.office_blinds
default:
- service: cover.set_cover_position
data:
position: 50
target:
entity_id: cover.office_blinds