Last active
September 4, 2018 17:04
-
-
Save Snipercaine/9d56c723338ab627473838390e12bc6d to your computer and use it in GitHub Desktop.
IoT Adventures WandBox and Dragon Automations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### Automations required for the WandBox and the Dragon | |
- alias: Start Quest | |
trigger: | |
- platform: state | |
entity_id: switch.start_quest | |
to: 'on' | |
action: | |
- service: media_player.select_source | |
data: | |
entity_id: media_player.volumio_volumioboxlocal | |
source: Start Quest | |
- service: switch.turn_on | |
entity_id: switch.wandbox_lock | |
- service: light.turn_on | |
data: | |
brightness: 50 | |
rgb_color: [255, 0, 0] | |
entity_id: light.dragon_eyes | |
- service: mqtt.publish | |
data: | |
topic: cmnd/Wandbox/scheme | |
payload: 7 | |
- service: input_boolean.turn_off | |
- alias: Wand Fire Charge | |
trigger: | |
- platform: numeric_state | |
entity_id: sensor.crystal_temp | |
above: 80 | |
action: | |
- service: mqtt.publish | |
data: | |
topic: cmnd/Wandbox/color | |
payload: 'ff0000' #red | |
- service: switch.turn_off | |
data: | |
entity_id: switch.wandbox_lock | |
- service: media_player.select_source | |
data: | |
entity_id: media_player.volumio_volumioboxlocal | |
source: Fire Spell | |
- service: input_boolean.turn_on | |
data: | |
entity_id: input_boolean.wand_obtained, input_boolean.fire_spell | |
- alias: Wand Ice Charge | |
trigger: | |
- platform: numeric_state | |
entity_id: sensor.crystal_temp | |
below: 70 | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'cmnd/Wandbox/color' | |
payload: '0080ff' #blue | |
- service: switch.turn_off | |
entity_id: switch.wandbox_lock | |
- service: media_player.select_source | |
data: | |
entity_id: media_player.volumio_volumioboxlocal | |
source: Ice Spell | |
- service: input_boolean.turn_on | |
data: | |
entity_id: input_boolean.wand_obtained, input_boolean.ice_spell | |
- alias: Wand not Charged | |
trigger: | |
- platform: numeric_state | |
entity_id: sensor.crystal_temp | |
above: 71 | |
below: 79 | |
action: | |
- service: mqtt.publish | |
data: | |
topic: cmnd/Wandbox/scheme | |
payload: '7' | |
- service: switch.turn_on | |
entity_id: switch.wandbox_lock | |
- service: input_boolean.turn_off | |
data: | |
entity_id: input_boolean.ice_spell, input_boolean.fire_spell | |
- alias: Sneak Warning | |
trigger: | |
- platform: state | |
entity_id: binary_sensor.sleeping_dragon | |
from: 'off' | |
to: 'on' | |
condition: | |
condition: and | |
conditions: | |
- condition: state | |
entity_id: input_boolean.sneak_warning | |
state: 'off' | |
- condition: state | |
entity_id: input_boolean.wand_obtained | |
state: 'on' | |
action: | |
- service: light.turn_on | |
data: | |
brightness: 75 | |
rgb_color: [255, 255, 0] | |
entity_id: light.dragon_eyes | |
- service: media_player.select_source | |
data: | |
entity_id: media_player.volumio_volumioboxlocal | |
source: Sneak Warning | |
- service: input_boolean.turn_on | |
data: | |
entity_id: input_boolean.sneak_warning | |
- alias: Sneak Caught | |
trigger: | |
- platform: state | |
entity_id: binary_sensor.sleeping_dragon | |
to: 'on' | |
condition: | |
condition: and | |
conditions: | |
- condition: state | |
entity_id: input_boolean.sneak_warning | |
state: 'on' | |
- condition: state | |
entity_id: input_boolean.wand_obtained | |
state: 'on' | |
- condition: state | |
entity_id: input_boolean.sneak_caught | |
state: 'off' | |
action: | |
- service: light.turn_on | |
data: | |
brightness: 100 | |
rgb_color: [0, 255, 0] | |
entity_id: light.dragon_eyes | |
- service: media_player.select_source | |
data: | |
entity_id: media_player.volumio_volumioboxlocal | |
source: Sneak Caught | |
- service: input_boolean.turn_on | |
data: | |
entity_id: input_boolean.sneak_caught | |
- alias: Ice Attack | |
trigger: | |
- platform: state | |
entity_id: switch.ice_spell | |
from: 'off' | |
to: 'on' | |
condition: | |
condition: and | |
conditions: | |
- condition: state | |
entity_id: input_boolean.dragon_down | |
state: 'off' | |
- condition: numeric_state | |
entity_id: sensor.crystal_temp | |
below: 70 | |
action: | |
- service: mqtt.publish | |
data: | |
topic: cmnd/Dragon/scheme | |
payload: '4' | |
- service: media_player.select_source | |
data: | |
entity_id: media_player.volumio_volumioboxlocal | |
source: Dragon Down | |
- service: input_boolean.turn_on | |
data: | |
entity_id: input_boolean.dragon_down | |
- alias: Fire Attack | |
trigger: | |
- platform: state | |
entity_id: switch.fire_spell | |
from: 'off' | |
to: 'on' | |
condition: | |
condition: and | |
conditions: | |
- condition: state | |
entity_id: input_boolean.dragon_down | |
state: 'off' | |
- condition: numeric_state | |
entity_id: sensor.crystal_temp | |
above: 80 | |
action: | |
- service: mqtt.publish | |
data: | |
topic: cmnd/Dragon/scheme | |
payload: '4' | |
- service: media_player.select_source | |
data: | |
entity_id: media_player.volumio_volumioboxlocal | |
source: Dragon Down | |
- service: input_boolean.turn_on | |
data: | |
entity_id: input_boolean.dragon_down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment