I added the washing machine to my HA and I need help with the notifications part. I’m still in the stage of learning Yaml. I am trying to send 3 notifications in 15min intervals to alexa or until the door changes to open state. I really can’t figure out how to do it. With the code I have, it continues to send notifications even when the door is already open. If someone can help me I will be grateful.
Thanks
JR
action:
# iOS Devices
- service: notify.all_devices
data:
message: "The Washer Machine has finished and is ready to be emptied!"
title: "Washing Machine"
# Echos Devices
- repeat:
until:
- condition: state #Verificar en prueba si es necesario esta instruccion
entity_id: input_select.washing_machine_status
state: "Clean"
sequence:
- service: notify.alexa_media
data:
message: "{{ [
'La lavadora terminó el ciclo y esta lista para que saques la ropa',
'No pretendo interrumpir, pero, no olvides pasar la ropa a la secadora.',
'Aqui estoy para recordarles que la lavadora terminó, please saquen la ropa.',
'¿Te gusta que tu ropa huela apestosa? Porque eso es lo que esta sucediendo ahora mismo si no la sacas de la lavadora.',
'Espero no molestar, pero si dejas la ropa en la lavadora vas a terminar lavándola de nuevo'
] | random
}}"
target:
- media_player.jesmar_kitchen
- media_player.family_room
data:
type: tts
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.washer_door
from: 'off'
to: 'on'
timeout: "00:15:00"
I’m not sure what the input_select condition is for in the repeat util section so I’ve removed it so if you really need it you can put it back in.
but I think you can do this:
action:
# iOS Devices
- service: notify.all_devices
data:
message: "The Washer Machine has finished and is ready to be emptied!"
title: "Washing Machine"
# Echos Devices
- repeat:
until:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.washer_door
state: 'on'
- condition: template
value_template: "{{ repeat.index == 3 }}"
sequence:
- service: notify.alexa_media
data:
message: "{{ [
'La lavadora terminó el ciclo y esta lista para que saques la ropa',
'No pretendo interrumpir, pero, no olvides pasar la ropa a la secadora.',
'Aqui estoy para recordarles que la lavadora terminó, please saquen la ropa.',
'¿Te gusta que tu ropa huela apestosa? Porque eso es lo que esta sucediendo ahora mismo si no la sacas de la lavadora.',
'Espero no molestar, pero si dejas la ropa en la lavadora vas a terminar lavándola de nuevo'
] | random
}}"
target:
- media_player.jesmar_kitchen
- media_player.family_room
data:
type: tts
delay: "00:15:00"
The input_select is used so that the notification is only sent when the washing machine is already in the clean state and not in running or idle. I will try the code
Invalid config for [automation]: [service] is an invalid option for [automation]. Check: automation->action->1->repeat->sequence->0->service. (See ?, line ?).
# Washer Machine Notifications when is finished
- alias: Send alert when Washer Machine is finished
trigger:
- platform: state
entity_id: sensor.washing_machine_status
to: Clean
condition:
condition: and
conditions:
- condition: state
entity_id: sensor.washing_machine_status
state: Clean
- condition: time
before: "23:30:00"
after: "08:30:00"
action:
# iOS Devices
- service: notify.all_devices
data:
message: "The Washer Machine has finished and is ready to be emptied!"
title: "Washing Machine"
# Echos Devices
- repeat:
until:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.washer_door
state: 'on'
- condition: template
value_template: "{{ repeat.index == 3 }}"
sequence:
- service: notify.alexa_media
data:
message: "{{ [
'La lavadora terminó el ciclo y esta lista para que saques la ropa',
'No pretendo interrumpir, pero, no olvides pasar la ropa a la secadora.',
'Aqui estoy para recordarles que la lavadora terminó, please saquen la ropa.',
'¿Te gusta que tu ropa huela apestosa? Porque eso es lo que esta sucediendo ahora mismo si no la sacas de la lavadora.',
'Espero no molestar, pero si dejas la ropa en la lavadora vas a terminar lavándola de nuevo'
] | random
}}"
target:
- media_player.jesmar_kitchen
- media_player.family_room
data:
type: tts
delay: "00:15:00"
It still continues to send the notification after opening the door. When the status of “input_select.washing_machine_status” changes to Idle it is not supposed to send the notification but even in idle it continues to send it. Is it possible to put this condition in tthe repeat -while loop?
Thank you for taking the time to help me.
- alias: Send alert when Washer Machine is finished
trigger:
- platform: state
entity_id: switch.tasmota
from: 'off'
to: 'on'
condition:
condition: and
conditions:
- condition: time
before: "23:30:00"
after: "08:30:00"
- condition: state
entity_id: input_select.washing_machine_status
state: Clean
action:
# Echos Devices
- repeat:
while: "{{ is_state('binary_sensor.washer_door', 'off') and repeat.index <= 3 }}"
sequence:
- service: notify.alexa_media
data:
message: "{{ [
'La lavadora terminó el ciclo y esta lista para que saques la ropa',
'No pretendo interrumpir, pero, no olvides pasar la ropa a la secadora.',
'Aqui estoy para recordarles que la lavadora terminó, please saquen la ropa.',
'¿Te gusta que tu ropa huela apestosa? Porque eso es lo que esta sucediendo ahora mismo si no la sacas de la lavadora.',
'Espero no molestar, pero si dejas la ropa en la lavadora vas a terminar lavándola de nuevo'
] | random
}}"
target:
- media_player.jesmar_kitchen
- media_player.family_room
data:
type: tts
- delay: "00:15:00"
- alias: Send alert when Washer Machine is finished
trigger:
- platform: state
entity_id: switch.tasmota
from: 'off'
to: 'on'
condition:
condition: and
conditions:
- condition: time
before: "23:30:00"
after: "08:30:00"
- condition: state
entity_id: input_select.washing_machine_status
state: 'Clean'
action:
# Echos Devices
- repeat:
while: "{{ is_state('binary_sensor.washer_door', 'off') and repeat.index <= 3 and not is_state('input_select.washing_machine_status', 'Idle') }}"
sequence:
- service: notify.alexa_media
data:
message: "{{ [
'La lavadora terminó el ciclo y esta lista para que saques la ropa',
'No pretendo interrumpir, pero, no olvides pasar la ropa a la secadora.',
'Aqui estoy para recordarles que la lavadora terminó, please saquen la ropa.',
'¿Te gusta que tu ropa huela apestosa? Porque eso es lo que esta sucediendo ahora mismo si no la sacas de la lavadora.',
'Espero no molestar, pero si dejas la ropa en la lavadora vas a terminar lavándola de nuevo'
] | random
}}"
target:
- media_player.jesmar_kitchen
- media_player.family_room
data:
type: tts
- delay: "00:15:00"