TTS When trying to arm Alarm while sensor state is open


I was wondering if someone could help me with this one.
My goal is when i arm the alarm that a media player, could be google home for instance, lets you know if a sensor is open.

I already tried creating a simple automation where the trigger is the state of the alarm and the condition is then whether one sensor is open or not.
Maybe the easiest way here would be to create a group with all the sensors in it and then measure the condition on the group instead of having a looooong condition list with all sensors?

The other part is to get the TTS to let me know the name of the sensor or sensors, so I don’t have to either open the app to see which sensor it is.

One of the problems I came across was that it doesn’t look like my alarm state is changing status when trying to arm, while a sensor is open.
I use the Bwalarm (akasma74 edition), so I don’t know if that makes a difference.

Anyone having some good suggestions or maybe a working example already?

Thanks… :+1:

I think grouping the sensors together should work.
Now you have to find out which one is open, as you said.
To do that, you might want to take a look at:
Take a look at the second example there; inside of the for-loop you can query the sensor.
Example for data_template when calling tts.say:

message: >
  Warning! The following windows are open:
  {% for sensor in group.mysensors %}
    {% if is_state('sensor', 'open') %}
  {% endfor %}

Note: I haven’t tried this, maybe it won’t work :crazy_face:

1 Like

I’d say your question is exactly what the BWAlarm’s topic is for :wink:

it won’t change unless ignore_open_sensors is True (for more details read this).

Let’s discuss it in the right topic as it involves some things that are not obvious to anyone who does not use BWAlarm.

Hi AhmadK,

Thanks for your reply. I was afraid I was hijacking your thread and it wasn’t relevant for your component :slight_smile:.

I will close this one and ask it in there instead.