First of all, thanks to all of you who help people here. I learned a lot by reading the other posts.
But I guess dealing with scripts and variables are way out of my league and reading the docs got me nowhere.
I’m trying to make Google Home say my door status (open/closed) when calling a script, but it returns as ON or OFF. Of course, it would be better if it returns OPEN or CLOSED (in my case, ABERTA ou FECHADA, same thing but in portuguese).
The base for the script I got from another topic here and I can’t remember who wrote it. And I tried to use the same I did when translating YR weather states (which I also got from here). But obviously everything went wrong because I had no clue what I was doing. Here’s what I did.
alias: 'Status da Porta da Cozinha'
sequence:
- delay:
seconds: 2
- service: tts.google_translate_say
entity_id:
- media_player.googlehome0916
data_template:
message: >-
A porta da cozinha está {{states('binary_sensor.door_window_sensor_158d000232ddf0')}}
{% if binary_sensor.door_window_sensor_158d000232ddf0 | state==off}Fechada
{% elif binary_sensor.door_window_sensor_158d000232ddf0 | state==on}Aberta
Can someone help me understand how to make this work? Thanks!