Bed time what Hass Does for us my SMART house

This mite Help someone

When I Turn my TV off

#=======================================================================
# 
#=======================================================================
- id: Lava Lamp Off TV OFF
  alias: Lava Lamp Off TV OFF
  initial_state: true
  trigger:
  - entity_id: media_player.mckillentv
    for: '00:00:02'
    platform: state
    to: 'off'
  condition: []
  action:
  - data:
      entity_id: switch.lava_lamp
    service: switch.turn_off
  - data:
      entity_id: switch.gas_heater
    service: switch.turn_off
  - data:
      entity_id: climate.gas_heater
      operation_mode: 'off'
    service: climate.set_operation_mode
  - data:
      entity_id: climate.hall_heater
      operation_mode: 'off'
    service: climate.set_operation_mode

then i added a Dimmer to the Lounge
so i added a other automation:
note to one self join the automations

#=======================================================================
#  TV OFF COMING TO BED
#=======================================================================
- id: Dim Lounge Lights
  alias: Dim Lounge Lights
  initial_state: true
  trigger:
  - entity_id: media_player.mckillentv
    for: '00:00:02'
    platform: state
    to: 'off'
  condition:
  - condition: state
    entity_id: light.lounge
    state: 'on'
  action:
  - data:
      payload: '39'
      topic: cmnd/Lounge/Dimmer
    service: mqtt.publish

got me thinking

#=======================================================================
# Im in garage DONT turn on my side lamp  
#=======================================================================
- id: Bed TIme 01
  alias: Bed TIme
  initial_state: true
  trigger:
  - entity_id: sensor.lounge_dim
    platform: state
    to: '39'
  condition:
  - condition: state
    entity_id: light.garage
    state: 'off'
  action:
  - data:
      payload: HOLD
      topic: cmnd/MasterLight/POWER1
    service: mqtt.publish    

My bedroom light a a long press on it
so here the bedroom automations

#=======================================================================
- id: 'hold Master light Both On'
  alias: hold Master light Both On
  initial_state: true
  trigger:
  - entity_id: sensor.master_light
    platform: state
    to: 'HOLD'
  condition:
  - condition: state
    entity_id: binary_sensor.in_bed_her_side
    state: 'off'
  - condition: state
    entity_id: binary_sensor.in_bed_his_side
    state: 'off'
  action:
  - data:
      entity_id: light.her_side , light.his_side
    service: light.toggle
#=======================================================================
#
#=======================================================================
- id: 'hold Master light His Side'
  alias: hold Master light Both His Side
  initial_state: true
  trigger:
  - entity_id: sensor.master_light
    platform: state
    to: 'HOLD'
  condition:
  - condition: state
    entity_id: binary_sensor.in_bed_her_side
    state: 'on'
  - condition: state
    entity_id: binary_sensor.in_bed_his_side
    state: 'off'
  action:
  - data:
      entity_id: light.his_side
    service: light.toggle
#=======================================================================
#
#=======================================================================
- id: 'hold Master light Her Side'
  alias: hold Master light Both Her Side
  initial_state: true
  trigger:
  - entity_id: sensor.master_light
    platform: state
    to: 'HOLD'
  condition:
  - condition: state
    entity_id: binary_sensor.in_bed_her_side
    state: 'off'
  - condition: state
    entity_id: binary_sensor.in_bed_his_side
    state: 'on'
  action:
  - data:
      entity_id: light.her_side
    service: light.toggle
#=======================================================================

idea need to check id the garage closed when i dim the lights to 39 ( going to bed)

- id: Check Garage Door CLOSED
  alias: Check Garage Door CLOSED
  initial_state: true
  trigger:
  - entity_id: sensor.lounge_dim
    platform: state
    to: '39'
  condition:
  - condition: state
    entity_id: binary_sensor.garage_door
    state: 'on'
  action:
  - delay: '00:00:03'  
  - data:
      payload: 100
      topic: cmnd/Lounge/Dimmer
    service: mqtt.publish  

hope this turn the light on for someone.

1 Like

mite is spelled might*

1 Like