SHARE
TWEET

ITS MESSY

a guest Jun 25th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ######################################################################################################
  2. #CONFIG
  3. ######################################################################################################
  4. switch:
  5.   - platform: mqtt
  6.     name: "Night Button"
  7.     command_topic: "cmnd/bedswitch/POWER"
  8.     state_topic: "stat/bedswitch/POWER"
  9.     qos: 1
  10.     payload_available: "Online"
  11.     payload_not_available: "Offline"
  12.     payload_on: "ON"
  13.     payload_off: "OFF"
  14.     retain: false
  15. ######################################################################################################
  16. #AUTOMATION
  17. ######################################################################################################
  18. - alias: 'NIGHT-Ocean'
  19.   trigger:
  20.   - platform: state
  21.     entity_id: input_boolean.sleepsound
  22.     from: 'off'
  23.     to: 'on'
  24.   action:
  25.   - service: light.turn_off
  26.     entity_id: group.bedroom_lights
  27.   - delay: 00:00:02
  28.   - service: input_boolean.turn_off
  29.     entity_id: input_boolean.sleepsound
  30.   - data:
  31.       entity_id: media_player.bedroom_speaker
  32.       media_content_id: https://www.gstatic.com/voice_delight/sounds/long/ocean.mp3
  33.       media_content_type: music
  34.     service: media_player.play_media
  35.   - data:
  36.       volume_level: 0.2
  37.     service: media_player.volume_set  
  38.   - delay: 00:45:00
  39.   - data:
  40.       entity_id: media_player.bedroom_speaker
  41.     service: media_player.media_stop
  42. ######################################################################################################
  43. # A WAY TO TURN THE TASMOTA BUTTON BACK off FROM THE ON STATE
  44. ######################################################################################################
  45. - alias: 'BED-BUTTON'
  46.   trigger:
  47.   - platform: state
  48.     entity_id: switch.night_button
  49.     from: 'off'
  50.     to: 'on'
  51.   action:
  52.   - service: automation.trigger
  53.     entity_id: automation.night_ocean
  54.   - service: switch.turn_off
  55.     entity_id: switch.night_button
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top