Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.31 KB | None | 0 0
  1. ######## CUBE #########
  2.   - alias: "Cube toggle lights"
  3.     initial_state: 'on'
  4.     trigger:
  5.       - platform: mqtt
  6.         topic: 'zigbee2mqtt/0x00158d0002565048'
  7.     condition:
  8.       - condition: template
  9.         value_template: "{{ 'shake' == trigger.payload_json.action }}"
  10.     action:
  11.       - service_template: >
  12.         {% if is_state('group.lights', 'on') %}
  13.            homeassistant.turn_off
  14.          {% else %}
  15.            homeassistant.turn_on
  16.          {% endif %}
  17.         entity_id: group.lights, light.kitchen_counter_light
  18.  
  19.   - alias: "Cube reset lights"
  20.     initial_state: 'on'
  21.     trigger:
  22.       - platform: mqtt
  23.         topic: 'zigbee2mqtt/0x00158d0002565048'
  24.     condition:
  25.       - condition: template
  26.         value_template: "{{ 'tap' == trigger.payload_json.action }}"
  27.     action:
  28.       - service: homeassistant.turn_on
  29.         entity_id: scene.reset_to_standard
  30.  
  31.   - alias: "Cube falls"
  32.     initial_state: 'on'
  33.     trigger:
  34.       - platform: mqtt
  35.         topic: 'zigbee2mqtt/0x00158d0002565048'
  36.     condition:
  37.       - condition: template
  38.         value_template: "{{ 'fall' == trigger.payload_json.action }}"
  39.     action:
  40.       - service: light.turn_off
  41.         data:
  42.           entity_id: light.kitchen_counter_light
  43.       - service: light.turn_on
  44.         data:
  45.           entity_id: light.ambilight
  46.           effect: "System Shutdown"
  47.       - service: light.turn_on
  48.         data:
  49.           entity_id:
  50.            - light.livingroom_couch
  51.             - light.table
  52.             - light.side_table_mood
  53.             - light.bedroom
  54.             - light.bedroom_table
  55.             - light.kitchen_main
  56.             - light.kitchen
  57.             - light.tv_table
  58.             - light.window_1
  59.             - light.window_2
  60.           color_name: "red"
  61.  
  62.   - alias: "Cube set movie lights"
  63.     initial_state: 'on'
  64.     trigger:
  65.       - platform: mqtt
  66.         topic: 'zigbee2mqtt/0x00158d0002565048'
  67.     condition:
  68.       - condition: state
  69.         entity_id: input_boolean.lights_on_kitchen_movie_scene
  70.         state: 'off'
  71.       - condition: template
  72.         value_template: "{{ is_state('sensor.0x00158d0002565048_action', 'flip90') and states.sensor['0x00158d0002565048_action'].attributes.to_side == 5 }}"
  73.     action:
  74.       - service: homeassistant.turn_on
  75.         entity_id: scene.movie_time
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement