mysmarthome/packages/tv.yaml

120 lines
3.4 KiB
YAML
Raw Normal View History

2019-04-17 22:46:06 +00:00
###############################################################################
# @author : Mahasri Kalavala
# @date : 04/15/2017
# @package : TV
# @description : Tv Automations
###############################################################################
2020-02-05 23:28:38 +00:00
binary_sensor:
- platform: mqtt
name: Sharp TV
state_topic: "/home/sharptv"
payload_on: "on"
payload_off: "off"
value_template: "{{ value }}"
2019-04-17 22:46:06 +00:00
###############################################################################
2020-02-05 23:28:38 +00:00
# _ _ _
# /\ | | | | (_)
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
2019-04-17 22:46:06 +00:00
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
2020-02-05 23:28:38 +00:00
#
2019-04-17 22:46:06 +00:00
###############################################################################
automation:
- alias: TV Status ON
2019-04-17 22:46:06 +00:00
initial_state: true
trigger:
platform: state
entity_id: remote.streaming_stick_4k
to: "on"
2019-04-17 22:46:06 +00:00
action:
- service: mqtt.publish
data_template:
topic: "/home/sharptv"
payload: "on"
retain: true
- alias: TV Status OFF
initial_state: true
trigger:
platform: state
entity_id: remote.streaming_stick_4k
to: "unavailable"
action:
- service: mqtt.publish
data_template:
topic: "/home/sharptv"
payload: "off"
retain: true
2020-02-05 23:28:38 +00:00
# Dim Family Room Lights When TV is Turned ON
2020-02-05 23:28:38 +00:00
###############################################################################
- alias: TV Dim Indoor Lights when TV is ON
2019-04-17 22:46:06 +00:00
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.sharp_tv
from: "off"
to: "on"
2019-04-17 22:46:06 +00:00
condition:
- condition: state
entity_id: sun.sun
state: "below_horizon"
2019-04-17 22:46:06 +00:00
- condition: state
entity_id: input_boolean.light_automations
2020-02-05 23:28:38 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
action:
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_1
brightness: 5
color_temp: 154
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_2
brightness: 5
color_temp: 154
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_3
brightness: 5
color_temp: 154
2020-02-05 23:28:38 +00:00
# Turn back Family room lights when TV is switched OFF
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: TV Turn Lights ON When TV is turned OFF
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.sharp_tv
2020-02-05 23:28:38 +00:00
to: "off"
2019-04-17 22:46:06 +00:00
condition:
- condition: state
entity_id: sun.sun
2020-02-05 23:28:38 +00:00
state: "below_horizon"
2019-04-17 22:46:06 +00:00
- condition: state
entity_id: input_boolean.light_automations
2020-02-05 23:28:38 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
action:
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_1
brightness: 255
color_temp: 154
transition: 5
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_2
brightness: 255
color_temp: 154
transition: 5
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_3
brightness: 255
color_temp: 154
2020-02-05 23:28:38 +00:00
transition: 5