keatontaylor / alexa-actions

A README and associated code to get actionable notifications setup for Alexa devices.
GNU General Public License v3.0
391 stars 186 forks source link

BluePrint #199

Closed foXaCe closed 11 months ago

foXaCe commented 1 year ago

Hello, does anyone have a blueprint for this integration I did a lot of automation. This may make it easier to create new ones.

leap-it commented 1 year ago

Hi i have written a Blueprint that works ok for me, i can share if you wish but dont have time to follow up ps I am no pro

Capture d'écran 2023-08-16 165431

foXaCe commented 1 year ago

bonjour,

oui je veux bien merci 😀

leap-it commented 1 year ago

Ok her goes i trigger all my automations with a toggle helper also in screenshot you see that when i say yes , then i turn the helper off and then back on again this prevents me from actually turning off my light and alexa will then restart the automation and ask me again at the given time.

blueprint:
  name: HA Ask Alexa 
  domain: automation

  input:
    AlexaResponceTrigger:
      name: Trigger action
      description: The Input Toggle event to listen to (turns to on)
      selector:
       entity:
          domain: input_boolean

    AlexaResponceTriggerTimer:
      name: (Optional) Wait time on respsonce toggle
      description: When the toggle is active how log before sending notification.
      default: 0
      selector:
        number:
          min: 1
          max: 3600
          unit_of_measurement: seconds
          step: 1
          mode: slider          

    after_time:
      name: (Optional) From time
      description: The time after which the automation is allowed to run
      selector:
        time: {}
      default: 0:00:00
    before_time:
      name: (Optional) To time
      description: The time before which the automation is allowed to run
      selector:
        time: {}
      default: 0:00:00

    AlexaStopTrigger:
      name: Automation Condition (Optional)
      description: This is an optional trigger that needs to be ON for the automation to work
      default:
      selector:
        entity:    

    blocker_entity:
      name: (OPTIONAL) Blocking entity
      description: If this entity's state is on, it will prevent the automation from running. E.g. sleepmode or away mode.
      default:
      selector:
        entity:

    AlexaEeventId:
      name: (Unique) Alexa envent ID
      description: alexa listens for this unique Id to follow this Routine
      default: actionable_notification_      

    AlexaEventMessage:
      name: AlexaEventMessage
      description: What does alexa ask you
      default: What must i do?     

    AlexaNotifier:
      name: AlexaNotifier
      description: Name of integration you prefer to use for notifications. E.g. Echo 
      selector:
        entity:
          domain: media_player  

    AlexaResponceActionYes:
      name: AlexaResponceActionYes
      default: 
      selector:
        action: 

    AlexaResponceActionIgnore:
      name: AlexaResponceActionIgnore
      default: 
      selector:
        action: 

trigger:
  - platform: state
    entity_id:
      - !input 'AlexaResponceTrigger'
    id: AlexaTriggerID
    for:
      seconds: !input 'AlexaResponceTriggerTimer'
    to: "on"
  - platform: event
    event_type: alexa_actionable_notification
    event_data:
      event_id: !input 'AlexaEeventId'
      event_response_type: ResponseYes
    id: AlexaYesID
  - platform: event
    event_type: alexa_actionable_notification
    event_data:
      event_id: !input 'AlexaEeventId'
      event_response_type: ResponseNone
    id: AlexaNoneID

  - platform: event
    event_type: alexa_actionable_notification
    event_data:
      event_id: !input 'AlexaEeventId'
      event_response_type: ResponseNo
    id: AlexaNoID    

condition:
  - condition: time
    after: !input 'after_time'
    before: !input 'before_time'
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
  - condition: state
    entity_id: !input 'AlexaStopTrigger'
    state: "on"

  - condition: state
    entity_id: !input 'blocker_entity'
    state: "off"

action:
  - choose:
      - conditions:
          - condition: trigger
            id: AlexaTriggerID
        sequence:
          - service: script.activate_alexa_actionable_notification
            data:
              text: !input 'AlexaEventMessage'
              event_id: !input 'AlexaEeventId'
              alexa_device: !input 'AlexaNotifier'
      - conditions:
          - condition: trigger
            id: AlexaYesID
        sequence: !input 'AlexaResponceActionYes'

      - conditions:
          - condition: trigger
            id: AlexaNoneID
        sequence: !input 'AlexaResponceActionIgnore'

      - conditions:
          - condition: trigger
            id: AlexaNoID
        sequence: !input 'AlexaResponceActionIgnore'

mode: single
leap-it commented 1 year ago

just create a file askalexa.yaml in the blue print folder and paste this code

foXaCe commented 1 year ago

thank you

i look this week end

DEADSEC-SECURITY commented 11 months ago

@foXaCe did you manage to check it out?

DEADSEC-SECURITY commented 11 months ago

@leap-it can we make this BP part of the alexa-actions repository?

leap-it commented 11 months ago

@leap-it can we make this BP part of the alexa-actions repository?

Not sure what you asking me ?

leap-it commented 11 months ago

Have been updating it a little. to the new code changes and added some extra features. Must say it is very basic. still learning, so please feel free to update, modify, paste, share ....

bp alexa

DEADSEC-SECURITY commented 11 months ago

@leap-it can we make this BP part of the alexa-actions repository?

Not sure what you asking me ?

Basically add this blueprint to our repository for future users to be able to import it and use it.

Feel free to open a PR and add that script/automation template to the home-assistant folder in the repo as alexa_actions_skill_script_template.yaml

DEADSEC-SECURITY commented 11 months ago

@leap-it we appreciate the contribution and we hope more people can make that template even better.

leap-it commented 11 months ago

@leap-it we appreciate the contribution and we hope more people can make that template even better.

Im glad you happy, i didn't at first share as personaly don't have much time to follow up on other user issues or questions.

you can place it on your PR no problem

DEADSEC-SECURITY commented 11 months ago

ok thank you, Ill add you credit on the PR description. Can you send me the latest version of the blueprint code? @leap-it

leap-it commented 11 months ago

be code alexa.txt please find the code attached

DEADSEC-SECURITY commented 11 months ago

great @leap-it thank you.