Add confirmation alert

I have very important feature. I need switch, that will show confirmation alert, after turn on.

Create an automation-

trigger:
  - platform: state
    entity_id: switch.your_switch
    to: 'on'
action:
  - service: notify.mobile_app_your_name
    data:
      message: Hello World

How make it work on computer?

IOTLink can send notifications to PC:

  • Show Notification
    • Topic:{prefix}/{domainName}/{machineName}/commands/notify
    • Payload Type: JSON
    • Payload:
      • title: Notification Title (String - Len: +/- 27)
      • message: Message (String - Len: +/- 100)
      • iconUrl: (Optional) Custom icon URL (http or https) or file path (file:///). Must be accessible from the notified computer.
      • launchParams: (Optional) Behavior when the notification is clicked.
      • Home Assistant:
  my_computer_notify_url:
    alias: "My Computer - Notify Url"
    sequence:
      - service: mqtt.publish
        data:
          topic: "iotlink/workgroup/my-computer/commands/notify"
          payload: '{ "title": "My Notification Title", "message": "This is an example of notification using IOT Link", "iconUrl": "", "launchParams": "toast://open/https://iotlink.gitlab.io" }'
  
  my_computer_notify_app:
    alias: "My Computer - Notify App"
    sequence:
      - service: mqtt.publish
        data:
          topic: "iotlink/workgroup/my-computer/commands/notify"
          payload: '{ "title": "My Notification Title", "message": "This is an example of notification using IOT Link", "iconUrl": "", "launchParams": "toast://open/C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe#https://iotlink.gitlab.io" }'
1 Like