Hello,
I’m not very good at creating automations with UI or even Yaml…
What I’m trying to do is partially successful…
I have an Aqara Door and Window contactor connected in Zigbee by Z2M as well as a Sonos Move.
When I open a wardrobe door (close to the bedroom entrance door), the contactor switches from Close to OPEN → (a sound + TTS (via Chime TTS - https://nimroddolev.github.io/chime_tts/)) is played on a Sonos close to the bedroom. This draws attention to the fact that the bedroom door must not be opened, otherwise the wardrobe door just behind would be open and cause damage.
I managed to do this part thanks to the automation named “TestContact1DoorOpenElevenLabs”.
alias: TestContact1DoorOpenElevenLabs
description: ""
triggers:
- type: opened
device_id: 0fb1388c8688c733fb583468e7161379
entity_id: 2397886cc9dc5e7d9c2e5ca03c66ec72
domain: binary_sensor
trigger: device
for:
hours: 0
minutes: 0
seconds: 0
enabled: true
conditions: []
actions:
- repeat:
sequence:
- metadata: {}
data:
chime_path: bells_2
message: >-
Anthony, Florian. Attention, la porte de la garderobe est ouverte.
Donc s'il vous plait n'ouvrez surtout pas la porte de la chambre!
Merci pour votre patience...
cache: true
volume_level: 0.1
announce: true
target:
device_id: ffb9b7e8ad09c0506ad006dbe13e1719
enabled: true
action: chime_tts.say
until:
- type: is_not_open
condition: device
device_id: 0fb1388c8688c733fb583468e7161379
entity_id: 2397886cc9dc5e7d9c2e5ca03c66ec72
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 0
mode: single
the “Chime TTS” repeats itself until I change the state from OPEN to CLOSE of another automation called “TestContactDoorCloseElevenLab”, details of which follow.
alias: TestContactDoorCloseElevenLab
description: ""
triggers:
- type: not_opened
device_id: 0fb1388c8688c733fb583468e7161379
entity_id: 2397886cc9dc5e7d9c2e5ca03c66ec72
domain: binary_sensor
enabled: false
trigger: device
- entity_id:
- binary_sensor.contact1_contact
from: "on"
to: "off"
trigger: state
conditions: []
actions:
- metadata: {}
data:
announce: true
chime_path: bells_2
message: >-
Voilà les gars! La porte de la garderobe est fermée! Vous pouvez à
nouveau rentrer dans la chambre sans souci.
volume_level: 0.35
cache: true
target:
device_id: ffb9b7e8ad09c0506ad006dbe13e1719
enabled: true
action: chime_tts.say
mode: single
So what happens in this case:
If I open → TTS is played on the sonos ± 10 seconds of announcement and if I close for example the door → The announcement of the other TTS will be updated when the previous announcement is finished. It’s not as bad as all that, but I’d like to know if I could “kill” this one in the same way as a Tag…
Indeed, if I open and close after 7 seconds, I’ll have to wait until the end of the message for the other automation to start.
On the other hand, what I’m trying to do is choose whether or not I want the announcement to play according to some kind of door-opening manipulation.
I’d like a kind of consecutive opening like this:
From CLOSE to OPEN then CLOSE to OPEN in a time labs of 1 second for example that the TTS doesn’t play. And that it’s played ONLY if the delay from CLOSE to OPEN is greater than 2 sec.
So, let’s imagine it’s 4 a.m. and you want to open the door without waking the whole house. You choose to open → close → open in the 1 second time labs, for example, and there’s no announcement. On the other hand, if you simply open the door and do nothing else (From Close to Open with more than 2 sec → TTS.
I’ve tried everywhere to set the condition but I can’t do it and I end up sleeping too late because of all the fiddling and the next day I can’t get up lol…
Who could help me adapt the Yaml or tell me where to try to put the conditions or other…?
Thanks to those who will take the time to read me
PS: sorry for my laborious sentence constructions and also the repetition of the word “Door” lol
Also, this may be important for the “Tag” search here are the Chime TTS configuration parameters:
2 posts - 2 participants