mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-21 10:57:43 +00:00
Move config out of subfolder
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Bedroom Opple action"
|
||||
state_topic: "z2m_deconz/opple_1"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:gesture-double-tap"
|
||||
value_template: "{{ value_json.action }}"
|
||||
- name: "Bedroom Opple battery"
|
||||
state_topic: "z2m_deconz/opple_1"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Bedroom Opple LQI"
|
||||
state_topic: "z2m_deconz/opple_1"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
automation:
|
||||
- alias: Bedroom · Opple
|
||||
use_blueprint:
|
||||
path: oppo_6_btn_switch.yaml
|
||||
input:
|
||||
opple_z2m_name: "z2m_deconz/opple_1"
|
||||
action_sensor: sensor.bedroom_opple_action
|
||||
|
||||
button_1_single:
|
||||
- service: light.turn_off
|
||||
entity_id: light.master_bedroom
|
||||
|
||||
button_2_single:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id:
|
||||
- light.master_bedroom
|
||||
brightness_pct: >-
|
||||
{% if not is_state('input_select.bedroom_mode', 'day') %} 40 {% else %} 100 {% endif %}
|
||||
|
||||
button_1_double:
|
||||
- service: light.turn_off
|
||||
entity_id: light.master_bedroom_main
|
||||
|
||||
button_2_double:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: light.master_bedroom_main
|
||||
brightness_pct: "{{ is_state('input_select.bedroom_mode', 'day') | iif(100, 40) }}"
|
||||
|
||||
button_1_triple:
|
||||
- service: light.turn_off
|
||||
entity_id:
|
||||
- light.bedside
|
||||
|
||||
button_2_triple:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id:
|
||||
- light.bedside
|
||||
brightness_pct: "{{ is_state('input_select.bedroom_mode', 'day') | iif(100, 40) }}"
|
||||
|
||||
button_3_single:
|
||||
- service: media_player.media_play_pause
|
||||
entity_id: media_player.master_bedroom
|
||||
|
||||
button_3_double:
|
||||
- service: script.sonos_join_tv
|
||||
|
||||
button_3_triple:
|
||||
- service: script.sonos_join_bedroom
|
||||
|
||||
button_3_release:
|
||||
- service: media_player.play_next
|
||||
entity_id: media_player.master_bedroom
|
||||
|
||||
button_4_single:
|
||||
- service: script.music_play
|
||||
|
||||
button_4_double:
|
||||
- service: script.music_play
|
||||
data:
|
||||
playlist: 'Starred'
|
||||
|
||||
button_4_triple:
|
||||
- service: script.music_play
|
||||
data:
|
||||
playlist: 'Retro'
|
||||
|
||||
button_5_single:
|
||||
- service: fan.turn_off
|
||||
entity_id: fan.philips_airpurifier
|
||||
|
||||
button_6_single:
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
@@ -0,0 +1,38 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Bedside switch battery"
|
||||
state_topic: "z2m_deconz/bedside_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Bedside switch LQI"
|
||||
state_topic: "z2m_deconz/bedside_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
automation:
|
||||
- alias: Bedroom · Bedside Switch
|
||||
use_blueprint:
|
||||
path: aqara_switch.yaml
|
||||
input:
|
||||
z2m_topic: "z2m_deconz/bedside_switch"
|
||||
click:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
entity_id: >-
|
||||
{% if is_state('input_select.bedroom_mode', 'day') %}
|
||||
light.master_bedroom_main
|
||||
{% else %}
|
||||
light.bedside
|
||||
{% endif %}
|
||||
brightness_pct: 100
|
||||
|
||||
double_click:
|
||||
- service: light.toggle
|
||||
entity_id: light.bedside
|
||||
|
||||
hold:
|
||||
- service: script.toggle_bedroom_mode
|
||||
@@ -0,0 +1,39 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Bedside second switch battery"
|
||||
state_topic: "z2m_deconz/bedroom_wall_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Bedside second switch LQI"
|
||||
state_topic: "z2m_deconz/bedroom_wall_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
|
||||
automation:
|
||||
- alias: Bedroom · Bedside Second Switch
|
||||
use_blueprint:
|
||||
path: aqara_switch.yaml
|
||||
input:
|
||||
z2m_topic: "z2m_deconz/bedroom_wall_switch"
|
||||
click:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
entity_id: >-
|
||||
{% if is_state('input_select.bedroom_mode', 'day') %}
|
||||
['light.master_bedroom_main', 'light.bedside']
|
||||
{% else %}
|
||||
light.bedside
|
||||
{% endif %}
|
||||
brightness_pct: 100
|
||||
|
||||
double_click:
|
||||
- service: media_player.media_play_pause
|
||||
entity_id: media_player.master_bedroom
|
||||
|
||||
hold:
|
||||
- service: script.toggle_bedroom_mode
|
||||
@@ -0,0 +1,385 @@
|
||||
fan:
|
||||
- platform: philips_airpurifier_http
|
||||
host: !secret philips_purifier_ip
|
||||
|
||||
input_boolean:
|
||||
purifier_turned_on_for_bad_air:
|
||||
name: Purifier enabled for bad air
|
||||
|
||||
input_select:
|
||||
purifier_preset_mode:
|
||||
name: mode
|
||||
icon: mdi:speedometer
|
||||
options:
|
||||
- auto
|
||||
- manual
|
||||
- sleep
|
||||
- allergen
|
||||
|
||||
purifier_speed:
|
||||
name: speed
|
||||
icon: mdi:speedometer
|
||||
options:
|
||||
- 0
|
||||
- 20
|
||||
- 40
|
||||
- 60
|
||||
- 80
|
||||
- 100
|
||||
|
||||
purifier_target_humidity:
|
||||
name: Target humidity
|
||||
icon: mdi:water-percent
|
||||
options:
|
||||
- 40
|
||||
- 50
|
||||
- 60
|
||||
|
||||
sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
purifier_air_quality:
|
||||
friendly_name: Air quality
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'pm25') }}"
|
||||
icon_template: mdi:weather-windy
|
||||
purifier_humidity:
|
||||
friendly_name: Humidity
|
||||
unit_of_measurement: "%"
|
||||
device_class: humidity
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'humidity') }}"
|
||||
icon_template: mdi:water
|
||||
purifier_temperature:
|
||||
friendly_name: Temperature
|
||||
unit_of_measurement: "°C"
|
||||
device_class: temperature
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'temperature') }}"
|
||||
icon_template: mdi:thermometer
|
||||
purifier_preset_mode:
|
||||
friendly_name: Preset Mode
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'preset_mode') }}"
|
||||
icon_template: >-
|
||||
{% set value = state_attr('fan.philips_airpurifier', 'preset_mode') %}
|
||||
{% if value == 'auto' %}
|
||||
{{ 'mdi:brightness-auto' }}
|
||||
{% elif value == 'manual' %}
|
||||
{{ 'mdi:speedometer-medium' }}
|
||||
{% elif value == 'sleep' %}
|
||||
{{ 'mdi:power-sleep' }}
|
||||
{% elif value == 'allergen' %}
|
||||
{{ 'mdi:allergy' }}
|
||||
{% endif %}
|
||||
purifier_speed:
|
||||
friendly_name: Speed
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'percentage') }}"
|
||||
purifier_allergens:
|
||||
friendly_name: Allergen index
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'allergen_index') }}"
|
||||
icon_template: mdi:weather-windy-variant
|
||||
purifier_function:
|
||||
friendly_name: Function
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'function') }}"
|
||||
icon_template: >-
|
||||
{{ is_state_attr('fan.philips_airpurifier', 'function', 'Purification') | iif('mdi:air-purifier', 'mdi:air-humidifier') }}
|
||||
purifier_pre_filter:
|
||||
friendly_name: Pre-filter
|
||||
unit_of_measurement: "Hrs"
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'pre_filter') }}"
|
||||
icon_template: mdi:air-filter
|
||||
purifier_wick_filter:
|
||||
friendly_name: Wick filter
|
||||
unit_of_measurement: "Hrs"
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'wick_filter') }}"
|
||||
icon_template: mdi:air-filter
|
||||
purifier_carbon_filter:
|
||||
friendly_name: Carbon filter
|
||||
unit_of_measurement: "Hrs"
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'carbon_filter') }}"
|
||||
icon_template: mdi:air-filter
|
||||
purifier_hepa_filter:
|
||||
friendly_name: HEPA filter
|
||||
unit_of_measurement: "Hrs"
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'hepa_filter')}}"
|
||||
icon_template: mdi:air-filter
|
||||
purifier_target_humidity:
|
||||
friendly_name: Target humidity
|
||||
unit_of_measurement: "%"
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'target_humidity') }}"
|
||||
icon_template: mdi:water-percent
|
||||
purifier_brightness:
|
||||
friendly_name: Brightness
|
||||
unit_of_measurement: "%"
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'light_brightness') }}"
|
||||
icon_template: mdi:brightness-6
|
||||
purifier_timer:
|
||||
friendly_name: Timer
|
||||
unit_of_measurement: "hrs"
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'timer') }}"
|
||||
icon_template: mdi:timer-outline
|
||||
purifier_time_remaining:
|
||||
friendly_name: Time remaining
|
||||
unit_of_measurement: "minutes"
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'timer_remaining_minutes') }}"
|
||||
icon_template: mdi:timer-outline
|
||||
|
||||
binary_sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
purifier_out_of_water:
|
||||
friendly_name: Water level
|
||||
device_class: problem
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'water_level') == 0 }}"
|
||||
purifier_child_lock:
|
||||
friendly_name: Child lock
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'child_lock') }}"
|
||||
purifier_display_light:
|
||||
friendly_name: Display light
|
||||
value_template: "{{ state_attr('fan.philips_airpurifier', 'display_light') }}"
|
||||
purifier_filter_needs_change:
|
||||
friendly_name: Filter needs change
|
||||
device_class: problem
|
||||
value_template: >
|
||||
|
||||
{{ is_state('sensor.purifier_pre_filter', '0')
|
||||
or is_state('sensor.purifier_wick_filter', '0')
|
||||
or is_state('sensor.purifier_carbon_filter', '0')
|
||||
or is_state('sensor.purifier_hepa_filter', '0') }}
|
||||
|
||||
|
||||
script:
|
||||
purifier_toggle_function:
|
||||
alias: Purifier · Toggle function
|
||||
sequence:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.purifier_out_of_water
|
||||
state: 'off'
|
||||
- service: philips_airpurifier_http.set_function
|
||||
entity_id: fan.philips_airpurifier
|
||||
data_template:
|
||||
function: >-
|
||||
{{ state_attr('fan.philips_airpurifier', 'function') == 'Purification' | iif('Purification & Humidification', 'Purification') }}
|
||||
|
||||
automation:
|
||||
- alias: Purifier · On start · Sync and update state
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: fan.philips_airpurifier
|
||||
to: 'on'
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
entity_id: input_select.purifier_target_humidity
|
||||
data_template:
|
||||
option: "{{ states('sensor.purifier_target_humidity') }}"
|
||||
- service: input_select.select_option
|
||||
entity_id: input_select.purifier_speed
|
||||
data_template:
|
||||
option: "{{ states('sensor.purifier_speed') }}"
|
||||
- condition: state
|
||||
entity_id: binary_sensor.purifier_out_of_water
|
||||
state: "on"
|
||||
- service: philips_airpurifier_http.set_function
|
||||
entity_id: fan.philips_airpurifier
|
||||
data:
|
||||
function: 'Purification'
|
||||
|
||||
- alias: Purifier · Change preset mode
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: input_select.purifier_preset_mode
|
||||
action:
|
||||
- service: fan.set_preset_mode
|
||||
entity_id: fan.philips_airpurifier
|
||||
data_template:
|
||||
preset_mode: "{{ states('input_select.purifier_preset_mode') }}"
|
||||
|
||||
- alias: Purifier · Sync preset mode
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: sensor.purifier_preset_mode
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
entity_id: input_select.purifier_preset_mode
|
||||
data_template:
|
||||
option: "{{ states('sensor.purifier_preset_mode') }}"
|
||||
|
||||
- alias: Purifier · Change speed
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: input_select.purifier_speed
|
||||
action:
|
||||
- service: fan.set_percentage
|
||||
entity_id: fan.philips_airpurifier
|
||||
data_template:
|
||||
percentage: "{{ states('input_select.purifier_speed') }}"
|
||||
|
||||
- alias: Purifier · Sync speed
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: sensor.purifier_speed
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
entity_id: input_select.purifier_speed
|
||||
data_template:
|
||||
option: "{{ states('sensor.purifier_speed') }}"
|
||||
|
||||
- alias: Purifier · Change humidity
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: input_select.purifier_target_humidity
|
||||
action:
|
||||
- service: philips_airpurifier_http.set_target_humidity
|
||||
entity_id: fan.philips_airpurifier
|
||||
data_template:
|
||||
humidity: >-
|
||||
{% set state = states('input_select.purifier_target_humidity') | int %}
|
||||
{% if state == 40 %}
|
||||
40
|
||||
{% elif state == 50 %}
|
||||
50
|
||||
{% else %}
|
||||
60
|
||||
{% endif %}
|
||||
|
||||
- alias: Purifier · Sync humidity
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: sensor.purifier_target_humidity
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
entity_id: input_select.purifier_target_humidity
|
||||
data_template:
|
||||
option: "{{ states('sensor.purifier_target_humidity') }}"
|
||||
|
||||
- alias: Purifier · Turn on · Low humidity
|
||||
trigger:
|
||||
platform: numeric_state
|
||||
entity_id: sensor.bedroom_weather_humidity
|
||||
below: 20
|
||||
condition:
|
||||
and:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.purifier_out_of_water
|
||||
state: "off"
|
||||
- condition: state
|
||||
entity_id: fan.philips_airpurifier
|
||||
state: "off"
|
||||
- condition: state
|
||||
entity_id: input_boolean.someone_home
|
||||
state: "on"
|
||||
action:
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: philips_airpurifier_http.set_function
|
||||
entity_id: fan.philips_airpurifier
|
||||
data:
|
||||
function: "Purification & Humidification"
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Hey, I'm turning on the purifier, because humidity is low and there is water in the tank"
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate module · "
|
||||
message: "Purifier On · Humidity is low"
|
||||
domain: fan
|
||||
|
||||
- alias: Purifier · Turn on · Low air quality
|
||||
trigger:
|
||||
platform: numeric_state
|
||||
entity_id: sensor.purifier_air_quality
|
||||
above: 30
|
||||
condition:
|
||||
and:
|
||||
- condition: state
|
||||
entity_id: input_boolean.someone_home
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: fan.philips_airpurifier
|
||||
state: "off"
|
||||
action:
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.purifier_turned_on_for_bad_air
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Hey, I'm turning on the purifier, because air quality is low"
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate Module · "
|
||||
message: "Purifier On · Air quality is low"
|
||||
domain: fan
|
||||
- condition: state
|
||||
entity_id: binary_sensor.purifier_out_of_water
|
||||
state: "off"
|
||||
- service: philips_airpurifier_http.set_function
|
||||
entity_id: fan.philips_airpurifier
|
||||
data:
|
||||
function: "Purification & Humidification"
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Also, switching to humidification, because there is water in the tank"
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate Module · "
|
||||
message: "Purifier Function · Switching to humidification - there is water in the tank"
|
||||
domain: fan
|
||||
|
||||
- alias: Purifier · Turn off · Okay humidity
|
||||
trigger:
|
||||
platform: numeric_state
|
||||
entity_id: sensor.bedroom_weather_humidity
|
||||
above: 55
|
||||
condition:
|
||||
and:
|
||||
- condition: state
|
||||
entity_id: fan.philips_airpurifier
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: sensor.purifier_function
|
||||
state: "Purification & Humidification"
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.purifier_air_quality
|
||||
below: 30
|
||||
action:
|
||||
- service: fan.turn_off
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Hey, I'm turning the purifier off, because humidity is okay"
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate Module · "
|
||||
message: "Purifier Off · Humidity is okay"
|
||||
domain: fan
|
||||
|
||||
- alias: Purifier · Turn off · Air quality returned to normal
|
||||
trigger:
|
||||
platform: numeric_state
|
||||
entity_id: sensor.purifier_air_quality
|
||||
below: 20
|
||||
condition:
|
||||
and:
|
||||
- condition: state
|
||||
entity_id: fan.philips_airpurifier
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: input_boolean.purifier_turned_on_for_bad_air
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: group.bedroom_windows
|
||||
state: "off"
|
||||
|
||||
action:
|
||||
- service: fan.turn_off
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.purifier_turned_on_for_bad_air
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate Module · "
|
||||
message: "Purifier Off · Air quality returned to normal"
|
||||
domain: fan
|
||||
|
||||
homeassistant:
|
||||
customize:
|
||||
fan.philips_airpurifier:
|
||||
friendly_name: Air purifier
|
||||
@@ -0,0 +1,46 @@
|
||||
switch:
|
||||
- platform: template
|
||||
switches:
|
||||
tapo_bedroom:
|
||||
friendly_name: "Bedroom Camera"
|
||||
value_template: "{{ is_state('switch.bedroom_privacy', 'off') }}"
|
||||
turn_on:
|
||||
service: script.tapo_bedroom_on
|
||||
turn_off:
|
||||
service: script.tapo_bedroom_off
|
||||
icon_template: >
|
||||
{%if is_state('switch.bedroom_privacy', 'off') %}
|
||||
mdi:video
|
||||
{% else %}
|
||||
mdi:video-off
|
||||
{% endif %}
|
||||
|
||||
script:
|
||||
tapo_bedroom_toggle:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: "{{ is_state('switch.bedroom_privacy', 'on') }}"
|
||||
sequence:
|
||||
- service: script.tapo_bedroom_off
|
||||
|
||||
default:
|
||||
- service: script.tapo_bedroom_on
|
||||
|
||||
tapo_bedroom_on:
|
||||
sequence:
|
||||
- service: switch.turn_off
|
||||
entity_id: switch.bedroom_privacy
|
||||
- service: select.select_option
|
||||
entity_id: select.bedroom_move_to_preset
|
||||
data:
|
||||
option: away
|
||||
|
||||
|
||||
tapo_bedroom_off:
|
||||
sequence:
|
||||
- service: select.select_option
|
||||
entity_id: select.bedroom_move_to_preset
|
||||
data:
|
||||
option: home
|
||||
- service: switch.turn_on
|
||||
entity_id: switch.bedroom_privacy
|
||||
Reference in New Issue
Block a user