I want to repeate a notification 3 times, with a 3 second delay. The trigger is a dorr button. I’m not good at programming, so I need help shown in my code (I got it from a video …). This code works for one time:
alias: Dörrklocka2
description: ""
triggers:
- domain: mqtt
device_id: 994d13e42d14f05fddf40af1b1f1cb47
type: action
subtype: single
trigger: device
conditions: []
actions:
- action: notify.mobile_app_moto_g35_5g
metadata: {}
data:
message: TTS
data:
tts_text: det ringer på dörren
media_stream: alarm_stream
mode: single
OK, I can understand that.
I assume you would want some kind of time delay between the 3 notifications?
Personally I would switch from a device trigger to a state trigger, then have 3 triggers.
triggers:
trigger: state
entity_id: domain.WhatEverItIs
to: "on"
trigger: state
entity_id: domain.WhatEverItIs
to: "on"
for:
minutes: 2
trigger: state
entity_id: domain.WhatEverItIs
to: "on"
for:
minutes: 10
You have to determine the entiry_id of the switch and replace the domain.WhatEverItIs placeholder I put in there, then replace the triggers: you have with this triggers: I wrote.
You can and probably should do all that in the UI editor though.