Hello,
First of all, great code!
I’m having difficulty to deactivate the perimeter mode. In the file “alarm.yaml” I put “perimeter_mode: False”, however this option in the frontend continues to appear. Is there anything else I need to do to disable this mode?
It appears it’s a bug and I have missed the check code. If you replace the code in your alam.html file at line 305 with the following template if statement:
I’ll need to try and simulate these locks on my setup. At the moment locks are not supported but I can’t see any reason why they can’t be
Just out of interest what are they?
The alarm ‘listens’ for the binary sensors to switch to an ‘On’ state. If the sensor is part of one of the groups for example immediate and the alarm is active it will then change the alarm status to ‘triggered’ or ‘warning’ depending on the condition.
Your automatons should take care of the rest for example monitoring alarm status to the trigger a siren.
The majority of my sensors are the Fibaro Multisensors and they work great.
@gazoscalvertos They are Schlage Connect locks tied to my Wink hub. I have three of then and they all show up fine under immediate alarms but just never trigger it. For the meantime I have created an automation for each door when using Home Mode (night) so we are alerted if any of then are opened. Useful since all motion sensors are disabled but at least we get piece of mind of doors and windows.
- alias: '[Alarm] Triggered at Night (front unlocked)'
trigger:
- platform: state
entity_id: lock.front_door
from: 'locked'
to: 'unlocked'
condition:
condition: state
entity_id: alarm_control_panel.house
state: 'armed_home'
action:
- service: wink.enable_siren
entity_id: wink.siren__strobe
data:
enabled: True
- service: notify.ios_iphone
data:
message: 'ALARM TRIGGERED!!! - Front Door!'
- service: light.turn_on
entity_id: light.bedroom
data:
brightness: 255
color_name: white
Thank you for this, it’s a nice alarm setup. I’m having a couple of issues though that I’m hoping I can sort out ;
Perimeter mode and away mode work as expected and if I don’t touch home mode then all works well, as soon as I activate home mode then from then on away mode seems to take on the same settings as home mode.
I have a motion sensor that returns “true” or “false” rather than “on” and “off”, this sensor won’t trigger the alarm.
I want to ignore an open sensor when arming the alarm, I have specified this sensor to be ignored in the config but when activating the alarm it still asks me to override.
If I can fix these issues then it would be perfect!
Tested the new true/flase code and seems to be working correctly, thanks.
Here is my alarm.yaml
platform: bwalarm
name: House
code: 0000
pending_time: 10 #Grace time in seconds to allow for exit and entry using Away mode
trigger_time: 600
alarm: automation.alarm_triggered
warning: automation.alarm_warning
clock: True #Optional - True enables a clock in the center of the status bar
perimeter_mode: True #Optional - True enables perimeter mode, this could be known as 'Day Mode' i.e. only arm the doors whilst there is someone using all floors
weather: False #Optional - Allows a weather summary to be displayed on the status bar. Dark Sky weather component must be enabled with the name sensor.dark_sky_summary
#### COLOURS ########### Use any HTML format
warning_colour: 'orange'
pending_colour: 'orange'
disarmed_colour: '#03A9F4'
armed_home_colour: 'black'
armed_away_colour: 'black'
triggered_colour: 'red'
############# SENSOR GROUPS ########################
# Sensors in this group tigger the alarm immediately
immediate:
- binary_sensor.door_window_sensor_158d0001de62ef
- sensor.camera_motion
- sensor.motion_hall
# Sensors in this group start the clock (pending_time) when tripped before the alarm is activated in 'Away' mode
delayed:
- binary_sensor.door_window_sensor_158d0001de73a7
- binary_sensor.motion_sensor_158d0001b1ce64
- sensor.motion_lounge
# Same as notathome but hopefully the title is more self explanatory. Can still use notathome for backwards compatibility
# Note sensors can exist in more than one group notice top_floor appears in two groups
homemodeignore:
- binary_sensor.motion_sensor_158d0001b1ce64
- sensor.camera_motion
- sensor.motion_lounge
- sensor.motion_hall
# Use this group to automatically override the warning message on open sensors when setting 'away' mode. (I use this as I have a motion sensor at the front door)
override:
- binary_sensor.motion_sensor_158d0001b1ce64
# This group is special and only effects 'perimeter mode'. If perimeter_mode is enabled then any sensor in this group will trigger the alarm immediately if arm perimeter is set. There is no delayed group for this mode (unless requested as a feature of course!)
perimeter:
- binary_sensor.door_window_sensor_158d0001de73a7
- binary_sensor.door_window_sensor_158d0001de62ef
@gazoscalvertos I have tested the new code and the lock implementation works great. I added it to the delayed group and it gave me a warning when opened and triggered the alarm perfectly.
I am seeing the same this error message repeated over and over in my log though:
Log Details (ERROR)
Wed Dec 27 2017 12:57:28 GMT-0500 (EST)
Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/alarm_control_panel/bwalarm.py”, line 186, in state_change_listener
if new.state.lower() == STATE_ON or new.state.lower() == STATE_TRUE or new.state.lower() == STATE_UNLOCKED or new.state_lower() == STATE_OPEN or new.state.lower() == STATE_DETECTED:
AttributeError: ‘State’ object has no attribute ‘state_lower’
Thanks @gazoscalvertos for your quick response. Fibaro sensors works perfect but the Aeotec sensors will not trigger alert even if it senses motion.
On the other hand I created a separate automation script which trigger notifications when state changes from “0” to “8” for Aeotec sensors. That works fine for Aeotec sensors.
Below is my setup on Alarm panel. The sensor marked as Study is Fibaro and it will trigger even if state says “off” when it senses motion. Others are Aeotec and it will not trigger alert even if it senses motion.
Hello Gazoscalvertos,
With the bug fix worked perfectly, thanks.
However I noticed another issue, after activating “home mode” and then disable it, if I activate the “away mode”, the sensors programmed as “homemodeignore” become inactive.
No problem, I also realized that the “shake” function does not work, nor does it allow the alarm to be activated if any sensor is open.
Now as a suggestion, the countdown circle should appear when any “Delayed Sensor” is activated so we have an idea of the remaining time until the alarm goes on.