Skip to content

Commit

Permalink
Flic buttons (#11)
Browse files Browse the repository at this point in the history
* Control lights from Flic button
  • Loading branch information
oscarb authored Mar 29, 2020
1 parent 833e0e7 commit 1c85349
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .HA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.105.4
0.107.7
29 changes: 27 additions & 2 deletions automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
- entity_id: binary_sensor.mqtt_bathroom_motion
from: 'off'
platform: state
to: 'on'
to: 'on'
condition:
- after: 08:00
before: '22:00'
Expand Down Expand Up @@ -76,4 +76,29 @@
service: script.vacuum_room
data_template:
room_name: '{{ trigger.event.data.room }}'

- id: '1585509334461'
alias: Turn on office lights when PC turns on
description: ''
trigger:
- entity_id: switch.computer_power
from: 'off'
platform: state
to: 'on'
condition: []
action:
- data: {}
entity_id: group.office
service: light.turn_on
- id: '1585509334461'
alias: Turn off office lights when PC turns off
description: ''
trigger:
- entity_id: switch.computer_power
from: 'on'
platform: state
to: 'off'
condition: []
action:
- data: {}
entity_id: group.office
service: light.turn_off
1 change: 1 addition & 0 deletions configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ vacuum:
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml


# TODO
Expand Down
49 changes: 49 additions & 0 deletions scenes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
- id: '1584305652435'
name: Evening
entities:
light.cabinet:
brightness: 175
friendly_name: Driver vitrinskåp
state: 'on'
supported_features: 33
light.kitchen_ceiling:
brightness: 201
color_temp: 370
friendly_name: Kökslampa
icon: mdi:ceiling-light
max_mireds: 454
min_mireds: 250
state: 'on'
supported_features: 35
light.living_room_ceiling:
friendly_name: Living Room Ceiling
state: 'off'
supported_features: 33
light.living_room_window_ceiling:
brightness: 209
color_temp: 370
friendly_name: Fönsterlampa tak
max_mireds: 454
min_mireds: 250
state: 'on'
supported_features: 35
light.living_room_window_sill:
brightness: 143
color_temp: 370
friendly_name: Fönsterlampa bänk
max_mireds: 454
min_mireds: 250
state: 'on'
supported_features: 35
light.office_spotlights:
friendly_name: Spotlights
state: 'off'
supported_features: 33
light.office_top_corner:
brightness: 226
color_temp: 370
friendly_name: Hörnlampan
max_mireds: 454
min_mireds: 250
state: 'on'
supported_features: 35
24 changes: 22 additions & 2 deletions scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ turn_tv_off:
turn_everything_off:
alias: Turn everything off
sequence:
- service: media_player.turn_off
entity_id: media_player.tv
- service: light.turn_off
entity_id: all
- service: switch.turn_off
entity_id: all
- service: media_player.turn_off
entity_id: media_player.tv

cast_youtube:
alias: Cast YouTube
Expand Down Expand Up @@ -113,3 +113,23 @@ vacuum_room:
{% else %}
[21]
{% endif %}
flic_button_lights_click:
alias: Flic button Lights click
sequence:
- service: scene.turn_on
data:
entity_id: scene.evening

flic_button_lights_double_click:
alias: Flic button Lights double click
sequence:
- service: light.turn_on
data:
entity_id: all
brightness: 255

flic_button_lights_hold:
alias: Flic button Lights hold
sequence:
- service: script.turn_everything_off

0 comments on commit 1c85349

Please sign in to comment.