Hi, I was wondering if someone could help with the following. I’m trying to code some variable responses (yes/no) based an Assist query. For example, I have a doors & windows group, where I have set up a simple custom sentence and response to ask if any of the windows or doors are open. At the moment, it will just say ‘The doors and windows are [state]’ (open or closed), but I’d like to change it so it says either ‘Yes, the doors & windows are open’, or 'The doors & windows are closed.
Here’s the code I have so far. How could this be changed to give a variable response? I did try looking through the default sentences and responses on github, but couldn’t get anything to work.
custom_sentence:
# Example config/custom_sentences/en/device_status_and_operation.yaml
language: "en"
intents:
DoorsWindows:
data:
- sentences:
- "(Are|Is) [there] (any|any of the|any) (windows|doors) [and|or] [windows|doors] open"
response:
# Doors & Windows
intent_script:
DoorsWindows:
speech:
text: "The doors and windows are {{states('sensor.doors_windows_state')}}"