I’m looking at the alarm control panel to use in my Home Assistant.
But I don’t see a possiblity to trigger the alarm immediately without waiting for some delay time.
Let me explain:
For the sensor on the front door you want to have some delay, so that you can enter the house and disarm the alarm (with some hardware when you don’t use your phone). So for this option you have to specify the delay_time in the configuration.yaml.
But other sensors should trigger the alarm immediately without the delay time.
The service alarm_control_panel.alarm_trigger uses the delay time.
Is there a possibility to skip this delay when executing this service for some situations?
Adjust the waiting time of the trigger or use the ‘or’ in the condition with a helper . Whereby the sensor waits at the door and the rest of the automation continues.
I don’t want that. I want to have a delay time, so that when the front door is open, the alarm is in pending state. And for the other sitiuations I want to trigger the alarm directly, so no pending state.
Actually you could say it is the same as a panic function.
But I think it is at the moment not available. So maybe I need to create a feature request so that there could be created a new service like:
alarm_control_panel.alarm_trigger_skip_delay or that some data argument is added to specify that you want to skip the delay.
#==================================================================================================
# python_scripts/set_state.py
#==================================================================================================
#--------------------------------------------------------------------------------------------------
# Set the state or other attributes for the entity specified in the Automation Action
#--------------------------------------------------------------------------------------------------
inputEntity = data.get('entity_id')
if inputEntity is None:
logger.warning("===== entity_id is required if you want to set something.")
else:
inputStateObject = hass.states.get(inputEntity)
inputState = inputStateObject.state
inputAttributesObject = inputStateObject.attributes.copy()
for item in data:
newAttribute = data.get(item)
logger.debug("===== item = {0}; value = {1}".format(item,newAttribute))
if item == 'entity_id':
continue # already handled
elif item == 'state':
inputState = newAttribute
else:
inputAttributesObject[item] = newAttribute
hass.states.set(inputEntity, inputState, inputAttributesObject)
Through the UI, you will now have a python scripts option under call service where you can set the state of the alarm panel like below:
In the alarm panel yaml configuration you will want to fill in the following lines:
arming_time: 120 # time delay before the system is armed
delay_time: 120 # time delay before alarm is triggered
trigger_time: 31536000 # time alarm is triggered for
disarmed:
delay_time: 0 # time to disarm
armed_home:
arming_time: 0 # time to arm home
delay_time: 0 # arm home time until triggered
These are important as it means that the alarm panel can work as it is meant to but that you can also have automation that when triggered will change the alarm state instantly.
Arming time and delay time will want to be greater than 0 otherwise the system will never stay in those states which will cause issues. So think of it that these are the default values but that you are using scripts to skip to certain steps earlier when certain requirements are met.
For trigger time I have set this to a really high number so that the alarm stays on triggered for a very long time ( 1 year) rather than reverting back to disarmed. I have automations so that the siren turns off earlier though but this means that on the UI I can see that the alarm is still in a triggered state.