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,192 @@
|
||||
script:
|
||||
bulsatcom_power:
|
||||
alias: Bulsatcom · Power
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020250AF" }'
|
||||
|
||||
bulsatcom_up:
|
||||
alias: Bulsatcom · Up
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202D02F" }'
|
||||
|
||||
bulsatcom_down:
|
||||
alias: Bulsatcom · Down
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202708F" }'
|
||||
|
||||
bulsatcom_left:
|
||||
alias: Bulsatcom · Left
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020208F7" }'
|
||||
|
||||
bulsatcom_right:
|
||||
alias: Bulsatcom · Right
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x02028877" }'
|
||||
|
||||
bulsatcom_ok:
|
||||
alias: Bulsatcom · OK
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202B04F" }'
|
||||
|
||||
bulsatcom_1:
|
||||
alias: Bulsatcom · 1
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202807F" }'
|
||||
|
||||
bulsatcom_2:
|
||||
alias: Bulsatcom · 2
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020240BF" }'
|
||||
|
||||
bulsatcom_3:
|
||||
alias: Bulsatcom · 3
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202C03F" }'
|
||||
|
||||
bulsatcom_4:
|
||||
alias: Bulsatcom · 4
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020220DF" }'
|
||||
|
||||
bulsatcom_5:
|
||||
alias: Bulsatcom · 5
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202A05F" }'
|
||||
|
||||
bulsatcom_6:
|
||||
alias: Bulsatcom · 6
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202609F" }'
|
||||
|
||||
bulsatcom_7:
|
||||
alias: Bulsatcom · 7
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202E01F" }'
|
||||
|
||||
bulsatcom_8:
|
||||
alias: Bulsatcom · 8
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020210EF" }'
|
||||
|
||||
bulsatcom_9:
|
||||
alias: Bulsatcom · 9
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202906F" }'
|
||||
|
||||
bulsatcom_0:
|
||||
alias: Bulsatcom · 0
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020200FF" }'
|
||||
|
||||
bulsatcom_back:
|
||||
alias: Bulsatcom · Back
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202827D" }'
|
||||
|
||||
bulsatcom_info:
|
||||
alias: Bulsatcom · Info
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020242BD" }'
|
||||
|
||||
bulsatcom_menu:
|
||||
alias: Bulsatcom · Menu
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020202FD" }'
|
||||
|
||||
bulsatcom_volume_down:
|
||||
alias: Bulsatcom · Volume down
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020238C7" }'
|
||||
|
||||
bulsatcom_volume_up:
|
||||
alias: Bulsatcom · Volume up
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202A857" }'
|
||||
|
||||
bulsatcom_mute:
|
||||
alias: Bulsatcom · Mute
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020230CF" }'
|
||||
|
||||
bulsatcom_clock:
|
||||
alias: Bulsatcom · Clock
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x020248B7" }'
|
||||
|
||||
bulsatcom_epg:
|
||||
alias: Bulsatcom · EPG
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x0202E21D" }'
|
||||
@@ -0,0 +1,227 @@
|
||||
binary_sensor:
|
||||
- platform: ping
|
||||
host: !secret cadmium_ip
|
||||
name: cadmium_ping
|
||||
scan_interval: 10
|
||||
count: 2
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
cadmium:
|
||||
friendly_name: Cadmium
|
||||
value_template: >-
|
||||
{{ is_state("binary_sensor.cadmium_ping", "on") }}
|
||||
icon_template: >-
|
||||
{{ is_state("binary_sensor.cadmium_ping", "on") | iif(' mdi:desktop-mac-dashboard', 'mdi:desktop-mac') }}
|
||||
|
||||
#
|
||||
# ─── IOTLink ──────────────────────────────────────────────────────────────
|
||||
#
|
||||
|
||||
mqtt:
|
||||
# binary_sensor:
|
||||
# - name: "Cadmium playing"
|
||||
# availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
# payload_available: "ON"
|
||||
# payload_not_available: "OFF"
|
||||
# payload_on: "True"
|
||||
# payload_off: "False"
|
||||
# state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/media/playing"
|
||||
|
||||
sensor:
|
||||
- name: "Cadmium uptime"
|
||||
icon: mdi:clock-check
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/system/uptime"
|
||||
|
||||
- name: "Cadmium idle time"
|
||||
icon: mdi:clock-alert
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/system/idle-time"
|
||||
value_template: "{{ value | multiply(1/60) | round(0) }}"
|
||||
unit_of_measurement: "minutes"
|
||||
|
||||
# CPU
|
||||
- name: "Cadmium CPU usage"
|
||||
icon: mdi:chip
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/cpu/usage"
|
||||
unit_of_measurement: "%"
|
||||
|
||||
|
||||
# Memory
|
||||
- name: "Cadmium memory used"
|
||||
icon: mdi:memory
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/memory/used"
|
||||
unit_of_measurement: "MB"
|
||||
|
||||
- name: "Cadmium memory used percent"
|
||||
icon: mdi:memory
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/memory/usage"
|
||||
unit_of_measurement: "%"
|
||||
|
||||
- name: "Cadmium memory available"
|
||||
icon: mdi:memory
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/memory/available"
|
||||
unit_of_measurement: "MB"
|
||||
|
||||
- name: "Cadmium memory total"
|
||||
icon: mdi:memory
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/memory/total"
|
||||
unit_of_measurement: "MB"
|
||||
|
||||
# C Drive
|
||||
- name: "Cadmium C usage"
|
||||
icon: mdi:harddisk
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/hard-drive/c/drive-usage"
|
||||
unit_of_measurement: "%"
|
||||
|
||||
- name: "Cadmium C free space"
|
||||
icon: mdi:harddisk
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/hard-drive/c/total-free-space"
|
||||
unit_of_measurement: "GB"
|
||||
|
||||
- name: "Cadmium C used space"
|
||||
icon: mdi:harddisk
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/hard-drive/c/used-space"
|
||||
unit_of_measurement: "GB"
|
||||
|
||||
- name: "Cadmium C total space"
|
||||
icon: mdi:harddisk
|
||||
availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
payload_available: "ON"
|
||||
payload_not_available: "OFF"
|
||||
state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/hard-drive/c/total-size"
|
||||
unit_of_measurement: "GB"
|
||||
|
||||
|
||||
# # Media
|
||||
# - name: "Cadmium volume"
|
||||
# icon: mdi:volume-medium
|
||||
# availability_topic: "iotlink/workgroup/cadmium/lwt"
|
||||
# payload_available: "ON"
|
||||
# payload_not_available: "OFF"
|
||||
# state_topic: "iotlink/workgroup/cadmium/windows-monitor/stats/media/volume"
|
||||
|
||||
|
||||
switch:
|
||||
- platform: template
|
||||
switches:
|
||||
cadmium:
|
||||
friendly_name: Cadmium
|
||||
value_template: "{{ is_state('binary_sensor.cadmium', 'on') }}"
|
||||
turn_on:
|
||||
service: script.cadmium_start
|
||||
turn_off:
|
||||
service: script.cadmium_shutdown
|
||||
icon_template: >-
|
||||
{{ is_state('binary_sensor.cadmium', 'on') | iif('mdi:monitor-dashboard', 'mdi:monitor-off') }}
|
||||
|
||||
script:
|
||||
cadmium_start:
|
||||
alias: Cadmium · Start
|
||||
icon: mdi:play-box-outline
|
||||
sequence:
|
||||
- service: wake_on_lan.send_magic_packet
|
||||
data:
|
||||
mac: !secret cadmium_mac
|
||||
|
||||
cadmium_shutdown:
|
||||
alias: Cadmium · Shutdown
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "iotlink/workgroup/cadmium/commands/shutdown"
|
||||
payload: ""
|
||||
|
||||
cadmium_lock:
|
||||
alias: Cadmium · Lock
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "iotlink/workgroup/cadmium/commands/lock"
|
||||
payload: ""
|
||||
|
||||
# cadmium_vol_mute:
|
||||
# alias: Cadmium · Toggle Mute
|
||||
# sequence:
|
||||
# - service: mqtt.publish
|
||||
# data:
|
||||
# topic: "iotlink/workgroup/cadmium/commands/volume/mute"
|
||||
# payload: ""
|
||||
|
||||
# cadmium_set_volume:
|
||||
# alias: Cadmium · Set volume
|
||||
# sequence:
|
||||
# - service: mqtt.publish
|
||||
# data_template:
|
||||
# topic: "iotlink/workgroup/cadmium/commands/volume/set"
|
||||
# payload: "{{ volume | default(30) }}"
|
||||
|
||||
cadmium_displays_on:
|
||||
alias: Cadmium · Displays ON
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "iotlink/workgroup/cadmium/commands/displays/on"
|
||||
payload: ""
|
||||
|
||||
cadmium_displays_off:
|
||||
alias: Cadmium · Displays OFF
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "iotlink/workgroup/cadmium/commands/displays/off"
|
||||
payload: ""
|
||||
|
||||
cadmium_refresh:
|
||||
alias: Cadmium · Refresh
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "iotlink/workgroup/cadmium/refresh"
|
||||
payload: ""
|
||||
|
||||
automation:
|
||||
- alias: Cadmium · Turn off when idle
|
||||
trigger:
|
||||
platform: numeric_state
|
||||
entity_id: sensor.cadmium_idle_time
|
||||
above: 180
|
||||
action:
|
||||
- service: script.cadmium_shutdown
|
||||
- service: notify.telegram
|
||||
data:
|
||||
title: "🖥 *Devices · Cadmium*"
|
||||
message: "Hey, I'm turning Cadmium off. It's been idling for 3 hours."
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "🖥 Devices · "
|
||||
message: "Cadmium · Turning off - idling for 3 hours"
|
||||
@@ -0,0 +1,23 @@
|
||||
# https://www.home-assistant.io/integrations/amcrest
|
||||
# amcrest:
|
||||
# - host: !secret amcrest_ip
|
||||
# username: !secret amcrest_username
|
||||
# password: !secret amcrest_password
|
||||
# resolution: low
|
||||
# binary_sensors:
|
||||
# - online
|
||||
|
||||
binary_sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
camera_state:
|
||||
friendly_name: Security camera
|
||||
device_class: safety
|
||||
value_template: >-
|
||||
{{ is_state('camera.mercury_amcrest_1', 'streaming') or is_state('camera.mercury_amcrest_1', 'recording') }}
|
||||
icon_template: >-
|
||||
{% if is_state('camera.mercury_amcrest_1', 'streaming') or is_state('camera.mercury_amcrest_1', 'recording') %}
|
||||
mdi:video
|
||||
{% else %}
|
||||
mdi:video-off
|
||||
{% endif %}
|
||||
@@ -0,0 +1,6 @@
|
||||
sensor:
|
||||
- platform: command_line
|
||||
name: Cobalt CPU Temperature
|
||||
command: "cat /sys/class/thermal/thermal_zone4/temp"
|
||||
unit_of_measurement: "°C"
|
||||
value_template: '{{ value | multiply(0.001) | round(1) }}'
|
||||
@@ -0,0 +1,39 @@
|
||||
script:
|
||||
open_living_room_cover:
|
||||
sequence:
|
||||
- service: cover.set_cover_position
|
||||
entity_id: cover.living_room
|
||||
data:
|
||||
position: "{{ position | default(80) }}"
|
||||
|
||||
toggle_living_room_cover:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: "{{ is_state_attr('cover.living_room', 'current_position', 0) }}"
|
||||
sequence:
|
||||
- service: script.open_living_room_cover
|
||||
- conditions: >-
|
||||
{{ state_attr('cover.living_room', 'current_position') >= 80 }}
|
||||
sequence:
|
||||
- service: cover.close_cover
|
||||
entity_id: cover.living_room
|
||||
default:
|
||||
- service: cover.close_cover
|
||||
entity_id: cover.living_room
|
||||
|
||||
|
||||
automation:
|
||||
- alias: Cover · Living Room · Open at morning
|
||||
trigger:
|
||||
platform: time
|
||||
at: "10:00:00"
|
||||
action:
|
||||
- service: script.open_living_room_cover
|
||||
|
||||
- alias: Cover · Living Room · Close after sunset
|
||||
trigger:
|
||||
platform: sun
|
||||
event: sunset
|
||||
action:
|
||||
- service: cover.close_cover
|
||||
entity_id: cover.living_room
|
||||
@@ -0,0 +1,54 @@
|
||||
mqtt:
|
||||
switch:
|
||||
- name: "Desk Outlet"
|
||||
state_topic: "stat/outlet_1/RESULT"
|
||||
value_template: "{{ value_json.POWER }}"
|
||||
command_topic: "cmnd/outlet_1/POWER"
|
||||
payload_on: "ON"
|
||||
payload_off: "OFF"
|
||||
availability_topic: "tele/outlet_1/LWT"
|
||||
payload_available: "Online"
|
||||
payload_not_available: "Offline"
|
||||
qos: 1
|
||||
|
||||
sensor:
|
||||
- name: "Desk Outlet Energy today"
|
||||
state_topic: "tele/outlet_1/SENSOR"
|
||||
value_template: '{{ value_json.ENERGY.Today }}'
|
||||
device_class: power
|
||||
unit_of_measurement: "kWh"
|
||||
- name: "Desk Outlet Energy yesterday"
|
||||
state_topic: "tele/outlet_1/SENSOR"
|
||||
value_template: '{{ value_json.ENERGY.Yesterday }}'
|
||||
device_class: power
|
||||
unit_of_measurement: "kWh"
|
||||
- name: "Desk Outlet Energy total"
|
||||
state_topic: "tele/outlet_1/SENSOR"
|
||||
value_template: '{{ value_json.ENERGY.Total }}'
|
||||
device_class: power
|
||||
unit_of_measurement: "kWh"
|
||||
- name: "Desk Outlet Energy total start time"
|
||||
state_topic: "tele/outlet_1/SENSOR"
|
||||
value_template: '{{ value_json.ENERGY.TotalStartTime }}'
|
||||
- name: "Desk Outlet Power"
|
||||
state_topic: "tele/outlet_1/SENSOR"
|
||||
value_template: '{{ value_json.ENERGY.Power }}'
|
||||
device_class: power
|
||||
unit_of_measurement: "W"
|
||||
- name: "Desk Outlet Voltage"
|
||||
state_topic: "tele/outlet_1/SENSOR"
|
||||
value_template: '{{ value_json.ENERGY.Voltage }}'
|
||||
unit_of_measurement: "V"
|
||||
- name: "Desk Outlet Current"
|
||||
state_topic: "tele/outlet_1/SENSOR"
|
||||
value_template: '{{ value_json.ENERGY.Current }}'
|
||||
unit_of_measurement: "A"
|
||||
|
||||
- name: "Desk Outlet WiFi"
|
||||
state_topic: "tele/outlet_1/STATE"
|
||||
unit_of_measurement: "%"
|
||||
value_template: "{{value_json.Wifi.RSSI }}"
|
||||
availability_topic: "tele/outlet_1/LWT"
|
||||
payload_available: "Online"
|
||||
payload_not_available: "Offline"
|
||||
device_class: signal_strength
|
||||
@@ -0,0 +1,37 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Desk switch battery"
|
||||
state_topic: "z2m_deconz/desk_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Desk switch LQI"
|
||||
state_topic: "z2m_deconz/desk_switch"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
|
||||
automation:
|
||||
- alias: Living room · Desk switch
|
||||
use_blueprint:
|
||||
path: aqara_switch.yaml
|
||||
input:
|
||||
z2m_topic: "z2m_deconz/desk_switch"
|
||||
click:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
entity_id: light.living_room_main
|
||||
brightness_pct: "{{ is_state('sensor.house_mode', 'night') | iif(40, 100) }}"
|
||||
|
||||
double_click:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
entity_id: light.living_room_ambient
|
||||
brightness_pct: "{{ is_state('sensor.house_mode', 'night') | iif(40, 100) }}"
|
||||
|
||||
hold:
|
||||
- service: media_player.media_play_pause
|
||||
entity_id: media_player.living_room
|
||||
@@ -0,0 +1,72 @@
|
||||
script:
|
||||
hdmi_switch_1:
|
||||
alias: HDMI Swtich · Set to 1
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x807FD827" }'
|
||||
|
||||
hdmi_switch_2:
|
||||
alias: HDMI Swtich · Set to 2
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x807F7887" }'
|
||||
|
||||
hdmi_switch_3:
|
||||
alias: HDMI Swtich · Set to 3
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x807FB04F" }'
|
||||
|
||||
hdmi_switch_4:
|
||||
alias: HDMI Swtich · Set to 4
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x807F48B7" }'
|
||||
|
||||
hdmi_switch_5:
|
||||
alias: HDMI Swtich · Set to 5
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x807F08F7" }'
|
||||
|
||||
hdmi_switch_next:
|
||||
alias: HDMI Swtich · Next
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x807F30CF" }'
|
||||
|
||||
hdmi_switch_prev:
|
||||
alias: HDMI Swtich · Prev
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x807FA05F" }'
|
||||
|
||||
hdmi_switch_on:
|
||||
alias: HDMI Swtich · On
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x807F3AC5" }'
|
||||
|
||||
hdmi_switch_off:
|
||||
alias: HDMI Swtich · Off
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x807FF807" }'
|
||||
@@ -0,0 +1,64 @@
|
||||
script:
|
||||
old_hdmi_switch_1:
|
||||
alias: Old HDMI Swtich · Set to 1
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x01FE48B7" }'
|
||||
|
||||
old_hdmi_switch_2:
|
||||
alias: Old HDMI Swtich · Set to 2
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x01FE58A7" }'
|
||||
|
||||
old_hdmi_switch_3:
|
||||
alias: Old HDMI Swtich · Set to 3
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x01FE7887" }'
|
||||
|
||||
old_hdmi_switch_4:
|
||||
alias: Old HDMI Swtich · Set to 4
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x01FE807F" }'
|
||||
|
||||
old_hdmi_switch_next:
|
||||
alias: Old HDMI Swtich · Next
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x01FEC03F" }'
|
||||
|
||||
old_hdmi_switch_pip:
|
||||
alias: Old HDMI Swtich · PIP
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x01FE50AF" }'
|
||||
|
||||
old_hdmi_switch_sel:
|
||||
alias: Old HDMI Swtich · SEL
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x01FED827" }'
|
||||
|
||||
old_hdmi_switch_enter:
|
||||
alias: Old HDMI Swtich · Enter
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: cmnd/ir_blaster_1/IRSend
|
||||
payload: '{ "Protocol": "NEC", "Bits": 32, "Data": "0x01FEF807" }'
|
||||
@@ -0,0 +1,130 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Living room Opple action"
|
||||
state_topic: "z2m_deconz/opple_2"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:gesture-double-tap"
|
||||
value_template: "{{ value_json.action }}"
|
||||
- name: "Living room Opple battery"
|
||||
state_topic: "z2m_deconz/opple_2"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "%"
|
||||
device_class: "battery"
|
||||
value_template: "{{ value_json.battery }}"
|
||||
- name: "Living room Opple LQI"
|
||||
state_topic: "z2m_deconz/opple_2"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
automation:
|
||||
- alias: Living room · Opple
|
||||
use_blueprint:
|
||||
path: oppo_6_btn_switch.yaml
|
||||
input:
|
||||
opple_z2m_name: "z2m_deconz/opple_2"
|
||||
action_sensor: sensor.living_room_opple_action
|
||||
|
||||
button_1_single:
|
||||
- service: light.turn_off
|
||||
entity_id: light.living_room
|
||||
|
||||
button_2_single:
|
||||
- service: light.turn_on
|
||||
entity_id: light.living_room
|
||||
|
||||
button_1_double:
|
||||
- service: light.turn_off
|
||||
entity_id: light.living_room_main
|
||||
|
||||
button_2_double:
|
||||
- service: light.turn_on
|
||||
entity_id: light.living_room_main
|
||||
|
||||
button_1_triple:
|
||||
- service: light.turn_off
|
||||
entity_id: light.living_room_ambient
|
||||
|
||||
button_2_triple:
|
||||
- service: light.turn_on
|
||||
entity_id: light.living_room_ambient
|
||||
|
||||
button_2_release:
|
||||
- service: scene.turn_on
|
||||
entity_id: scene.living_room_ambient_neon
|
||||
|
||||
button_3_single:
|
||||
- service: media_player.media_play_pause
|
||||
entity_id: media_player.living_room
|
||||
|
||||
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.living_room
|
||||
|
||||
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: climate.turn_off
|
||||
entity_id: climate.toshiba_ac
|
||||
|
||||
button_5_double:
|
||||
- service: climate.set_temperature
|
||||
entity_id: climate.toshiba_ac
|
||||
data_template:
|
||||
temperature: "{{ state_attr('climate.toshiba_ac', 'temperature') | int -1}}"
|
||||
|
||||
button_6_single:
|
||||
- service: script.toshiba_ac_toggle
|
||||
|
||||
button_6_double:
|
||||
- service: climate.set_temperature
|
||||
entity_id: climate.toshiba_ac
|
||||
data_template:
|
||||
temperature: "{{ state_attr('climate.toshiba_ac', 'temperature') | int +1}}"
|
||||
|
||||
button_6_triple:
|
||||
- service: automation.turn_off
|
||||
entity_id: automation.tv_sonos_join_tv_on_google_cast
|
||||
|
||||
- service: media_player.joing
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
group_members:
|
||||
- media_player.kitchen
|
||||
- media_player.bathroom
|
||||
|
||||
# Music play, without the join
|
||||
- service: media_player.volume_set
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
volume_level: 0.2
|
||||
- service: media_player.shuffle_set
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
shuffle: true
|
||||
- service: media_player.select_source
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
source: "Evening Chill"
|
||||
|
||||
- delay: 00:01:00
|
||||
- service: automation.turn_on
|
||||
entity_id: automation.tv_sonos_join_tv_on_google_cast
|
||||
@@ -0,0 +1,211 @@
|
||||
input_boolean:
|
||||
ac_heating:
|
||||
name: AC Heating enabled
|
||||
icon: mdi:air-conditioner
|
||||
|
||||
# https://github.com/hristo-atanasov/Tasmota-IRHVAC/
|
||||
climate:
|
||||
- platform: tasmota_irhvac
|
||||
name: "TOSHIBA AC"
|
||||
command_topic: "cmnd/ir_blaster_1/irhvac"
|
||||
state_topic: "tele/ir_blaster_1/RESULT"
|
||||
temperature_sensor: sensor.multisensor_6_temperature
|
||||
protocol: "TOSHIBA_AC"
|
||||
max_temp: 30 # optional - default 32 int value
|
||||
min_temp: 17
|
||||
target_temp: 22 # optional - default 26 int value
|
||||
away_temp: 18 # optional - default 24 int value
|
||||
supported_modes:
|
||||
- "heat"
|
||||
- "cool"
|
||||
- "dry"
|
||||
- "auto"
|
||||
- "off"
|
||||
supported_fan_speeds:
|
||||
- "min"
|
||||
- "low"
|
||||
- "medium"
|
||||
- "high"
|
||||
- "max"
|
||||
- "auto"
|
||||
supported_swing_list:
|
||||
- "off"
|
||||
|
||||
input_number:
|
||||
toshiba_heat_temp:
|
||||
name: AC heat temp
|
||||
unit_of_measurement: "ºC"
|
||||
min: 24
|
||||
max: 30
|
||||
step: 1
|
||||
icon: mdi:air-conditioner
|
||||
toshiba_cool_temp:
|
||||
name: AC cool temp
|
||||
unit_of_measurement: "ºC"
|
||||
min: 17
|
||||
max: 25
|
||||
step: 1
|
||||
icon: mdi:air-conditioner
|
||||
toshiba_trigger_temp:
|
||||
name: AC cooling trigger temp
|
||||
unit_of_measurement: "ºC"
|
||||
min: 18
|
||||
max: 28
|
||||
step: 1
|
||||
icon: mdi:air-conditioner
|
||||
|
||||
template:
|
||||
- binary_sensor:
|
||||
- name: Toshiba AC Climate conditions met
|
||||
state: >
|
||||
{% set temp_matching = states('sensor.multisensor_6_temperature')|float >= states('input_number.toshiba_trigger_temp')|float %}
|
||||
{% set outside_temp_high = states('sensor.dark_sky_apparent_temperature')|float + 2 >= states('input_number.toshiba_trigger_temp')|float %}
|
||||
{% set someone_home = is_state('binary_sensor.someone_home', 'on') %}
|
||||
{% set ac_off = is_state('climate.toshiba_ac', 'off') %}
|
||||
|
||||
{{ temp_matching and outside_temp_high and someone_home and ac_off }}
|
||||
|
||||
- name: Toshiba AC conditions met
|
||||
icon: >
|
||||
{{ is_state('binary_sensor.toshiba_ac_conditions_met', 'on') | iif('mdi:home-thermometer', 'mdi:home-thermometer-outline') }}
|
||||
|
||||
state: >
|
||||
{% set temp_matching = states('sensor.multisensor_6_temperature')|float >= states('input_number.toshiba_trigger_temp')|float %}
|
||||
{% set outside_temp_high = states('sensor.dark_sky_apparent_temperature')|float + 2 >= states('input_number.toshiba_trigger_temp')|float %}
|
||||
{% set someone_home = is_state('binary_sensor.someone_home', 'on') %}
|
||||
{% set bedroom_ready = is_state('group.bedroom_windows', 'off') or is_state('binary_sensor.bedroom_door', 'off') %}
|
||||
{% set kitchen_ready = is_state('binary_sensor.kitchen_window', 'off') or is_state('binary_sensor.kitchen_door', 'off') %}
|
||||
{% set ac_off = is_state('climate.toshiba_ac', 'off') %}
|
||||
{{ temp_matching and outside_temp_high and someone_home and bedroom_ready and kitchen_ready and ac_off }}
|
||||
|
||||
script:
|
||||
toshiba_ac_toggle:
|
||||
sequence:
|
||||
- service: >-
|
||||
{% if is_state('climate.toshiba_ac', 'off') and is_state('input_boolean.ac_heating', 'off') %}
|
||||
script.toshiba_ac_on_cool
|
||||
{% elif is_state('climate.toshiba_ac', 'off') and is_state('input_boolean.ac_heating', 'on') %}
|
||||
script.toshiba_ac_on_heat
|
||||
{% else %}
|
||||
climate.turn_off
|
||||
{% endif %}
|
||||
data_template:
|
||||
entity_id: "{% if not is_state('climate.toshiba_ac', 'off') %}climate.toshiba_ac{%endif%}"
|
||||
|
||||
toshiba_ac_on_cool:
|
||||
sequence:
|
||||
- service: climate.turn_on
|
||||
entity_id: climate.toshiba_ac
|
||||
- delay: "00:00:01"
|
||||
- service: climate.set_hvac_mode
|
||||
entity_id: climate.toshiba_ac
|
||||
data:
|
||||
hvac_mode: "cool"
|
||||
- delay: "00:00:01"
|
||||
- service: climate.set_fan_mode
|
||||
entity_id: climate.toshiba_ac
|
||||
data:
|
||||
fan_mode: "auto"
|
||||
- delay: "00:00:01"
|
||||
- service: climate.set_temperature
|
||||
entity_id: climate.toshiba_ac
|
||||
data_template:
|
||||
temperature: "{{ states('input_number.toshiba_cool_temp') | default(19) }}"
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate Module · "
|
||||
message: "AC · Switching on · Cool"
|
||||
domain: climate
|
||||
|
||||
toshiba_ac_on_heat:
|
||||
sequence:
|
||||
- service: climate.turn_on
|
||||
entity_id: climate.toshiba_ac
|
||||
- delay: "00:00:01"
|
||||
- service: climate.set_hvac_mode
|
||||
entity_id: climate.toshiba_ac
|
||||
data:
|
||||
hvac_mode: "heat"
|
||||
- delay: "00:00:01"
|
||||
- service: climate.set_fan_mode
|
||||
entity_id: climate.toshiba_ac
|
||||
data:
|
||||
fan_mode: "auto"
|
||||
- delay: "00:00:01"
|
||||
- service: climate.set_temperature
|
||||
entity_id: climate.toshiba_ac
|
||||
data_template:
|
||||
temperature: "{{ states('input_number.toshiba_heat_temp') | default(26) }}"
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate Module · "
|
||||
message: "AC · Switching on · Heat"
|
||||
domain: climate
|
||||
|
||||
toshiba_ac_on_cool_if_hot:
|
||||
sequence:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.toshiba_ac_conditions_met
|
||||
state: 'on'
|
||||
- service: script.toshiba_ac_on_cool
|
||||
|
||||
automation:
|
||||
- alias: Climate · AC · Turn on if hot
|
||||
trigger:
|
||||
- platform: template
|
||||
value_template: "{{ states('sensor.multisensor_6_temperature')|float|default(0) > states('input_number.toshiba_trigger_temp')|float }}"
|
||||
for: "00:05:00"
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.living_room_right_window
|
||||
- group.bedroom_windows
|
||||
- binary_sensor.kitchen_window
|
||||
- binary_sensor.kitchen_door
|
||||
from: "on"
|
||||
to: "off"
|
||||
action:
|
||||
- service: script.toshiba_ac_on_cool_if_hot
|
||||
|
||||
- alias: Climate · AC · Turn off
|
||||
trigger:
|
||||
- platform: time
|
||||
at: "05:00:00"
|
||||
|
||||
# TODO: this below trigger works only for summer :)
|
||||
- platform: numeric_state
|
||||
entity_id: sensor.multisensor_6_temperature
|
||||
below: 23
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.living_room_right_window
|
||||
- group.bedroom_windows
|
||||
from: "off"
|
||||
to: "on"
|
||||
for: "00:01:00"
|
||||
condition:
|
||||
condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: climate.toshiba_ac
|
||||
state: 'off'
|
||||
action:
|
||||
- service: climate.turn_off
|
||||
entity_id: climate.toshiba_ac
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate Module · "
|
||||
message: "AC · Switching off"
|
||||
domain: climate
|
||||
|
||||
- alias: Climate · AC · Notify conditions met
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: binary_sensor.toshiba_ac_climate_conditions_met
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
action:
|
||||
- service: notify.telegram
|
||||
data:
|
||||
title: "💨 Climate Module · AC · Conditions met"
|
||||
message: "I would turn the AC on, but some windows or doors are open."
|
||||
@@ -0,0 +1,129 @@
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: "Trust remote action"
|
||||
state_topic: "z2m_deconz/trust_remote"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:gesture-double-tap"
|
||||
value_template: "{{ value_json.action }}"
|
||||
- name: "Trust remote group"
|
||||
state_topic: "z2m_deconz/trust_remote"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
icon: "mdi:lightbulb-group"
|
||||
value_template: "{{ value_json.action_group }}"
|
||||
- name: "Trust remote LQI"
|
||||
state_topic: "z2m_deconz/trust_remote"
|
||||
availability_topic: "z2m_deconz/bridge/state"
|
||||
unit_of_measurement: "lqi"
|
||||
device_class: "signal_strength"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
automation:
|
||||
- alias: Trust remote · Guest bedroom
|
||||
trigger:
|
||||
- platform: mqtt
|
||||
topic: z2m_deconz/trust_remote
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ trigger.payload_json.action == 'up-press' }}"
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.tradfri_large
|
||||
data_template:
|
||||
brightness_pct: "{{ is_state('input_select.guest_bedroom_mode', 'day') | iif(100, 10) }}"
|
||||
color_temp: "{{ states('input_number.guest_bedroom_light_temp') }}"
|
||||
- conditions: "{{ trigger.payload_json.action == 'down-press' }}"
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
entity_id: light.tradfri_large
|
||||
- conditions: "{{ trigger.payload_json.action == 'on' or trigger.payload_json.action == 'off' }}"
|
||||
sequence:
|
||||
- service: script.guest_bedroom_bedside_confirm
|
||||
- service: input_select.select_next
|
||||
entity_id: input_select.guest_bedroom_mode
|
||||
|
||||
- alias: Trust remote · Dimming
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.trust_remote_action
|
||||
to: "down-press"
|
||||
- platform: state
|
||||
entity_id: sensor.trust_remote_action
|
||||
to: "up-press"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: >-
|
||||
{% set groupId = states('sensor.trust_remote_group')[4] | int %}
|
||||
{% if groupId == 5 %}
|
||||
{% set entityId = 'light.living_room' %}
|
||||
{% elif groupId == 0 %}
|
||||
{% set entityId = 'light.living_room_main' %}
|
||||
{% elif groupId == 1 %}
|
||||
{% set entityId = 'light.pc' %}
|
||||
{% elif groupId == 2 %}
|
||||
{% set entityId = 'light.living_room_ambient' %}
|
||||
{% elif groupId == 3 %}
|
||||
{% set entityId = 'light.living_room_ambient_main' %}
|
||||
{% elif groupId == 4 %}
|
||||
{% set entityId = 'light.light_lohas_2' %}
|
||||
{% endif %}
|
||||
|
||||
{{ entityId }}
|
||||
|
||||
brightness_step_pct: >-
|
||||
{% if trigger.to_state.state == "up-press" %}
|
||||
20
|
||||
{% else %}
|
||||
-20
|
||||
{% endif %}
|
||||
|
||||
- alias: Trust remote · Turn on
|
||||
trigger:
|
||||
- platform: mqtt
|
||||
topic: z2m_deconz/trust_remote
|
||||
condition: "{{ trigger.payload_json.action == 'on' }}"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: >-
|
||||
{% set groupId = (trigger.payload_json.action_group % 10) %}
|
||||
{% if groupId == 5 %}
|
||||
light.living_room
|
||||
{% elif groupId == 0 %}
|
||||
light.living_room_main
|
||||
{% elif groupId == 1 %}
|
||||
light.pc
|
||||
{% elif groupId == 2 %}
|
||||
light.living_room_ambient
|
||||
{% elif groupId == 3 %}
|
||||
light.living_room_ambient_main
|
||||
{% elif groupId == 4 %}
|
||||
light.light_lohas_2
|
||||
{% endif %}
|
||||
brightness_pct: 100
|
||||
|
||||
- alias: Trust remote · Turn off
|
||||
trigger:
|
||||
- platform: mqtt
|
||||
topic: z2m_deconz/trust_remote
|
||||
condition: "{{ trigger.payload_json.action == 'off' }}"
|
||||
action:
|
||||
- service: light.turn_off
|
||||
data_template:
|
||||
entity_id: >-
|
||||
{% set groupId = (trigger.payload_json.action_group % 10) %}
|
||||
{% if groupId == 5 %}
|
||||
{% set entityId = 'light.living_room' %}
|
||||
{% elif groupId == 0 %}
|
||||
{% set entityId = 'light.living_room_main' %}
|
||||
{% elif groupId == 1 %}
|
||||
{% set entityId = 'light.pc' %}
|
||||
{% elif groupId == 2 %}
|
||||
{% set entityId = 'light.living_room_ambient' %}
|
||||
{% elif groupId == 3 %}
|
||||
{% set entityId = 'light.living_room_ambient_main' %}
|
||||
{% elif groupId == 4 %}
|
||||
{% set entityId = 'light.light_lohas_2' %}
|
||||
{% endif %}
|
||||
|
||||
{{ entityId }}
|
||||
@@ -0,0 +1,178 @@
|
||||
|
||||
script:
|
||||
tv_twitch:
|
||||
icon: mdi:twitch
|
||||
alias: TV · Start Twitch stream
|
||||
sequence:
|
||||
- service: script.tv_prepare_for_playback
|
||||
- service: androidtv.adb_command
|
||||
entity_id: media_player.nvidia_shield
|
||||
data_template:
|
||||
command: "am start -a android.intent.action.VIEW -d twitch://stream/{{ channel }}"
|
||||
|
||||
tv_bulsatcom_toggle:
|
||||
icon: mdi:remote-tv
|
||||
alias: TV · Bulsatcom toggle
|
||||
sequence:
|
||||
- service: script.bulsatcom_power
|
||||
- service: media_player.turn_on
|
||||
entity_id: media_player.living_room_tv
|
||||
- service: script.hdmi_switch_1
|
||||
- service: media_player.select_source
|
||||
entity_id: media_player.living_room_tv
|
||||
data:
|
||||
source: Switch
|
||||
|
||||
latest_pds:
|
||||
alias: Play the latest PDS
|
||||
sequence:
|
||||
- service: media_extractor.play_media
|
||||
entity_id: media_player.shield
|
||||
data_template:
|
||||
media_content_id: "{{ state_attr('sensor.philip_defranco', 'url') }}"
|
||||
media_content_type: video/youtube
|
||||
|
||||
tv_prepare_for_playback:
|
||||
alias: TV · Prepare for playback
|
||||
sequence:
|
||||
- service: media_player.unjoin
|
||||
entity_id: media_player.living_room
|
||||
- service: media_player.select_source
|
||||
entity_id: media_player.living_room
|
||||
data:
|
||||
source: TV
|
||||
- service: media_player.volume_set
|
||||
entity_id: media_player.living_room
|
||||
data_template:
|
||||
volume_level: "{{ volume_level | default(0.3) }}"
|
||||
- service: media_player.turn_on
|
||||
entity_id: media_player.nvidia_shield
|
||||
- service: media_player.select_source
|
||||
entity_id: media_player.living_room_tv
|
||||
data:
|
||||
source: Shield
|
||||
|
||||
shield_screensaver:
|
||||
sequence:
|
||||
- service: media_player.turn_on
|
||||
entity_id: media_player.nvidia_shield
|
||||
- service: androidtv.adb_command
|
||||
entity_id: media_player.nvidia_shield
|
||||
data:
|
||||
command: "adb shell am start -n \"com.android.systemui/.Somnambulator\""
|
||||
|
||||
automation:
|
||||
- alias: TV · Turn on
|
||||
trigger:
|
||||
- platform: webostv.turn_on
|
||||
entity_id: media_player.living_room_tv
|
||||
action:
|
||||
- service: wake_on_lan.send_magic_packet
|
||||
data:
|
||||
mac: 78:5D:C8:C9:DB:76
|
||||
- alias: TV · Join Beam to Sonos group when off
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: media_player.living_room_tv
|
||||
to: "off"
|
||||
condition:
|
||||
condition: state
|
||||
entity_id: sensor.house_mode
|
||||
state: "day"
|
||||
action:
|
||||
- service: script.sonos_join_bedroom
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "📺 Media Module · "
|
||||
message: "Sonos Group · TV off - joining Beam to Sonos Group"
|
||||
domain: media_player
|
||||
|
||||
- alias: TV · State · Sync on TV on
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: media_player.living_room_tv
|
||||
to: "on"
|
||||
action:
|
||||
- service: media_player.turn_on
|
||||
entity_id: media_player.nvidia_shield
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "📺 Media Module · "
|
||||
message: "Sync TV state · Turning Shield on - TV is on"
|
||||
domain: media_player
|
||||
|
||||
- alias: TV · State · Sync on TV off
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: media_player.living_room_tv
|
||||
to: "off"
|
||||
action:
|
||||
- service: media_player.turn_off
|
||||
entity_id: media_player.nvidia_shield
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "📺 Media Module · "
|
||||
message: "Sync TV state · Turning Shield off - TV is off"
|
||||
domain: media_player
|
||||
|
||||
- alias: TV · State · Sync on Shield on
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: media_player.nvidia_shield
|
||||
from: "off"
|
||||
action:
|
||||
- service: media_player.turn_on
|
||||
entity_id: media_player.living_room_tv
|
||||
- delay: "00:00:15"
|
||||
- service: media_player.select_source
|
||||
entity_id: media_player.living_room_tv
|
||||
data:
|
||||
source: "Shield"
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "📺 Media Module · "
|
||||
message: "Sync TV state · Turning TV on - Shield is on"
|
||||
domain: media_player
|
||||
|
||||
- alias: TV · State · Sync on Shield off
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: media_player.nvidia_shield
|
||||
to: "off"
|
||||
condition: "{{ is_state_attr('media_player.living_room_tv', 'source', 'Shield') }}"
|
||||
action:
|
||||
- service: media_player.turn_off
|
||||
entity_id: media_player.living_room_tv
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "📺 Media Module · "
|
||||
message: "Sync TV state · Turning TV off - Shield is off"
|
||||
domain: media_player
|
||||
|
||||
- alias: TV · Prepare for casting
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: media_player.nvidia_shield
|
||||
to: 'playing'
|
||||
condition: "{{ is_state_attr('media_player.nvidia_shield', 'source', 'Google Cast') }}"
|
||||
action:
|
||||
- service: script.sonos_join_tv
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "📺 Media Module · "
|
||||
message: "TV · Google Cast - Joining Sonoses"
|
||||
domain: media_player
|
||||
- delay: "00:00:10"
|
||||
- service: media_player.select_source
|
||||
entity_id: media_player.living_room_tv
|
||||
data:
|
||||
source: Shield
|
||||
|
||||
homeassistant:
|
||||
customize:
|
||||
media_player.living_room_tv:
|
||||
icon: mdi:television
|
||||
friendly_name: LG TV
|
||||
media_player.nvidia_shield:
|
||||
icon: mdi:set-top-box
|
||||
friendly_name: Nvidia Shield
|
||||
@@ -0,0 +1,99 @@
|
||||
automation:
|
||||
- alias: Wallmote · Living room · 1 · Tap · Toggle lights
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: zwave_js_value_notification
|
||||
event_data:
|
||||
node_id: 5
|
||||
value: "KeyPressed"
|
||||
property: "scene"
|
||||
property_key: "001"
|
||||
action:
|
||||
- service: light.toggle
|
||||
entity_id: light.living_room
|
||||
|
||||
- alias: Wallmote · Living room · 1 · Toggle · PC Light
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: zwave_js_value_notification
|
||||
event_data:
|
||||
node_id: 5
|
||||
value: "KeyReleased"
|
||||
property: "scene"
|
||||
property_key: "001"
|
||||
action:
|
||||
- service: light.toggle
|
||||
entity_id: light.pc
|
||||
|
||||
- alias: Wallmote · Living room · 2 · Tap · Toggle Music
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: zwave_js_value_notification
|
||||
event_data:
|
||||
node_id: 5
|
||||
value: "KeyPressed"
|
||||
property: "scene"
|
||||
property_key: "002"
|
||||
action:
|
||||
- service: media_player.media_play_pause
|
||||
entity_id: media_player.living_room
|
||||
|
||||
- alias: Wallmote · Living room · 2 · Hold · Play music
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: zwave_js_value_notification
|
||||
event_data:
|
||||
node_id: 5
|
||||
value: "KeyReleased"
|
||||
property: "scene"
|
||||
property_key: "002"
|
||||
action:
|
||||
- service: script.music_play
|
||||
|
||||
- alias: Wallmote · Living room · 3 · Tap · Toggle Main lights
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: zwave_js_value_notification
|
||||
event_data:
|
||||
node_id: 5
|
||||
value: "KeyPressed"
|
||||
property_key: "003"
|
||||
action:
|
||||
- service: light.toggle
|
||||
entity_id:
|
||||
- light.living_room_main
|
||||
- light.pc
|
||||
|
||||
- alias: Wallmote · Living room · 3 · Hold · Toggle Ambient lights
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: zwave_js_value_notification
|
||||
event_data:
|
||||
node_id: 5
|
||||
value: "KeyReleased"
|
||||
property_key: "003"
|
||||
action:
|
||||
- service: light.toggle
|
||||
entity_id: light.living_room_ambient
|
||||
|
||||
- alias: Wallmote · Living room · 4 · Tap · Toggle AC
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: zwave_js_value_notification
|
||||
event_data:
|
||||
node_id: 5
|
||||
value: "KeyPressed"
|
||||
property_key: "004"
|
||||
action:
|
||||
- service: script.toshiba_ac_toggle
|
||||
|
||||
- alias: Wallmote · Living room · 4 · Hold · Toggle Cover
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: zwave_js_value_notification
|
||||
event_data:
|
||||
node_id: 5
|
||||
value: "KeyReleased"
|
||||
property_key: "004"
|
||||
action:
|
||||
- service: script.toggle_living_room_cover
|
||||
Reference in New Issue
Block a user