YET another take on an alarm system

@j.assuncao @tremebundo

These are the ones I’ve found there may be more but will pm if I come across any others:

House Alarm
Alarm Deactivated
Perimeter Mode
Home Mode
Alarm Mode
Leave Mode Activated
Trigger Mode Activated
Warning Mode Activated
Panel Locked Out
Open Sensors
All Sensors
Delayed Sensors
Immediate Sensors
Issues
Information

1 Like

I’ll send you the translation by PM when finished

1 Like

That would be good. It’s getting confusing. :slight_smile:

Hi @gazoscalvertos,

Summary

I still have the same problem. Can’t load the Alarm panel at all. :frowning:

Updated the files and can see the Alarm but don’t see any sensors.

Thanks

Do you get any errors at all? Have you changed you alarm.yaml to follow the new state specific rules?

Ie you sensors now must come under each state heading

Mon Mar 26 2018 10:44:37 GMT+1100 (AEDT)

Error executing service <ServiceCall alarm_control_panel.alarm_disarm: code=>

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/core.py", line 1010, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/src/app/homeassistant/components/alarm_control_panel/__init__.py", line 140, in async_alarm_service_handler
    yield from getattr(alarm, method)(code)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 327, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 243, in result
    raise self._exception
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/alarm_control_panel/bwalarm.py", line 463, in alarm_disarm
    if not self._validate_code(code, STATE_ALARM_DISARMED):
  File "/config/custom_components/alarm_control_panel/bwalarm.py", line 604, in _validate_code
    check = self._code is None or code == self._code or code in self._codes
AttributeError: 'BWAlarm' object has no attribute '_codes'

Could you go to line 604 in your bwalarm.py and change the line to:

check = self._code is None or code == self._code# or code in self._codes

basically comment out the last section? I think I know whats up with it, I was prepping the code for mutli user codes and that has sneaked into the latest release

Odd that I didnt get the same error though. I wonder if your alarm code is validating. Do you have your alarm code in single quotes in alarm.yaml?

I have just pushed a fix to bwalarm in the repo hopefully it resolves your issue

HI @gazoscalvertos

Yes, Alarm code is in single quotes. I have updated the bwalarm.py as you mentioned. Looks like it’s working as in I can disarm but still can’t see my sensors.

Could you post your alarm.yaml file without the codes?

Your time and weather sensors are missing too plus the full UI looks off. Which browser are you using and have you cleared the cache?

HI @gazoscalvertos,

Below is my alarm.yaml. I am using firefox (Ubuntu). I will try to clear cache and try again. I will update this post after cache clear.

PS: Cleared the cache and still same output. Looks like it stopped working again after I enabled MQTT section from alarm.yaml.

platform: bwalarm
name: House

alarm: automation.alarm_triggered
warning: automation.alarm_warning

code: '****' #Master Code, should consist of one or more digits ie '6482' ensure your passcode is encapsulated by quotes
panic_code: '****' #[OPTIONAL] Panic Code should consist of one or more digits ie '9876' ensure your passcode is encapsulated by quotes, it needs to be different to your standard alarm code. This enables a special panic mode. This can be used under duress to deactivate the alarm which would appear to the unseeing eye as deactivated however a special attribute [panic_mode] listed under the alarm_control_panel.[identifier] will change to ACTIVE. This status could be used in your automations to send a notification to someone else police/spouse/sibling/neighbour that you are under duress. To deactive this mode arm then disarm your alarm in the usual manner. 

# codes: #[OPTIONAL, list of names/codes] User specific codes.
#   - name: gazos
#     code: '6576'
#   - name: enzo
#     code: '8734'

pending_time: 25  #[DEFAULT] Grace time in seconds to allow for exit and entry using Away mode
trigger_time: 300 #[DEFAULT] The amount of time the alarm stays triggered before returning to its previous state

armed_perimeter: #[OPTIONAL]
  ##[OPTIONAL however either an immediate or delayed group must exist] Sensors in this group tigger the alarm immediately 
  immediate:
    - binary_sensor.study_sensor

armed_home: #[REQUIRED]
  pending_time: 10
  trigger_time: 300 #[OPTIONAL] State specific overrides default time above
  ##[OPTIONAL however either an immediate or delayed group must exist] Sensors in this group tigger the alarm immediately 
  immediate:
    - binary_sensor.study_sensor

  ##[OPTIONAL] Sensors in this group start the clock (pending_time) when tripped before the alarm is triggered 
  delayed:
    - binary_sensor.study_sensor

armed_away: #[REQUIRED]
  trigger_time: 600  #[OPTIONAL] State specific overrides default time above
  ##[OPTIONAL however either an immediate or delayed group must exist] Sensors in this group tigger the alarm immediately 
  immediate:
    - binary_sensor.study_sensor

  ##[OPTIONAL] Sensors in this group start the clock (pending_time) when tripped before the alarm is triggered 
  delayed:
    - binary_sensor.study_sensor

  #[OPTIONAL] Use this group to automatically override the warning message on open sensors when arming. (I use this as I have a motion sensor at the front door)
  override:
    - binary_sensor.study_sensor

##[INTERFACE OPTIONAL SETTINGS] 
clock: True  #[Optional] - False by default. True enables a clock in the center of the status bar
perimeter_mode: True #[Optional] - False by default. 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: True #[Optional] - False by Default. 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
persistence: False #[OPTIONAL] False by Default. Allows this custom component to save the state of the alarm to file then reinstate it in the event of power loss.
hide_passcode: True #[OPTIONAL] - True by default. This is a security feature when enabled hides the passcode while entering disarm code.
hide_sidebar: False #[OPTIONAL] - False by default. This is a security feature when enabled hides the HA sidebar when the alarm is armed. The sidebar re-appears when the alarm is disarmed.
#hide_sensor_groups: True #[Optional] - False by default. Setting this to True hides sensor groups (all sensors, immediate sensors, delayed sensors, inactive sensors) from the display. Open sensors will still appear
hide_custom_panel: True #[Optional] - True by default. Setting this to False enables a custom panel below the sensors groups which allows you to add your own html code. Use this to bring any other features you would like to see for example displaying live camera feeds, a rotating image gallery, custom HA buttons and sensors. To use this enable the custom panel in alarm.yaml (custom_panel: True) then ensure you take a copy of custom-element.html and add it to you www/alarm/ folder. Edit the html code between the <template> tags. I'm have added a custom sample folder where I will upload examples of 'things' which can be added here. Please contribute!!!

##[PASSCODE RELATED]
#passcode_attempts: 3 #[Optional] Disabled if commented out. When a value equal or greater than 0 is set, the system will only allow the set amount of password attempts before timing out
#passcode_attempts_timeout: 30 #[Optional] Default 30 seconds. When set with the password attempts option the panel will timeout for the amount of seconds set if the password is entered incorrectly as per the password_attempts option. The system will then reset the allowed password attempts

##[MQTT RELATED]
#mqtt: True #[OPTIONAL] - False by default. Settings this to True will enable MQTT Mode. Uncomment options below to use See the README for guidance.
#override_code: True #[OPTIONAL] False by default. if true allows MQTT commands to disarm the alarm without a valid code.
#state_topic: 'home/alarm' #[OPTIONAL] The MQTT topic HA will publish state updates to.
#command_topic: 'home/alarm/set' #[OPTIONAL] The MQTT topic HA will subscribe to, to receive commands from a remote device to change the alarm state.
#qos: 0 #[OPTIONAL] The maximum QoS level for subscribing and publishing to MQTT messages. Default is 0.
#payload_disarm: "DISARM" #[OPTIONAL] The payload to disarm this Alarm Panel. Default is “DISARM”.
#payload_arm_home: "ARM_HOME" #[OPTIONAL] The payload to set armed-home mode on this Alarm Panel. Default is “ARM_HOME”.
#payload_arm_away: "ARM_AWAY" #[OPTIONAL] The payload to set armed-away mode on this Alarm Panel. Default is “ARM_AWAY”.
#payload_arm_night: "ARM_NIGHT" #[OPTIONAL] The payload to set armed-night mode on this Alarm Panel. Default is “ARM_NIGHT”.

## [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'

#############REMOVE#######################################
## [SENSOR GROUPS]
##Sensors in this group tigger the alarm immediately
# immediate:
#   - binary_sensor.back_door
#   - binary_sensor.kitchen_window

# ##Sensors in this group start the clock (pending_time) when tripped before the alarm is activated in 'Away' mode
# delayed:
#   - binary_sensor.kitchen_motion
#   - binary_sensor.hall_motion
#   - binary_sensor.front_door
#   - binary_sensor.garage_door

# ##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.hall_motion
# ##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.hall_motion
#   - binary_sensor.front_door

# ##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.front_door
#   - binary_sensor.back_door
#   - binary_sensor.garage_door
###########################################################

## [CUSTOM SENSOR STATUSES]
## These settings allow devices which are not natively supported by this panel to be used. 
## This is to be used when the state of the device is not recognised by the panel. Examples are provided below 
#custom_supported_statuses_on:
#  - 'running' #EXAMPLE
#  - flipped #EXAMPLE
#custom_supported_statuses_off:
#  - 'not_running' #EXAMPLE
#  - unflipped   #EXAMPLE

if you have one binary_sensor this can be put in either immediate or delay for each mode.

check the line and change to False
hide_sensor_groups: False

HI @Sunonline,

Tried what you suggested but still same output. :frowning:

Thanks

after you have change any config from home assistant.

  1. restart or reboot your ha is a must.
  2. clear all browsing history and cache from your browser that you used.
  3. open ha again.

HI @Sunonline

Thanks mate but did all the above before posting, :slight_smile:

are you using the mqtt alarm control panel or just only this custom component as alarm control panel?

this custom component is alarm control panel itself without needs of mqtt alarm and you can use either of them.

So if you don’t have mqtt alarm exist then just put # in front of mqtt section in alarm.yaml.
Also if possible show you alarm.yaml config so we can help.

Hi @Sunonline,

I have disabled the MQTT section and yes, I am planning to use it later. I have MQTT broker running on same machine.

I have posted my alarm.yaml in above post for @gazoscalvertos.

Thanks

If you already got the alarm control panel running but couldn’t see the sensor.

Try to open HA from google chrome browser which works best for HA, then see if everything load ok.

I’ll PM you

Maybe you can also create a hassio addon, then you can publish updates

1 Like