What i want is the value of the pending time to use it in an automation. I tried to put the data in secrets.yaml but you can’t use !secret in a scripts.yaml. It will result in :
Invalid config for [script]: invalid template (TemplateSyntaxError: unexpected char ‘!’ at 21) for dictionary value @ data[‘script’][‘abort_pending_alarm’][‘sequence’][1][‘data_template’][‘message’]. Got ‘Alarm geannuleerd {{ !secret alarm_pending_sec }}’. (See /config/configuration.yaml, line 95).
Go to Developer Tools > States and look at the Attributes column for alarm_control_panel.home_alarm. If pending_time is shown there, you can use the state_attr function to get its value.
If it’s not shown, I don’t know of a way to get its value.
There are at least two custom_components (posted in this forum) designed to create and store variables. These variables are accessible to automations, scripts, etc. However, I suspect neither will be helpful because the pending_time option requires a value that is immediately available to the YAML interpreter on startup and can’t be based on a templated value.
I don’t think there’s a way of defining a value that is accessible to pending_timeand automations, scripts, etc.