Skip to content

Commit

Permalink
Update & customize entities
Browse files Browse the repository at this point in the history
  • Loading branch information
skdw committed Feb 23, 2025
1 parent 645973b commit 50cf312
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .HA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.12.5
2025.1.4
12 changes: 6 additions & 6 deletions automations/automations_light_scenes.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
- id: 'lights-tripleclick-scenes'
alias: YAML lights scenes on triple click
description: "Automates lights scenes triggered on switch triple-click"
- id: 'light-tripleclick'
alias: YAML actions on light switch triple click
description: "Automates actions triggered on light switch triple-click"
variables:
switches: !include ../entities/light_tripleclick_switches.yaml
scenes: !include ../entities/light_tripleclick_scenes.yaml
actions: !include ../entities/light_tripleclick_scenes.yaml # TODO rename to actions
trigger:
- platform: state
entity_id: !include ../entities/light_tripleclick_switches.yaml
Expand All @@ -18,8 +18,8 @@
continue_on_timeout: false
- delay:
milliseconds: 500
- service: scene.turn_on
- action: "{{ actions[switches.index(trigger.entity_id)]['action'] }}"
target:
entity_id: "{{ scenes[switches.index(trigger.entity_id)] }}"
entity_id: "{{ actions[switches.index(trigger.entity_id)]['target'] }}"
mode: single
max_exceeded: silent
4 changes: 4 additions & 0 deletions automations/automations_light_switches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
condition:
- condition: template # automate only if initial light and switch states match
value_template: "{{ states(lights[switches.index(trigger.entity_id)]) == trigger.from_state.state }}"
- condition: template # keep only on/off states, drop unavailable and unknown
value_template: "{{ trigger.to_state.state == 'on' or trigger.to_state.state == 'off' }}"
action:
- service: "{{ 'light.turn_on' if(trigger.to_state.state == 'on') else 'light.turn_off' }}"
target:
Expand All @@ -28,6 +30,8 @@
condition:
- condition: template # automate only if initial switch and light states match
value_template: "{{ states(switches[lights.index(trigger.entity_id)]) == trigger.from_state.state }}"
- condition: template # keep only on/off states, drop unavailable and unknown
value_template: "{{ trigger.to_state.state == 'on' or trigger.to_state.state == 'off' }}"
action:
- service: "{{ 'switch.turn_on' if(trigger.to_state.state == 'on') else 'switch.turn_off' }}"
target:
Expand Down
4 changes: 3 additions & 1 deletion configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ automation manual: !include_dir_merge_list automations/

script: !include scripts.yaml

scene ui: !include scenes.yaml
#scene ui: !include scenes.yaml
scene manual: !include_dir_merge_list scenes/

homeassistant:
external_url: !secret external_url
customize: !include configuration/customize.yaml

http:
use_x_forwarded_for: true
Expand Down Expand Up @@ -68,6 +69,7 @@ input_select:
- "Radio FM"
- "Network"
- "Bluetooth"
- "TV"
# pc_power_mode:
# name: "PC power mode"
# options:
Expand Down
28 changes: 28 additions & 0 deletions configuration/customize.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Add an entry for each entity that you want to overwrite
light.bedroom_ceiling:
icon: 'mdi:ceiling-light'
light.balcony_bamboo:
icon: 'mdi:lamp'
#light.hall_wardrobe_tmp:
light.living_room_sofa:
icon: 'mdi:ceiling-light'
light.living_room_table:
icon: 'mdi:ceiling-light'
light.kitchen_countertop:
icon: 'mdi:led-strip'
light.bathroom_ceiling:
icon: 'mdi:wall-sconce-flat'
light.bathroom_mirror:
icon: 'mdi:spotlight'
light.balcony_ceiling:
icon: 'mdi:wall-sconce-flat'
light.bedroom_reading_left:
icon: 'mdi:track-light'
light.bedroom_reading_right:
icon: 'mdi:track-light'
light.wardrobe_ceiling:
icon: 'mdi:wall-sconce-flat'
light.wardrobe_clothes:
icon: 'mdi:led-strip'
light.hall_entrance:
icon: 'mdi:wall-sconce-flat'
2 changes: 1 addition & 1 deletion configuration/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
- name: "PC is active"
unique_id: "pc_is_active"
state: >
{{ states('sensor.pc_cpuload') != 'unavailable' }}
{{ states('sensor.pc_cpuload') != 'unavailable' and (now() - states.sensor.pc_cpuload.last_changed).total_seconds() < 300 }}
# {{ states('sensor.pc_kamil_active_ratio') | float(0) > 0 }}
# - name: "Shower"
# icon: "mdi:shower-head"
Expand Down
20 changes: 14 additions & 6 deletions entities/light_tripleclick_scenes.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
- scene.lights_on
- scene.lights_focus
- scene.lights_cooking
- scene.lights_dinner
- scene.lights_evening
- scene.lights_off
- action: scene.turn_on
target: scene.lights_on
- action: scene.turn_on
target: scene.lights_focus
- action: scene.turn_on
target: scene.lights_cooking
- action: scene.turn_on
target: scene.lights_dinner
- action: scene.turn_on
target: scene.lights_evening
- action: scene.turn_on
target: scene.lights_off
- action: cover.toggle
target: cover.curtains
1 change: 1 addition & 0 deletions entities/light_tripleclick_switches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
- switch.living_room_l4
- switch.living_room_l5
- switch.living_room_l6
- switch.wardrobe
2 changes: 1 addition & 1 deletion entities/lights.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- light.hall_rail_entrance
- light.kitchen_spot
- light.kitchen_spots
- light.kitchen_countertop
- light.living_room_table
- light.living_room_sofa
Expand Down
18 changes: 7 additions & 11 deletions scenes/scenes_lights.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
name: Lights On
icon: mdi:lightbulb-multiple
entities:
light.hall_rail_entrance:
light.hall_entrance:
state: 'on'
light.kitchen_spot:
light.kitchen_spots:
state: 'on'
switch.outlet_kitchen_hood:
state: 'on'
Expand Down Expand Up @@ -39,7 +39,7 @@
light.kitchen_countertop:
state: 'on'
brightness: 220
light.kitchen_spot:
light.kitchen_spots:
state: 'on'
brightness: 150
color_temp_kelvin: 3500
Expand Down Expand Up @@ -69,17 +69,13 @@
light.balcony_bamboo:
state: 'on'
brightness: 40
light.balcony_ceiling:
state: 'on'
brightness: 80
color_temp_kelvin: 3500
switch.outlet_kitchen_hood:
state: 'on'
- id: 'yaml_lights_cooking'
name: Cooking
icon: 'mdi:chef-hat'
entities:
light.kitchen_spot:
light.kitchen_spots:
state: 'on'
brightness: 60
color_temp_kelvin: 3000
Expand All @@ -104,7 +100,7 @@
name: Dinner
icon: 'mdi:silverware'
entities:
light.kitchen_spot:
light.kitchen_spots:
state: 'on'
brightness: 30
color_temp_kelvin: 2500
Expand Down Expand Up @@ -143,9 +139,9 @@
name: Evening
icon: 'mdi:clock-time-eleven-outline'
entities:
light.hall_rail_entrance:
light.hall_entrance:
state: 'off'
light.kitchen_spot:
light.kitchen_spots:
state: 'on'
brightness: 10
color_temp_kelvin: 2000
Expand Down

0 comments on commit 50cf312

Please sign in to comment.