Skip to content
Timp103 edited this page May 17, 2020 · 54 revisions

Automation Examples

The examples are either in YAML, NodeRed or both. For those unfamiliar with YAML or NodeRed, please take a look at the Home Assistant Documentation for YAML and for NodeRed please checkout this great setup guide:

How to setup using NodeRed INCLUDING person_id:

Expand - NodeRed

Import the following JSON into your NodeRed installation.

[{"id":"9e1564a5.5dedf8","type":"tab","label":"Alexa Actionable Notifications","disabled":false,"info":""},{"id":"e8e465bd.9ca068","type":"server-events","z":"9e1564a5.5dedf8","name":"Alexa Actionable Notification","event_type":"alexa_actionable_notification","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":300,"y":520,"wires":[["94bde3c5.04f55","ecc5b99b.3a5f68"]]},{"id":"94bde3c5.04f55","type":"switch","z":"9e1564a5.5dedf8","name":"Event IDs","property":"payload.event.event_id","propertyType":"msg","rules":[{"t":"eq","v":"actionable_notification_event_name","vt":"str"},{"t":"eq","v":"actionable_notification_another_name","vt":"str"},{"t":"eq","v":"actionable_notification_event_cascade1","vt":"str"},{"t":"eq","v":"actionable_notification_event_cascade2","vt":"str"},{"t":"eq","v":"more","vt":"str"},{"t":"eq","v":"even more","vt":"str"}],"checkall":"true","repair":false,"outputs":6,"x":500,"y":520,"wires":[["356dec7b.3d22f4"],["9c426fc9.b7848"],["84f2708f.a6f4c"],["7e688503.69479c"],[],[]]},{"id":"9ce943c1.c50e2","type":"link in","z":"9e1564a5.5dedf8","name":"1","links":["356dec7b.3d22f4"],"x":1155,"y":400,"wires":[["cb54ff18.9ad77"]]},{"id":"356dec7b.3d22f4","type":"link out","z":"9e1564a5.5dedf8","name":"1","links":["9ce943c1.c50e2"],"x":615,"y":480,"wires":[]},{"id":"b33be835.caea98","type":"bigtimer","z":"9e1564a5.5dedf8","outtopic":"","outpayload1":"On","outpayload2":"","name":"Timer Based","comment":"","starttime":"720","endtime":"0","starttime2":0,"endtime2":0,"startoff":0,"endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"repeat":false,"atstart":false,"odd":false,"even":false,"x":610,"y":760,"wires":[["2498f346.78cf1c"],[],[]]},{"id":"2498f346.78cf1c","type":"api-call-service","z":"9e1564a5.5dedf8","name":"Ask","version":1,"debugenabled":false,"service_domain":"script","service":"activate_alexa_actionable_notification","entityId":"","data":"{\"text\":\"Place a Question Here\",\"event_id\":\"actionable_notification_another_name\",\"alexa_device\":\"media_player.which_alexa_device_you_want_to_talk\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":790,"y":760,"wires":[[]]},{"id":"5c734398.43b32c","type":"switch","z":"9e1564a5.5dedf8","name":"Responses","property":"payload.event.event_response","propertyType":"msg","rules":[{"t":"eq","v":"ResponseYes","vt":"str"},{"t":"eq","v":"ResponseNo","vt":"str"},{"t":"eq","v":"ResponseNone","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1310,"y":740,"wires":[["ec2fc0d3.b2ca3"],["72483f78.8d72e"],["fdb3b4c7.aa54d8"]]},{"id":"9c426fc9.b7848","type":"link out","z":"9e1564a5.5dedf8","name":"2","links":["7932990.3d38a68"],"x":715,"y":500,"wires":[]},{"id":"7932990.3d38a68","type":"link in","z":"9e1564a5.5dedf8","name":"2","links":["9c426fc9.b7848"],"x":895,"y":920,"wires":[["cc8e8bd.f4c8f78"]]},{"id":"718683d5.3d8a6c","type":"api-call-service","z":"9e1564a5.5dedf8","name":"Ask","version":1,"debugenabled":false,"service_domain":"script","service":"activate_alexa_actionable_notification","entityId":"","data":"{\"text\":\"Place a Question Here\",\"event_id\":\"actionable_notification_event_name\",\"alexa_device\":\"media_player.which_alexa_device_you_want_to_talk\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1390,"y":220,"wires":[[]]},{"id":"8f49fff3.29937","type":"server-state-changed","z":"9e1564a5.5dedf8","name":"What do you want to be the trigger","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":1040,"y":220,"wires":[["718683d5.3d8a6c"]]},{"id":"9a5742c9.962c1","type":"comment","z":"9e1564a5.5dedf8","name":"Copy these response portions as many times as needed, for as many automations that you want","info":"","x":1290,"y":340,"wires":[]},{"id":"3221144f.4d269c","type":"comment","z":"9e1564a5.5dedf8","name":"Change what happens for each response based on what you want to happen (call service, for example)","info":"","x":1570,"y":620,"wires":[]},{"id":"978f6e80.5b4a2","type":"comment","z":"9e1564a5.5dedf8","name":"Just add the specific EVENT_ID here that matches what is in the \"Ask\" node then pipe it out to its corrisponding \"Responses\" node","info":"","x":510,"y":420,"wires":[]},{"id":"c52e3ac1.3af5c8","type":"comment","z":"9e1564a5.5dedf8","name":"In the \"Ask\" node it gives directions on how to fill it out","info":"","x":1360,"y":140,"wires":[]},{"id":"9766338b.f7367","type":"comment","z":"9e1564a5.5dedf8","name":"Another example with a timer","info":"","x":700,"y":700,"wires":[]},{"id":"cc8e8bd.f4c8f78","type":"switch","z":"9e1564a5.5dedf8","name":"Person IDs","property":"payload.event.event_person_id","propertyType":"msg","rules":[{"t":"eq","v":"person1","vt":"str"},{"t":"eq","v":"person2","vt":"str"},{"t":"eq","v":"(leave blank for anyone)","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1010,"y":920,"wires":[["5c734398.43b32c"],["a83e6e44.0f395"],["f8e32a35.030a88"]]},{"id":"6eaab5ea.999b5c","type":"comment","z":"9e1564a5.5dedf8","name":"Place the unique Person IDs here","info":"","x":990,"y":860,"wires":[]},{"id":"4ffc8e5b.edc7b","type":"comment","z":"9e1564a5.5dedf8","name":"A blank Person ID will allow a response from anyone","info":"","x":990,"y":1000,"wires":[]},{"id":"ecc5b99b.3a5f68","type":"debug","z":"9e1564a5.5dedf8","name":"Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":250,"y":600,"wires":[]},{"id":"a078b806.e34408","type":"comment","z":"9e1564a5.5dedf8","name":"Debug node is only needed to get the exact Person ID","info":"","x":260,"y":660,"wires":[]},{"id":"259846d3.252a2a","type":"comment","z":"9e1564a5.5dedf8","name":"Once IDs are obtained for each person this node can be deleted","info":"","x":290,"y":700,"wires":[]},{"id":"ec2fc0d3.b2ca3","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when YES is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1560,"y":700,"wires":[[]]},{"id":"72483f78.8d72e","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when NO is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1560,"y":740,"wires":[[]]},{"id":"fdb3b4c7.aa54d8","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when NOTHING is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1580,"y":780,"wires":[[]]},{"id":"cb54ff18.9ad77","type":"switch","z":"9e1564a5.5dedf8","name":"Responses","property":"payload.event.event_response","propertyType":"msg","rules":[{"t":"eq","v":"ResponseYes","vt":"str"},{"t":"eq","v":"ResponseNo","vt":"str"},{"t":"eq","v":"ResponseNone","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1270,"y":400,"wires":[["d71555bd.f5f268"],["e4e577f1.64c108"],["6d00e6be.74b978"]]},{"id":"d71555bd.f5f268","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when YES is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1580,"y":380,"wires":[[]]},{"id":"e4e577f1.64c108","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when NO is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1580,"y":420,"wires":[[]]},{"id":"6d00e6be.74b978","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when NOTHING is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1600,"y":460,"wires":[[]]},{"id":"a83e6e44.0f395","type":"switch","z":"9e1564a5.5dedf8","name":"Responses","property":"payload.event.event_response","propertyType":"msg","rules":[{"t":"eq","v":"ResponseYes","vt":"str"},{"t":"eq","v":"ResponseNo","vt":"str"},{"t":"eq","v":"ResponseNone","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1310,"y":880,"wires":[["a67d39f.a80bcc8"],["96c36869.9e45c8"],["745dc5d2.7e02dc"]]},{"id":"a67d39f.a80bcc8","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when YES is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1670,"y":880,"wires":[[]]},{"id":"96c36869.9e45c8","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when NO is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1670,"y":920,"wires":[[]]},{"id":"745dc5d2.7e02dc","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when NOTHING is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1690,"y":960,"wires":[[]]},{"id":"f8e32a35.030a88","type":"switch","z":"9e1564a5.5dedf8","name":"Responses","property":"payload.event.event_response","propertyType":"msg","rules":[{"t":"eq","v":"ResponseYes","vt":"str"},{"t":"eq","v":"ResponseNo","vt":"str"},{"t":"eq","v":"ResponseNone","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1310,"y":1040,"wires":[["268e2b55.3a7774"],["b20548d9.1e47b8"],["74e41dc1.698424"]]},{"id":"268e2b55.3a7774","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when YES is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1670,"y":1040,"wires":[[]]},{"id":"b20548d9.1e47b8","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when NO is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1670,"y":1080,"wires":[[]]},{"id":"74e41dc1.698424","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when NOTHING is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1690,"y":1120,"wires":[[]]},{"id":"5306f336.bf6a0c","type":"comment","z":"9e1564a5.5dedf8","name":"Cascade example","info":"","x":410,"y":1120,"wires":[]},{"id":"3867528f.c91afe","type":"api-call-service","z":"9e1564a5.5dedf8","name":"Ask","version":1,"debugenabled":false,"service_domain":"script","service":"activate_alexa_actionable_notification","entityId":"","data":"{\"text\":\"Place a Question Here\",\"event_id\":\"actionable_notification_event_cascade1\",\"alexa_device\":\"media_player.which_alexa_device_you_want_to_talk_first\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":470,"y":1200,"wires":[[]]},{"id":"9ed85d5a.e0198","type":"server-state-changed","z":"9e1564a5.5dedf8","name":"What do you want to be the trigger","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":240,"y":1200,"wires":[["3867528f.c91afe"]]},{"id":"84f2708f.a6f4c","type":"link out","z":"9e1564a5.5dedf8","name":"3","links":["290374.08c3cc8c"],"x":735,"y":560,"wires":[]},{"id":"290374.08c3cc8c","type":"link in","z":"9e1564a5.5dedf8","name":"3","links":["84f2708f.a6f4c"],"x":155,"y":1320,"wires":[["e5146555.7ae938"]]},{"id":"e5146555.7ae938","type":"switch","z":"9e1564a5.5dedf8","name":"Responses","property":"payload.event.event_response","propertyType":"msg","rules":[{"t":"eq","v":"ResponseYes","vt":"str"},{"t":"eq","v":"ResponseNo","vt":"str"},{"t":"eq","v":"ResponseNone","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":265,"y":1320,"wires":[["e02da016.2857a"],["fab1c89.e77d338"],["40ef28de.8ff108"]]},{"id":"e02da016.2857a","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when YES is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":560,"y":1280,"wires":[[]]},{"id":"fab1c89.e77d338","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when NO is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":535,"y":1340,"wires":[[]]},{"id":"40ef28de.8ff108","type":"api-call-service","z":"9e1564a5.5dedf8","name":"Ask","version":1,"debugenabled":false,"service_domain":"script","service":"activate_alexa_actionable_notification","entityId":"","data":"{\"text\":\"Place a Question Here\",\"event_id\":\"actionable_notification_event_cascade2\",\"alexa_device\":\"media_player.which_alexa_device_you_want_to_talk_second\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":465,"y":1400,"wires":[[]]},{"id":"7e688503.69479c","type":"link out","z":"9e1564a5.5dedf8","name":"4","links":["d663e33.1e2892"],"x":620,"y":620,"wires":[]},{"id":"d663e33.1e2892","type":"link in","z":"9e1564a5.5dedf8","name":"4","links":["7e688503.69479c"],"x":155,"y":1520,"wires":[["4f173254.8cff8c"]]},{"id":"4f173254.8cff8c","type":"switch","z":"9e1564a5.5dedf8","name":"Responses","property":"payload.event.event_response","propertyType":"msg","rules":[{"t":"eq","v":"ResponseYes","vt":"str"},{"t":"eq","v":"ResponseNo","vt":"str"},{"t":"eq","v":"ResponseNone","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":270,"y":1520,"wires":[["caba0f26.8abb4"],["ba025071.18f6a"],["ed6d8299.bc3c6"]]},{"id":"caba0f26.8abb4","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when YES is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":555,"y":1460,"wires":[[]]},{"id":"ba025071.18f6a","type":"api-call-service","z":"9e1564a5.5dedf8","name":"What you want when NO is said","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":550,"y":1520,"wires":[[]]},{"id":"ee0c058b.6e7af8","type":"comment","z":"9e1564a5.5dedf8","name":"Cascade first device","info":"","x":250,"y":1260,"wires":[]},{"id":"c1135b56.fea028","type":"comment","z":"9e1564a5.5dedf8","name":"Cascade second device","info":"","x":260,"y":1460,"wires":[]},{"id":"c490bd25.93f4d","type":"comment","z":"9e1564a5.5dedf8","name":"This example loops between two devices forever until it gets a response from one of them","info":"","x":370,"y":1620,"wires":[]},{"id":"ed6d8299.bc3c6","type":"api-call-service","z":"9e1564a5.5dedf8","name":"Ask","version":1,"debugenabled":false,"service_domain":"script","service":"activate_alexa_actionable_notification","entityId":"","data":"{\"text\":\"Place a Question Here\",\"event_id\":\"actionable_notification_event_cascade1\",\"alexa_device\":\"media_player.which_alexa_device_you_want_to_talk_first\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":470,"y":1580,"wires":[[]]},{"id":"e37ba145.0eaaa","type":"comment","z":"9e1564a5.5dedf8","name":"Add more to extend loop","info":"","x":350,"y":1660,"wires":[]}]

Asking when no one is home if the lights should be turned off

Expand - YAML

automation:
  - alias: Turn off the lights if no one responds to at home question
    trigger:
      platform: state
      entity_id: group.people
      to: 'off'
      for:
        minutes: 5

    action:
      - service: script.activate_alexa_actionable_notification
        data_template:
          text: 'Is anyone home?'
          event_id: 'alexa_notification_anyone_home'
          alexa_device: 'media_player.living_room_echo'

  - alias: No response for alexa_notification_anyone_home question 
    trigger:
      platform: event
      event_type: alexa_actionable_notification
      event_data:
        event_id: alexa_notification_anyone_home
        event_response: ResponseNone

    action:
      - service: light.turn_off
        entity_id: group.all_lights

No motion in bedroom for 30 mins ask if the lights should be turned off

Expand - YAML

automation:
  - alias: Bedroom lights left on for 30 minutes no motion detected
    trigger:
      platform: state
      entity_id: binary_sensor.bedroom_motion
      to: 'off'
      for:
        minutes: 30

    condition:
      - condition: state
        entity_id: light.bedroom_lights
        state: 'on'

    action:
      - service: script.activate_alexa_actionable_notification
        data_template:
          text: 'Is anyone in the bedroom?'
          event_id: 'alexa_notification_bedroom_occupied'
          alexa_device: 'media_player.bedroom_echo'

  - alias: No response for alexa_notification_bedroom_occupied question 
    trigger:
      platform: event
      event_type: alexa_actionable_notification
      event_data:
        event_id: alexa_notification_bedroom_occupied
        event_response: ResponseNo
    action:
      - service: light.turn_off
        entity_id: group.all_lights

Checks if garage is open past a certain time and asks if you want to close it

Expand - NodeRed

What it looks like:

Import the following JSON into your NodeRed installation.

[{"id":"5a8efc97.c224f4","type":"api-call-service","z":"e8fe01ef.ddafd","name":"Alexa Actionable Notification - Garage Door OPEN","server":"9f230d2c.1e00d","version":1,"debugenabled":false,"service_domain":"script","service":"activate_alexa_actionable_notification","entityId":"","data":"{\"text\":\"Its getting late and the garage is still open. Would you like me to close it?\",\"event_id\":\"actionable_notification_garage\",\"alexa_device\":\"media_player.your_device\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":750,"y":1240,"wires":[[]]},{"id":"b81c86aa.cffd98","type":"api-current-state","z":"e8fe01ef.ddafd","name":"Is Garage Open?","server":"cf2d0f67.b78c5","version":1,"outputs":2,"halt_if":"open","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"cover.your_device","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":430,"y":1240,"wires":[["5a8efc97.c224f4"],[]]},{"id":"29219c0.fd93164","type":"inject","z":"e8fe01ef.ddafd","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"42 19 * * *","once":false,"onceDelay":0.1,"x":250,"y":1240,"wires":[["b81c86aa.cffd98"]]},{"id":"f2a004b3.987308","type":"api-call-service","z":"e8fe01ef.ddafd","name":"Garage Door - Close","server":"cf2d0f67.b78c5","version":1,"debugenabled":false,"service_domain":"cover","service":"close_cover","entityId":"cover.your_device","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1020,"y":1360,"wires":[[]]},{"id":"1cc5f7ea.344078","type":"switch","z":"e8fe01ef.ddafd","name":"Notification Response","property":"payload.event.event_response","propertyType":"msg","rules":[{"t":"eq","v":"ResponseYes","vt":"str"},{"t":"eq","v":"ResponseNo","vt":"str"},{"t":"eq","v":"ResponseNone","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":780,"y":1360,"wires":[["f2a004b3.987308"],[],["f2a004b3.987308"]]},{"id":"1b3e6beb.9ca094","type":"switch","z":"e8fe01ef.ddafd","name":"Notification Check","property":"payload.event.event_id","propertyType":"msg","rules":[{"t":"eq","v":"actionable_notification_garage","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":550,"y":1360,"wires":[["1cc5f7ea.344078"]]},{"id":"4778008.13c87","type":"server-events","z":"e8fe01ef.ddafd","name":"Alexa Notification Response","server":"cf2d0f67.b78c5","event_type":"alexa_actionable_notification","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":300,"y":1360,"wires":[["1b3e6beb.9ca094"]]},{"id":"9f230d2c.1e00d","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true},{"id":"cf2d0f67.b78c5","type":"server","z":"","name":"Home Assistant"}]
Expand - YAML

automation:
  - alias: Garage door opened at 9pm.
    trigger:
      platform: time
      # Military time format. This trigger will fire at 9pm
      at: "21:00:00"

    action:
      - service: script.activate_alexa_actionable_notification
        data_template:
          text: 'Its getting late and the garage is still open. Would you like me to close it?'
          event_id: 'actionable_notification_garage'
          alexa_device: 'media_player.living_room_echo'
   
  - alias: Yes response to alexa_cooling_set_sleep.
    trigger:
      platform: event
      event_type: alexa_actionable_notificaiton
      event_data:
        event_id: actionable_notification_garage
        event_response: ResponseYes

    action:
      - service: cover.close_cover
        entity_id: cover.garage_door

Sends to one device and if that device gets ResponceNone it sends to another device.

Expand - Node-RED

How to Import code into node red:

[{"id":"831685e2.386948","type":"api-call-service","z":"416e642e.953dec","name":"TV","server":"cf2d0f67.b78c5","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.sheldons_lights","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1050,"y":300,"wires":[[]]},{"id":"811cd95.ca88b28","type":"server-events","z":"416e642e.953dec","name":"Alexa Notification Response","server":"cf2d0f67.b78c5","event_type":"alexa_actionable_notification","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":380,"y":300,"wires":[["6335fbd1.02b644"]]},{"id":"6335fbd1.02b644","type":"switch","z":"416e642e.953dec","name":"Notification Check","property":"payload.event.event_id","propertyType":"msg","rules":[{"t":"eq","v":"actionable_notification_testshelly","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":300,"wires":[["4e38744a.eab68c"]]},{"id":"4e38744a.eab68c","type":"switch","z":"416e642e.953dec","name":"Notification Response","property":"payload.event.event_response","propertyType":"msg","rules":[{"t":"eq","v":"ResponseYes","vt":"str"},{"t":"eq","v":"ResponseNo","vt":"str"},{"t":"eq","v":"ResponseNone","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":860,"y":300,"wires":[["831685e2.386948"],[],["b94a2d10.9ee13"]]},{"id":"ddb415e1.9565b8","type":"api-current-state","z":"416e642e.953dec","name":"TV ON","server":"cf2d0f67.b78c5","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.your_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":470,"y":220,"wires":[["13ce4701.711069"],[]]},{"id":"13ce4701.711069","type":"api-call-service","z":"416e642e.953dec","name":"Alexa Actionable Notification - Light On","server":"9f230d2c.1e00d","version":1,"debugenabled":false,"service_domain":"script","service":"activate_alexa_actionable_notification","entityId":"","data":"{\"text\":\"This is a test. Would you like me to turn off the lights?\",\"event_id\":\"actionable_notification_testshelly\",\"alexa_device\":\"media_player.downstairs\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":790,"y":220,"wires":[[]]},{"id":"8bc7288b.ee7378","type":"inject","z":"416e642e.953dec","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"00 20 * * *","once":false,"onceDelay":0.1,"x":330,"y":220,"wires":[["ddb415e1.9565b8"]]},{"id":"4fa7f031.cebbf","type":"api-call-service","z":"416e642e.953dec","name":"Alexa Actionable Notification - Light On","server":"9f230d2c.1e00d","version":1,"debugenabled":false,"service_domain":"script","service":"activate_alexa_actionable_notification","entityId":"","data":"{\"text\":\"This is the second test on another device.\",\"event_id\":\"actionable_notification_testshelly2\",\"alexa_device\":\"media_player.conner_s_room\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1150,"y":360,"wires":[[]]},{"id":"4d23773d.1131d8","type":"api-call-service","z":"416e642e.953dec","name":"TV","server":"cf2d0f67.b78c5","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.your_lights","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1050,"y":460,"wires":[[]]},{"id":"7bf864f3.7dccec","type":"server-events","z":"416e642e.953dec","name":"Alexa Notification Response","server":"cf2d0f67.b78c5","event_type":"alexa_actionable_notification","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":380,"y":460,"wires":[["9d846357.21537"]]},{"id":"9d846357.21537","type":"switch","z":"416e642e.953dec","name":"Notification Check","property":"payload.event.event_id","propertyType":"msg","rules":[{"t":"eq","v":"actionable_notification_testshelly2","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":460,"wires":[["8cfb9ed5.82d93"]]},{"id":"8cfb9ed5.82d93","type":"switch","z":"416e642e.953dec","name":"Notification Response","property":"payload.event.event_response","propertyType":"msg","rules":[{"t":"eq","v":"ResponseYes","vt":"str"},{"t":"eq","v":"ResponseNo","vt":"str"},{"t":"eq","v":"ResponseNone","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":860,"y":460,"wires":[["4d23773d.1131d8"],[],[]]},{"id":"b94a2d10.9ee13","type":"api-current-state","z":"416e642e.953dec","name":"TV ON","server":"cf2d0f67.b78c5","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.your_light","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":890,"y":360,"wires":[["4fa7f031.cebbf"],[]]},{"id":"cf2d0f67.b78c5","type":"server","z":"","name":"Home Assistant"},{"id":"9f230d2c.1e00d","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true}]

Cooling temperature set too high when going to sleep

Expand - YAML

automation:
  - alias: Going to sleep and thermostat not set to 74.
    trigger:
      platform: state
      entity_id: group.people_sleep
      to: 'on'
      
    condition:
      - condition: template
        value_template: "{{ states.climate.thermostat.attributes.temperature > 74 }}"
      - condition: state
        entity_id: climate.building_36_technologies_unknown_type_0001_id_0001_mode
        state: 'cool'
        
    action:
      - service: script.activate_alexa_actionable_notification
        data_template:
          text: 'Would you like me to set the thermostat to 74?'
          event_id: 'alexa_cooling_set_sleep'
          alexa_device: 'media_player.bedroom_echo'

  - alias: Yes response to alexa_cooling_set_sleep.
    trigger:
      platform: event
      event_type: alexa_actionable_notificaiton
      event_data:
        event_id: alexa.cooling.sleep.set
        event_response: ResponseYes

    action:
      - service: climate.set_temperature
        entity_id: climate.thermostat
        data: 
          temperature: 74