mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-12-03 03:21:47 +00:00
68 lines
1.9 KiB
YAML
Executable File
68 lines
1.9 KiB
YAML
Executable File
#-------------------------------------------
|
|
# @CCOSTAN
|
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
|
#-------------------------------------------
|
|
homeassistant:
|
|
customize_glob:
|
|
"sensor.*_sleep_hours":
|
|
unit_of_measurement: hours
|
|
icon: mdi:sleep
|
|
|
|
|
|
# customize:
|
|
# sensor.Carlo_sleep_hours:
|
|
# friendly_name: 'Carlo Slept last night'
|
|
# sensor.Stacey_sleep_hours:
|
|
# friendly_name: 'Stacey Slept last night'
|
|
|
|
#-------------------------------------------
|
|
sleepiq:
|
|
username: !secret sleepiq_username
|
|
password: !secret sleepiq_password
|
|
#-------------------------------------------
|
|
# sensor:
|
|
# - platform: history_stats
|
|
# name: Carlo_sleep_hours
|
|
# entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed
|
|
# state: 'on'
|
|
# type: time
|
|
# end: '{{ now() }}'
|
|
# duration:
|
|
# hours: 24
|
|
#
|
|
# - platform: history_stats
|
|
# name: Stacey_sleep_hours
|
|
# entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed
|
|
# state: 'on'
|
|
# type: time
|
|
# end: '{{ now() }}'
|
|
# duration:
|
|
# hours: 24
|
|
|
|
group:
|
|
bed:
|
|
entities:
|
|
- binary_sensor.sleepnumber_carlo_carlo_is_in_bed
|
|
- sensor.sleepnumber_carlo_carlo_sleepnumber
|
|
# - sensor.Carlo_sleep_hours
|
|
- binary_sensor.sleepnumber_carlo_stacey_is_in_bed
|
|
- sensor.sleepnumber_carlo_stacey_sleepnumber
|
|
# - sensor.Stacey_sleep_hours
|
|
|
|
automation:
|
|
- alias: "CARLO-HOMEPC - Lock PC and Sleep Monitors When Carlo Is in Bed"
|
|
id: 25c69640-4c38-46a2-82ae-5a32c3c6f1b4
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed
|
|
from: 'off'
|
|
to: 'on'
|
|
action:
|
|
- service: button.press
|
|
target:
|
|
entity_id: button.carlo_homepc_carlo_homepc_lock
|
|
- service: button.press
|
|
target:
|
|
entity_id: button.carlo_homepc_carlo_homepc_monitorsleep
|