Newbie trying to set up an server-side (ios) notification reporting the alarm state. How do I get the notification to include any of the 8-10 possible states without a series of nested IF’s? can I use “data” to just report the state value directly, and if so, how?
Also,is it possible to make this IOS-device agnostic, so that it will notify on the device that triggered the automation? how would I do that?
You can use templates to provide whatever data you want. For example {{ states('sensor.my_sensor') }} will output the state of that sensor. You can use templates in any field where the docs say they are supported. Here is more info on templates.
As far as notifying to the same device that triggered the automation: That doesn’t make sense to me without seeing what triggers you are using in your automation. If I’m correctly understanding what you want, you’ll have to create a mapping to link the entity that caused the trigger to the notify service to use.
@mekaneck yes - so if I have an automation that reports the state of a door, I want to be able to trigger it through carplay with phone 1, and have the report come back only to phone 1, but if I do it from phone 2, I want the notification only on phone 2.
I don’t think we’re using the same terms the same way.
An automation has predefined triggers that start the automation. If you have an automation that notifies you when the door is open, you probably have the state of the door as a trigger (when it changes from closed to open) and then you have an action that sends a notification to your phone.
This is why it is helpful if you just post the YAML of the automation so we know what you’re talking about.
This is also why I’m confused when you say you “trigger it with your phone”. It should be triggered by the state of your door. What trigger do you have that is related to your phone?
If you want some actions to run upon command, then that would be a script. A script is the same thing as an automation but without triggers. You have to manually call a script for it to run, whereas an automation has triggers and will run whenever any of those triggers are fired.