Hi all,
I have a automation that runs a script when my camera detects motion and that sends it off through the Google Ai Generative integration and the results come back as generated content. That all works fine but I now ask in the prompt for it to respond with “Camera has detected motion however no obvious motion observed comparing snapshots” which works when trees or something set off the motion. Again this all works fine…
Now what I am trying to do though is stop the script sending the notification to one device and not the other if the response contains the above with a if/then/else in my script.
However my yaml seems to ignore the if part and still fires off the notification no matter what. Below is what I have, any ideas on why it is ignoring the “if statement?” I am guessing it’s not getting the generated content or the stop part isn’t right but I am no programmer! I am learning as I go, any tips pointing me in the right direction on what I am doing wrong? Thank you in advance!
LEGEND! Thank you!! I think I was more than a little confused on how expressions work! I gotta read some more! However while I don’t get a error running the script now, it still fires off the notification! Am I using the stop correctly? This is what I have now:
Again thank you! Using the debug trace / changed variables I could see the google response contains a space at the start and that’s why it wasn’t a exact match! All working now! Champion!