Hi:
I am trying to control my DMP security system using the Manual Alarm component and though the below automation physically works, I finding that when any of the conditions fail, the alarm_control_panel.arm_home status still shows that the alarm is armed. Any ideas how to fix? Or interface the switch.Arm to the arming / disarming provided by the Manual Alarm component?
id: armed_home
alias: ‘Armed Home’
trigger:
platform: state
entity_id: alarm_control_panel.HA_Alarm
to: armed_home
condition:
condition: and
conditions:
condition: state
entity_id: binary_sensor.FIRE
state: ‘off’
condition: state
entity_id: binary_sensor.THEFT
state: ‘off’
condition: state
entity_id: binary_sensor.ARM_STATUS
state: ‘off’
condition: state
entity_id: binary_sensor.READY
state: ‘on’
action:
service: switch.turn_on
entity_id: switch.Arm
Thanks
5310
I tried posting this in the Developers category but got no response.
Here’s the formatted code but there was never an issue with the execution. My problem is I don’t want the trigger to be allowed to be ‘arm_arm’ if the conditions are not met. Anyone have any ideas how to accomplish this? The trigger is from the ‘arm_home’ button being pressed on the alarm_control_panel.
id: armed_home
alias: ‘Armed Home’
trigger:
platform: state
entity_id: alarm_control_panel.HA_Alarm
to: armed_home
condition:
condition: and
conditions:
condition: state
entity_id: binary_sensor.FIRE
state: ‘off’
condition: state
entity_id: binary_sensor.THEFT
state: ‘off’
condition: state
entity_id: binary_sensor.ARM_STATUS
state: ‘off’
condition: state
entity_id: binary_sensor.READY
state: ‘on’
action:
service: switch.turn_on
entity_id: switch.Arm
Sorry to be a pain but you’re code is not formatted correctly so I can see if there are any indentation issues. Can you use the button as per my previous post please?
If you want help on this forum you’re going to have to get this right. It really does matter.
Copy and paste the code directly from your text editor into your reply. But before clicking Reply, you have to select the code so it’s all highlighted, then click the </> button. You should then see the code in the right half of the post editor (i.e., the preview pane) looks the same as it does in your text editor.
Hi:
I’ve done that twice and still don’t know why it kept resetting. There is nothing wrong with the code.
I trying to reset the trigger ‘entity_id’ ‘arm_home’ to ‘disarmed’ when the conditions aren’t valid or have it not change. So that alarm control panel correctly show the status of the alarm. If all the CONDITIONS are true then the switch.Arm should be turned ‘on’ and the alarm control panel show ‘arm_home’ else the switch does nothing and the alarm control panel should show or be changed to ‘disarmed’. I can’t find a method to accomplish this.
Thanks.
- id: armed_home
alias: 'Armed Home'
# hide_entity: True
# initial_state: 'on'
trigger:
platform: state
entity_id: alarm_control_panel.5310_Alarm
to: armed_home
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.FIRE
state: 'off'
- condition: state
entity_id: binary_sensor.THEFT
state: 'off'
- condition: state
entity_id: binary_sensor.STATUS
state: 'off'
- condition: state
entity_id: binary_sensor.READY
state: 'on'
action:
- service: switch.turn_on
entity_id: switch.Arm
Thanks for formatting. Good news, no indentation issues
so if I understand well, you want switch.Arm to turn on when all sensor conditions are met?
If so then you need to add each sensor also as a trigger:
If any of the sensor changes, check all conditions and if they’re all tue, only then turn switch.Arm on.
A couple of things:
condition logic is “AND” by default.
you have named your sensors in allcaps. recommendations are to leave all in lowercase, so you may need to adjust the below / your sensor declarations
- id: armed_home
alias: 'Armed Home'
# hide_entity: True
# initial_state: 'on'
trigger:
- platform: to
entity_id: binary_sensor.FIRE
to: 'off'
- platform: to
entity_id: binary_sensor.THEFT
to: 'off'
- platform: to
entity_id: binary_sensor.STATUS
to: 'off'
- platform: to
entity_id: binary_sensor.READY
to: 'on'
condition:
- condition: state
entity_id: binary_sensor.FIRE
state: 'off'
- condition: state
entity_id: binary_sensor.THEFT
state: 'off'
- condition: state
entity_id: binary_sensor.STATUS
state: 'off'
- condition: state
entity_id: binary_sensor.READY
state: 'on'
action:
- service: switch.turn_on
entity_id: switch.Arm
For the other bit, i.e. If any of the sensor changes, but not all conditions are met and you want to change the status to disarmed, you’ll need another automation doing the reverse of the above:
- id: disarmed_home
alias: 'Disarmed Home'
# hide_entity: True
# initial_state: 'on'
trigger:
- platform: to
entity_id: binary_sensor.FIRE
to: 'on'
- platform: to
entity_id: binary_sensor.THEFT
to: 'on'
- platform: to
entity_id: binary_sensor.STATUS
to: 'on'
- platform: to
entity_id: binary_sensor.READY
to: 'off'
condition:
condition: or
conditions:
- condition: state
entity_id: binary_sensor.FIRE
state: 'on'
- condition: state
entity_id: binary_sensor.THEFT
state: 'on'
- condition: state
entity_id: binary_sensor.STATUS
state: 'on'
- condition: state
entity_id: binary_sensor.READY
state: 'off'
action:
- service: switch.turn_off
entity_id: switch.Arm
Hi:
No your solution is not going to work, because the trigger is coming from alarm_control_panel of manual.py when someone is setting the alarm to ‘arm_home’. I don’t want the trigger to change to ‘arm_home’ if the conditions aren’t met. The ‘arm_home’ automation work correctly otherwise.
I thin you’re confusing the word trigger which in turns confuses me a trigger is what is going to trigger an automation, in other words, a state change, it’s not something that you change, i.e. you can’t programmatically change a trigger.
Now bear with me as I don’t yet have an alarm.
so if I understand well, you have a alarm_control_panel.5310_Alarm that you monitor for changes.
If someone tried to set the alarm, you first want to check a few security options before actually turning the alarm on.
If so, depending on your setup, you have 2 options:
when someone actively turns the alarm on, which fires the automation and checks the conditions. If they’re all true (all sensors are on the correct state), do nothing (the alarm has already been set), if at least one of the sensors is not in the correct state, disarm the alarm
when someone turns the alarm on, they don’t actually turn the alarm, they turn an option / “fake” switch that fires the automation, and if all sensors are on the correct state, then the automation arms the alarm, otherwise it does nothing (maybe turns that “fake” switch off)
Can you confirm which option this is?
Also like I said I don’t have an alarm, so can you confirm how you would programmatically arm or disarm your alarm?
you originally provided this but I want to confirm this action actually works
Hi:
Let’s start from the beginning:
I am trying to interface my DMP wired security alarm system to Home Assistant
I added a DMP 860 card to my alarm system which simply provides the following:
binary_sensor.fire -Whether a fire alarm is active. i.e DMP sensors found high heat or smoke.
binary_sensor.theft -Whether a burglary is in process. I.e. DMP found a open door or window or monition detected
binary_sensor_status - whether the system is armed or disarmed
binary_senor_ready - whether the system is able to be armed
switch.arm - wired to DMP zone where using a relay the switch.arm closes the zone which tells the system to be armed. But it won’t arm unless the binary_sensor. is 'on
I am using a the GPIO pins of a Raspberry Pi to provide the interface for the sensors to the 860 card outputs. and a programmed Zone to arm and disarm the DMP system. I wanted to use the Alarm panel from Home Assistant but HOW see that it doesn’t provide any way to handle that conditions need to be met before a switch can be turned on or off. No pre-processing logic.
Thanks. Starting to believe it not going to happen.
Thanks that helps. So I’ve gone through your original post again.
your automation looks right. If the alarm gets activated even though some sensors are in the correct status, it’s most likely that
the sensors are actually not in that status
the condition returns true because of some type
Can you make sure the name of your sensors in the condition is exactly the same as in your sensor definitions. This also means check the case. Ideally leave everything lowercase.
You can also check each sensor status separately in the dev-tool area:
Hi
I guess my wife in right, I don’t example things well.
The automation works. But when the conditions aren’t met the alarm control panel says its armed_home when the switch.Arm is off
How do I get the panel to say disarmed. Because nothing really happened
I believe I’ll need to exec a script to do what I want.
Thanks again.
5310
you mean "I guess my wife is right, I don’t explain things well.
Jokes aside, this is why I was asking about how your setup works. Basically if someone arms the alarm on HA (and so triggers the automation via entity_id: alarm_control_panel.5310_Alarmto: armed_home your automation does nothing back with the alarm if conditions aren’t met.
so you could have another automation that basically checks if any condition is not met (use an OR statement with the opposite state from above conditions) and the action will be
I know this is an old thread so sorry in advance. I also have a DMP system at home and have set up smtp email messaging in the DMP panel so when an alarm or anything happens I get an email. You will need a local email forwarding program for this as the DMP panel will not send emails directly. I’m using (postfix). For control of the system I have setup the DMP software on a local pc that is always on that I can VPN into if needed.
Dude_d
Thanks for your reply.
Tried having the panel send emails initially but found out the I didn’t have the updated panel version needed. Had already left the alarm service so there was no way to upgrade. Plus the upgrade can’t be accomplished over the air with my panel and required a service call $$$.
Have been using the DMP 860 plug-in board for a couple of years, first used a Blynk app I wrote and a Particle device. With the help of this form, I’ve since replaced the Particle device with a Sonoff SV programmed using Esphome. Which now interfaces to the alarm functions directly into Home Assistant using the manual alarm panel entity. How I get email and SMS notifications what are limited to active fire and burglar alarms. I can also arm and disarm from my phone via Home Assistant and receive a notification when these functions are done at the panel. I wasn’t crazy about using a Wi-FI device as the interface to the 860 and would have preferred a wired ethernet connection but never found one that would run Esphome. Basically, needed to be an Esp32 of Esp8266 based device with a single relay.
Let me know if anyone needs help interface a DMP alarm.
I know this is an old thread but I have a DMP system that I’ve been wondering about connecting to HA. Is there a preferred method now that it’s been a little while since you first implemented this?