YET another take on an alarm system

I’m trying since some days to get the MQTT functionality running but when I uncomment the mqtt part of the alarm.yaml the Alarm Panel at all is not working anymore. I just see a red circle (in Chrome). I have also tried to open the Alarm Panel with Firefox and Internet Explorer but no success. I have already added “frontend: javascript_version: latest” in my configuration.yaml but also no success. I got some errors in the logfile (the logfile entry is very long so I only insert the beginning):
2018-02-18 19:33:36 ERROR (MainThread) [frontend.js.latest.201802090] http://192.168.1.xxx:8123/frontend/panels/alarm-
2018-02-18 19:33:36 ERROR (MainThread) [frontend.js.latest.201802090]
http://192.168.1.xxx:8123/frontend_latest/panels/ha-panel-hassio-ad7aa

Any ideas what I can do to fix this issue?

I have updated everyting (hass and the alarm) to the newest versions and my setup is awesome! Thank you @gazoscalvertos for everything you did so far!

This is my tablet on my main door. Thanks to you, I now have a fully function alarm system with notifications, alarms, automations etc.

I am using this for more than a month and it is now part of our life. Every night we arm the alarm, and every morning we disarm it. Same goes when we are away. My wife feels a lot safer now, and she also thinks it is easy to use. If she thinks this alarm is easy, then everyone can use it. She fully understands how it works! I made the interface a little easier to read and attractive by removing the unnecessary badge, enlarging the clock and the weather letters. I also exchanged the dark sky component with the openweathermap, as it seems to be more accurate (at least where I live).
Thank you for your effort!

One thing I am trying to figure out is the panic code. How do I implement it in an automation?
How can I use the attribute “panic_mode=ACTIVE” from the alarm sensor?

2 Likes

Seems odd that it works on one and not the other. Does the camera require authentication and could it be the iphone has saved credentials in the browser?

Which MQTT server are you using?

I’m glad it’s working out!

Try an automation along the lines of:

- alias: '[Alarm] Panic Mode'
  trigger:
    platform: state
    entity_id: alarm_control_panel.house
    value_template: '{{ state.attributes.panic_mode }}'
    to: 'ACTIVE'
  action:
    service: activate_self_defence_robot

Please test this before using it.

I need to pull together a load of examples such as these into the repo. If only I didn’t need to work for a living :joy:

plus I’m thinking of ditched the badge too as the formatting sucks.

1 Like

Thats how it worked for me:

- action:
  - data:
      message: Come help me! I am held hostage by evil magneto!
    service: notify.theX-men
  alias: '[Alarm] Panic Mode'
  condition: []
  id: 'alarmpanicmode'
  trigger:
  - platform: template
    value_template: '{{states.alarm_control_panel.jarvis_alarm_system.attributes.panic_mode=="ACTIVE"}}'

I will test the persistence mode later or tomorrow.
If you need any help, I am willing to contribute in any way I can. Even by just testing anything you like.

1 Like

change from javascript_version: lastest to auto

It’s alright for me although I couldn’t see from pc but I can see from ios app. I also have add this camera to homebridge to see via homekit.

I think the javascript is still somehow needed to be in as long as we use browser.

Thank you very much.

I almost had this working. I had the weather disabled but the clock wasn’t showing. Notifications were working. I realised I needed to add a time sensor for the clock to display and did so. I added a dark sky summary sensor at the same time and I also disabed hiding of the sidebar to assist with testing. Unfortunately when I restarted the alarm tab refused to display. The dark sky summary sensor and time sensor opperated correctly in the default display. I disbled the time and weather sensors in the alarm_panel.yaml. I also re-enabled hiding of the sidebar and then restarted but still can not get the tab to display again. This is the error I receive in Chrome (the firefox error log is enormous in comparison):

http://hassio.local:8123/frontend/panels/alarm-001f97509c39e788542bd2b51deb052d.html:250:34 Uncaught TypeError: Cannot read property 'attributes' of undefined 

Ive tried es5, latest, and auto as the javascript version in the frontend but no change. Ive spent hours scouring my settings for errant spaces but can’t for the life of me work out why this is now not displaying. Anyone have any idea?

You need to clear browser cache and history or by ctrl+F5 on your browser if you use pc regarding the alarm tab

For javascript_version: auto is the best solution for now which not only effected the alarm control panel but also other setting involved with javascript (custom ui, etc).

His latest version of alarm control panel didn’t use javascript anymore from what I have read. However, you still need to put javascript_version: auto under frontend platform.

Thanks. I should have mentioned that I did clear my cache and I even tried another browser (that had never opened hassio) and I do currently have the JS version set to auto. All without success.

then you have to show your alarm.yaml so we can help ^^.

Also when you make any change you have to reboot not only clear cache and history of the browser.

Did you try re-download alarm.html

also show us the config of your panel_custom.yaml

Hi, I am a beginner with HA, is it possible to schedule arm home at midnight and disarm in the morning?
I have searched the forum but I didn’t find a solution for this.

Thanks

There was something wrong with my MQTT settings. Now it is working. Thank you very much.

That’s a nice feature to have!

Ok here’s the panel_custom.yaml and alarm.yaml files. See anything wrong?

  - name: alarm
    sidebar_title: Alarm
    sidebar_icon: mdi:security-home
    config:
      alarmid: alarm_control_panel.Home ## USE THE SAME ID AS USED IN YOUR ALARM.YAML
platform: bwalarm
name: Home

code: !secret alarm_code #Code, should consist of one or more digits ie '6482' ensure your passcode is encapsulated by quotes
panic_code: !secret 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. 

pending_time: 20 #Grace time in seconds to allow for exit and entry using Away mode
trigger_time: 180

alarm: automation.alarm_triggered
warning: automation.alarm_warning

##[OPTIONAL SETTINGS] 
clock: False #[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: False #[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'

############# SENSOR GROUPS ########################
##Sensors in this group tigger the alarm immediately
immediate:
  - binary_sensor.pir_dining
  - binary_sensor.pir_laundry
  - binary_sensor.pir_lounge
  - binary_sensor.pir_masterbedroom
  - binary_sensor.pir_rumpus
  - binary_sensor.pir_sparebedroom
  - binary_sensor.pir_study
  - binary_sensor.pir_workshop

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

##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.pir_entry
  - binary_sensor.pir_dining
  - binary_sensor.pir_lounge
  - binary_sensor.pir_masterbedroom
  - binary_sensor.pir_sparebedroom

##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.pir_entry

##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.pir_entry
  - binary_sensor.pir_dining
  - binary_sensor.pir_laundry
  - binary_sensor.pir_rumpus
  - binary_sensor.pir_sparebedroom
  - binary_sensor.pir_study
  - binary_sensor.pir_workshop

##[OPTIONAL] - 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:
  - 'Detected' #Motion & Smoke Detector
custom_supported_statuses_off:
  - 'Clear' #Motion & Smoke Detector

Yes. Add the following scripts and create time triggered automations to run them:

alarm_arm:
  sequence:
    service: alarm_control_panel.alarm_arm_away
    entity_id: alarm_control_panel.house
alarm_disarm:
  sequence:
    service: alarm_control_panel.alarm_disarm
    entity_id: alarm_control_panel.house
    data:
      code: 9999 # <- your arm/disarm code here

I rerplaced the entire config.

iOS app and Chrome Version 63.0.3239.132 (Official Build) (64-bit) are working as expected. FireFox 58.0.2 (64-bit) is not working.

All three are stil reporting:

data:text/javascript;charset=utf-8,%0A%09function%20enableSidebar()%7B%7D%0A%09function%20disableSidebar()%7B%7D%0A%0A%09Polymer(%7B%0A%09%09is%3A%20'ha-panel-alarm'%2C%0A%09%09created()%20%7B%0A%09%09%7D%2C%0A%09%09attached()%20%7B%0A%09%09%09var%20script%20%3D%20document.createElement('script')%3B%0A%09%09%09script.setAttribute('src'%2C%20'%2Flocal%2Falarm%2Falarm_scripts.js')%3B%0A%09%09%09document.body.appendChild(script)%3B%0A%09%09%7D%2C%0A%09%09ready()%20%7B%0A%0A%09%09%09this.hideSensors%20%3D%20this.alarm.attributes.hide_sensor_groups%0A%09%09%09this.hideCustom%20%20%3D%20this.alarm.attributes.hide_custom_panel%0A%0A%09%09%09if%20(this.alarm.attributes.clock)%20%7B%0A%09%09%09%09this.updateTime()%3B%0A%09%09%09%7D%0A%09%09%09if%20(this.alarm.attributes.weather)%20%7B%0A%09%09%09%09this.getWeather()%3B%0A%09%09%09%7D%0A%09%09%09this.async(this.toggleSiderbar%2C100)%3B%0A%20%20%20%20%20%20%2F%2Fif%20(this.screensaver)%7B%0A%20%20%20%20%20%20%2F%2F%20%20%20%20%20%09%20this.setupEyeCandy()%3B%0A%20%20%20%20%20%20%2F%2F%20%20%20%20%20%7D%0A%20%20%7D%2C%0A%20%20properties%3A%20%7B%0A%20%20%20%20%20%20hass%3A%20%20%20%20%20%20%20%20%20%20%20%20%7B%20type%3A%20Object%20%7D%2C%0A%20%20%20%20%20%20panel%3A%20%20%20%20%20%20%20%20%20%20%20%7B%20type%3A%20Object%20%7D%2C%0A%20%20%20%20%20%20narrow%3A%20%20%20%20%20%20%20%20%20%20%7B%20type%3A%20Boolean%2C%20value%3A%20false%20%7D%2C%0A%20%20%20%20%20%20showMenu%3A%20%20%20%20%20%20%20%20%7B%20type%3A%20Boolean%2C%20value%3A%20false%20%7D%2C%0A%0A%20%20%20%20%20%20alarm%3A%20%20%20%20%20%20%20%20%20%20%20%7B%20type%3A%20Object%2C%20observer%3A%20'monitorAlarm'%20%7D%2C%0A%0A%20%20%20%20%20%20%2F%2F%20Sensor%20Groups%0A%20%20%20%20%20%20immediate%3A%20%20%20%20%20%20%20%7B%20type%3A%20Array%2C%20computed%3A%20'computeSensors(hass%2C%20alarm.attributes.immediate)'%20%7D%2C%0A%20%20%20%20%20%20delayed%3A%20%20%20%20%20%20%20%20%20%7B%20type%3A%20Array%2C%20computed%3A%20'computeSensors(hass%2C%20alarm.attributes.delayed)'%20%7D%2C%0A%20%20%20%20%20%20ignored%3A%20%20%20%20%20%20%20%20%20%7B%20type%3A%20Array%2C%20computed%3A%20'computeSensors(hass%2C%20alarm.attributes.ignored)'%20%7D%2C%0A%20%20%20%20%20%20perimeter%3A%20%20%20%20%20%20%20%7B%20type%3A%20Array%2C%20computed%3A%20'computeSensors(hass%2C%20alarm.attributes.perimeter)'%20%7D%2C%0A%20%20%20%20%20%20allsensors%3A%20%20%20%20%20%20%7B%20type%3A%20Array%2C%20computed%3A%20'computeSensors(hass%2C%20alarm.attributes.allsensors)'%7D%2C%0A%20%20%20%20%20%20overrideSensors%3A%20%7B%20type%3A%20Array%2C%20computed%3A%20'computeSensors(hass%2C%20alarm.attributes.override)'%20%7D%2C%0A%0A%20%20%20%20%20%20opencount%3A%20%20%20%20%20%20%20%7B%20type%3A%20Number%2C%20value%3A%200%20%7D%2C%0A%0A%20%20%20%20%20%20time%3A%20%20%20%20%20%20%20%20%20%20%20%20%7B%20type%3A%20Object%20%7D%2C%0A%20%20%20%20%20%20weather%3A%09%20%20%20%20%20%20%20%7B%20type%3A%20Object%20%7D%2C%0A%20%20%20%20%20%20temp%3A%09%20%20%20%20%20%20%20%20%20%20%20%7B%20type%3A%20String%20%7D%2C%0A%0A%20%20%20%20%20%20code%3A%20%20%20%20%20%20%20%20%20%20%20%20%7B%20type%3A%20String%2C%20value%3A%20''%20%7D%2C%0A%20%20%20%20%20%20display_code%3A%20%20%20%20%7B%20type%3A%20String%2C%20value%3A%20''%20%7D%2C%0A%0A%20%20%20%20%20%20timeoutID%3A%20%20%20%20%20%20%20%7B%20type%3A%20Number%20%7D%2C%0A%0A%20%20%20%20%20%20cleanup%3A%20%20%20%20%20%20%20%20%20%7B%20type%3A%20Array%2C%20value%3A%20%5B%5D%20%7D%2C%0A%20%20%20%20%20%20attemptedArm%3A%20%20%20%20%7B%20type%3A%20Boolean%2C%20value%3A%20false%20%7D%2C%20%0A%20%20%20%20%20%20screensaver%3A%20%20%20%20%20%7B%20type%3A%20Boolean%2C%20value%3A%20false%20%7D%2C%0A%20%20%20%20%20%20settings%3A%09%20%20%20%20%20%20%20%7B%20type%3A%20Boolean%2C%20value%3A%20false%20%7D%2C%0A%0A%20%20%20%20%20%20%2F%2FENUMS%20USED%20FOR%20CSS%20CLASS%20SELECTION%0A%20%20%20%20%20%20panel_locked%3A%20%20%20%20%7B%20type%3A%20Boolean%2C%20value%3A%20false%20%7D%2C%0A%0A%20%20%20%20%20%20hideSensors%3A%20%20%20%20%20%7B%20type%3A%20Boolean%2C%20value%3A%20true%20%7D%2C%0A%20%20%20%20%20%20hideCustom%3A%20%20%20%20%20%20%7B%20type%3A%20Boolean%2C%20value%3A%20true%20%7D%2C%0A%20%20%7D%2C%0A%0A%09computeValue%3A%20function(entity)%20%7B%0A%09%20%20%20%09if%20(entity%20%3D%3D%20undefined)%20%7B%0A%09%09%20%20%20%20return%20false%3B%0A%09%09%7D%20else%20%7B%0A%09%09%20%20%20%20return%20entity%3B%0A%09%09%7D%0A%09%7D%2C%0A%0A%20%20toggleCSS%3A%20function(ev)%20%7B%0A%20%20%09ev.stopPropagation()%3B%0A%09var%20css%20%3D%20ev.target.getAttribute('data-css')%3B%0A%20%20%09switch%20(css)%20%7B%0A%09%09case%20'sensors'%3A%20this.hideSensors%20%3D%20!this.hideSensors%3B%0A%09%09%09break%3B%0A%09%09case%20'custom'%3A%20this.hideCustom%20%3D%20!this.hideCustom%3B%0A%09%09%09break%3B%0A%09%7D%0A%20%20%7D%2C%0A%0A%20%20toggleSiderbar%3A%20function()%20%7B%0A%09if%20(this.alarm.attributes.hide_sidebar%20%3D%3D%20true)%20Polymer.dom(this.root).querySelector('%23disableSidebar').click()%3B%0A%09if%20(this.alarm.state%20%3D%3D%20'disarmed')%20%7B%0A%20%20%09%09%2F%2F-----DISPLAY%20THE%20SIDE%20BAR%20ON%20THE%20SCREEN-------------%0A%20%20%09%09if%20(this.alarm.attributes.hide_sidebar%20%3D%3D%20true)%20Polymer.dom(this.root).querySelector('%23enableSidebar').click()%3B%0A%20%20%09%7D%0A%20%20%7D%2C%0A%0A%20%20monitorAlarm%3A%20function()%20%7B%0A%20%20%09%2F%2F-----HIDE%20THE%20SIDE%20BAR%20FROM%20THE%20SCREEN-------------%0A%20%20%09if%20(this.alarm.attributes.hide_sidebar%20%3D%3D%20true)%20Polymer.dom(this.root).querySelector('%23disableSidebar').click()%3B%0A%0A%20%20%09var%20countdownTimerDiv%20%3D%20Polymer.dom(this.root).querySelector('%23countdown360_countdown')%3B%0A%20%20%09if%20(countdownTimerDiv)%20countdownTimerDiv.remove()%3B%0A%0A%20%20%09this.updateStyles(%7B'--countdown-timer-display'%3A%20'none'%7D)%3B%0A%20%20%09this.updateStyles(%7B'--time-display'%3A%20'initial'%7D)%3B%0A%20%20%09if%20(this.alarm.state%20%3D%3D%20'disarmed')%20%7B%0A%20%20%09%09if%20(this.attemptedArm%20%3D%3D%20true)%20%7B%20this.resetButtons()%3B%20%7D%0A%20%20%09%09%2F%2F-----DISPLAY%20THE%20SIDE%20BAR%20ON%20THE%20SCREEN-------------%0A%20%20%09%09if%20(this.alarm.attributes.hide_sidebar%20%3D%3D%20true)%20Polymer.dom(this.root).querySelector('%23enableSidebar').click()%3B%0A%20%20%09%09this.updateStyles(%7B'--primary-color'%3A%20this.alarm.attributes.disarmed_colour%7D)%3B%0A%20%20%09%7D%20else%20if%20(this.alarm.state%20%3D%3D%20'armed_away')%20%7B%0A%20%20%09%09this.updateStyles(%7B'--primary-color'%3A%20this.alarm.attributes.armed_away_colour%7D)%3B%0A%20%20%09%7D%20else%20if%20(%20this.alarm.state%20%3D%3D%20'armed_home')%20%7B%0A%20%20%09%09this.updateStyles(%7B'--primary-color'%3A%20this.alarm.attributes.armed_home_colour%7D)%3B%0A%20%20%09%7D%20else%20if%20(%20this.alarm.state%20%3D%3D%20'armed_perimeter')%20%7B%0A%09%20%20%20%20this.updateStyles(%7B'--primary-color'%3A%20this.alarm.attributes.armed_home_colour%7D)%3B%20%2F%2FSORT%20THIS%20OUT%0A%09%7D%20else%20if%20(this.alarm.state%20%3D%3D%20'pending')%20%7B%0A%09%09this.updateStyles(%7B'--primary-color'%3A%20this.alarm.attributes.pending_colour%7D)%3B%0A%09%09this.updateStyles(%7B'--countdown-timer-display'%3A%20'initial'%7D)%3B%0A%09%09this.updateStyles(%7B'--time-display'%3A%20'none'%7D)%3B%0A%09%09this.loadTimer(false%2C%20this.alarm.attributes.countdown_time)%3B%0A%09%7D%20else%20if%20(this.alarm.state%20%3D%3D%20'warning')%20%7B%0A%09%09this.updateStyles(%7B'--primary-color'%3A%20this.alarm.attributes.warning_colour%7D)%3B%0A%09%09this.updateStyles(%7B'--countdown-timer-display'%3A%20'initial'%7D)%3B%0A%09%09this.updateStyles(%7B'--time-display'%3A%20'none'%7D)%3B%0A%09%09this.loadTimer(false%2C%20this.alarm.attributes.countdown_time)%3B%0A%09%7D%20else%20if%20(this.alarm.state%20%3D%3D%20'triggered')%20%7B%0A%09%09this.updateStyles(%7B'--primary-color'%3A%20this.alarm.attributes.triggered_colour%7D)%3B%0A%09%7D%0A%09if%20(this.alarm.attributes.panel_locked%20%3D%3D%20true)%20%7B%0A%09%09console.log(%22Panel%20locked%22)%3B%0A%09%09this.updateStyles(%7B'--primary-color'%3A%20'grey'%7D)%3B%20%2F%2F%5BTODO%5D%20Implement%20panel%20locked%20colour%20-%20this.alarm.attributes.panel_locked_colour%7D)%3B%0A%09%09this.updateStyles(%7B'--countdown-timer-display'%3A%20'initial'%7D)%3B%0A%09%09this.updateStyles(%7B'--time-display'%3A%20'none'%7D)%3B%0A%09%09this.loadTimer(true%2C%20this.alarm.attributes.passcode_attempt_timeout)%3B%0A%09%09this.panel_locked%20%3D%20true%3B%0A%09%7D%0A%09else%20this.panel_locked%20%3D%20false%3B%0A%0A%20%20%7D%2C%0A%20%20getClass%3A%20function(cssClass)%20%7B%0A%20%20%09return%20cssClass%20%3F%20%22slideup%22%20%3A%20%22slidedown%22%3B%0A%20%20%7D%2C%0A%20%20loadTimer%3A%20function(locked%2C%20time)%20%7B%0A%0A%20%20%09var%20startColour%20%3D%20'%238ac575'%3B%0A%20%20%09var%20middleColour%20%3D%20'orange'%3B%0A%20%20%09var%20endColour%20%3D%20'red'%0A%0A%20%20%09if%20(locked%20%3D%3D%20true)%20startColour%20%3D%20middleColour%20%3D%20endColour%20%3D%20'red'%3B%0A%0A%20%20%09var%20countdownDiv%20%3D%20Polymer.dom(this.root).querySelector('%23countdown')%3B%0A%20%20%09%24(countdownDiv).unbind().removeData()%3B%0A%20%20%09var%20countdown%20%3D%20%24(countdownDiv).countdown360(%0A%20%20%09%7B%0A%20%20%09%09radius%20%20%20%20%20%20%3A%2050%2C%0A%20%20%09%09fontColor%20%20%20%3A%20'%23FFFFFF'%2C%0A%20%20%09%09autostart%20%20%20%3A%20false%2C%0A%20%20%09%09label%20%20%20%20%20%20%20%3A%20false%2C%0A%20%20%09%09smooth%20%20%20%20%20%20%3A%20true%2C%0A%20%20%09%09seconds%20%20%20%20%20%3A%20time%2C%0A%20%20%09%09fillStyle_0to50%3A%20startColour%2C%0A%20%20%09%09fillStyle_50to75%3A%20middleColour%2C%0A%20%20%09%09fillStyle_75to100%3A%20endColour%0A%09%7D)%3B%0A%20%20%09countdown.start()%3B%0A%20%20%7D%2C%0A%20%20%20%2F%2F--------------------------------------------------------------%2F%2F%0A%20%20%20%2F%2F-----------------EYE%20CANDY%20FUNCTION---------------------------%2F%2F%0A%20%20%20%2F%2F--------------------------------------------------------------%2F%2F%0A%2F*%20%20%20setupEyeCandy%3A%20function%20()%20%7B%0A%20%20%20%09this.addEventListener(%22mousemove%22%2C%20this.resetTimer)%3B%0A%20%20%20%09this.addEventListener(%22mousedown%22%2C%20this.resetTimer)%3B%0A%20%20%20%09this.addEventListener(%22keypress%22%2C%20this.resetTimer)%3B%0A%20%20%20%09this.addEventListener(%22DOMMouseScroll%22%2C%20this.resetTimer)%3B%0A%20%20%20%09this.addEventListener(%22mousewheel%22%2C%20this.resetTimer)%3B%0A%20%20%20%09this.addEventListener(%22touchmove%22%2C%20this.resetTimer)%3B%0A%20%20%20%09this.addEventListener(%22MSPointerMove%22%2C%20this.resetTimer)%3B%0A%0A%20%20%20%09this.startTimer()%3B%0A%20%20%20%7D%2C%0A%20%20%20startTimer%3A%20function()%20%7B%0A%20%20%20%09this.timeoutID%20%3D%20this.async(this.goInactive%2C8000)%3B%0A%20%20%20%7D%2C%0A%20%20%20resetTimer%3A%20function%20()%20%7B%0A%20%20%20%09clearTimeout(this.timeoutID)%3B%0A%20%20%20%09this.goActive()%3B%0A%20%20%20%7D%2C%0A%20%20%20goActive%3A%20function()%20%7B%0A%20%20%20%09var%20alarmContent%20%3D%20Polymer.dom(this.root).querySelector('%23alarm-panel')%3B%0A%20%20%20%09alarmContent.classList.remove('remove')%3B%0A%20%20%20%09var%20eyecandyContent%20%3D%20Polymer.dom(this.root).querySelector('%23eyecandy')%3B%0A%20%20%20%09eyecandyContent.classList.add('remove')%3B%0A%20%20%20%09var%20appHeader%20%3D%20Polymer.dom(this.root).querySelector('app-header-layout')%3B%0A%20%20%20%09appHeader.classList.remove('hide-bar')%3B%0A%20%20%20%20%20%20%2F%2Fvar%20settingsContent%20%3D%20Polymer.dom(this.root).querySelector('%23settings')%3B%0A%20%20%20%20%20%20%2F%2FsettingsContent.classList.add('remove')%3B%0A%20%20%20%20this.startTimer()%3B%0A%20%20%7D%2C%0A%20%20goInactive%3A%20function%20()%20%7B%0A%20%20%09var%20alarmContent%20%3D%20Polymer.dom(this.root).querySelector('%23alarm-panel')%3B%0A%20%20%09alarmContent.classList.add('remove')%3B%0A%20%20%09var%20eyecandyContent%20%3D%20Polymer.dom(this.root).querySelector('%23eyecandy')%3B%0A%20%20%09eyecandyContent.classList.remove('remove')%3B%0A%20%20%09var%20appHeader%20%3D%20Polymer.dom(this.root).querySelector('app-header-layout')%3B%0A%20%20%09appHeader.classList.add('hide-bar')%3B%0A%20%20%20%20%20%20%2F%2Fvar%20settingsContent%20%3D%20Polymer.dom(this.root).querySelector('%23settings')%3B%0A%20%20%20%20%20%20%2F%2FsettingsContent.classList.remove('remove')%3B%0A%20%20%7D%2C*%2F%0A%20%20%20%2F%2F--------------------------------------------------------------%2F%2F%0A%20%20%20%2F%2F-----------------EYE%20CANDY%20FUNCTION---------------------------%2F%2F%0A%20%20%20%2F%2F--------------------------------------------------------------%2F%2F%0A%20%20%20getWeather%3A%20function()%20%7B%0A%20%20%20%09this.weather%20%3D%20this.hass.states%5B'sensor.dark_sky_summary'%5D%3B%0A%20%20%20%09this.temp%20%3D%20Math.ceil((this.hass.states%5B'sensor.dark_sky_apparent_temperature'%5D).state)%3B%0A%20%20%20%7D%2C%0A%20%20%20toggleSettings()%20%7B%0A%20%20%20%09var%20settingsContent%20%3D%20Polymer.dom(this.root).querySelector('%23settings')%3B%0A%20%20%20%09var%20alarmContent%20%3D%20Polymer.dom(this.root).querySelector('%23alarm-panel')%3B%0A%20%20%20%09if%20(this.settings)%20%7B%0A%20%20%20%09%09alarmContent.classList.remove('remove')%3B%0A%20%20%20%09%09settingsContent.classList.add('remove')%3B%0A%20%20%20%09%09this.settings%20%3D%20false%3B%0A%20%20%20%09%7D%20else%20%7B%0A%20%20%20%09%09alarmContent.classList.add('remove')%3B%0A%20%20%20%09%09settingsContent.classList.remove('remove')%3B%0A%20%20%20%09%09this.settings%20%3D%20true%3B%0A%20%20%20%09%7D%0A%20%20%20%7D%2C%0A%20%20%20updateTime%3A%20function()%20%7B%0A%20%20%20%09this.time%20%3D%20this.hass.states%5B'sensor.time'%5D%3B%0A%20%20%20%20this.async(this.updateTime%2C1000)%3B%0A%20%20%7D%2C%0A%20%20%20%2F%2F%20Polymer%20observers%20definition%0A%20%20%20observers%3A%20%5B%20'onPanelUpdate(hass%2C%20panel)'%20%5D%2C%0A%20%20%20wtf%3A%20function%20(e)%20%7B%20debugger%3B%20return%20e%3B%20%7D%2C%0A%20%20%20%2F%2F%20Helpers%20to%20figure%20out%20what%20to%20display%20%0A%20%20%20isdisarmed%3A%20%20function(alarm)%20%7B%20return%20alarm.state%20%3D%3D%20%22disarmed%22%3B%20%7D%2C%0A%20%20%20isperimeter%3A%20%20function(alarm)%20%7B%20return%20alarm.state%20%3D%3D%20%22armed_perimeter%22%3B%20%7D%2C%0A%20%20%20issecure%3A%20%20%20%20function(all)%20%20%20%7B%20return%20this.opensensors(alarm%2C%20all).length%20%3D%3D%200%3B%20%7D%2C%0A%20%20%20opensensors%3A%20function(alarm%2C%20all)%20%20%20%7B%20%0A%20%20%20%09if%20(all%20%3D%3D%20false)%20%7B%0A%20%20%20%09%09return%20false%3B%0A%20%20%20%09%7D%20else%20%7B%0A%20%20%20%09%09ret%20%3D%20all.filter(function%20(e)%20%7B%20return%20alarm.attributes.supported_statuses_on.indexOf(e.state.toLowerCase())%20%3E%20-1%3B%20%7D)%3B%20%0A%20%20%20%09%09this.opencount%20%3D%20ret.length%3B%0A%20%20%20%09%09return%20ret%3B%0A%20%20%20%09%7D%0A%20%20%20%7D%2C%0A%20%20%20closedsensors%3A%20function(alarm%2C%20all)%20%20%20%7B%0A%20%20%20%09if%20(all%20%3D%3D%20false)%20%7B%0A%20%20%20%09%09return%20false%3B%0A%20%20%20%09%7D%20else%20%7B%0A%20%20%20%09%09ret%20%3D%20all.filter(function%20(e)%20%7B%20return%20alarm.attributes.supported_statuses_off.indexOf(e.state.toLowerCase())%20%3E%20-1%3B%20%7D)%3B%0A%20%20%20%09%09return%20ret%3B%0A%20%20%20%09%7D%0A%20%20%20%7D%2C%0A%20%20%20computeSensors%3A%20function(hass%2C%20ids)%20%7B%0A%20%20%20%09if%20(ids%20%3D%3D%20undefined)%20%7B%0A%09%20%2F%2F%20Control%20the%20exception%20when%20this.alarm%20is%20not%20ready%0A%09%20return%20false%3B%0A%09%7D%20else%20%7B%0A%09%09return%20ids.map(function%20(key)%20%7B%20return%20hass.states%5Bkey%5D%3B%20%7D).filter(function%20(e)%20%7B%20return%20e%20!%3D%20undefined%3B%20%7D)%3B%0A%09%7D%0A%7D%2C%0AcomputeIcon%3A%20function%20(state)%20%7B%0A%09switch%20(state)%20%7B%0A%09%09case%20'disarmed'%3A%20%20%20%20%20%20%20%20return%20'mdi%3Ashield-outline'%3B%0A%09%09case%20'armed_away'%3A%20%20%20%20%20%20return%20'mdi%3Asecurity-home'%3B%0A%09%09case%20'armed_home'%3A%20%20%20%20%20%20return%20'mdi%3Asecurity-home'%3B%0A%09%09case%20'pending'%3A%20%20%20%20%20%20%20%20%20return%20'mdi%3Awalk'%3B%0A%09%09case%20'warning'%3A%20%20%20%20%20%20%20%20%20return%20'mdi%3Arun'%3B%0A%09%09case%20'triggered'%3A%20%20%20%20%20%20%20return%20'mdi%3Aalert-circle'%3B%0A%09%09case%20'armed_perimeter'%3A%20return%20'mdi%3Asecurity-home'%3B%0A%09%7D%0A%09return%20'mdi%3Ahelp'%3B%0A%7D%2C%0AcomputeLabel%3A%20function%20(state)%20%7B%0A%09switch%20(state)%20%7B%0A%09%09case%20'disarmed'%3A%20%20%20%09%20return%20'disarmed'%3B%0A%09%09case%20'armed_away'%3A%20%09%20return%20'away'%3B%0A%09%09case%20'armed_home'%3A%20%09%20return%20'home'%3B%0A%09%09case%20'pending'%3A%20%20%20%20%09%20return%20'leave'%3B%0A%09%09case%20'warning'%3A%20%20%20%20%09%20return%20'warning'%3B%0A%09%09case%20'triggered'%3A%20%20%09%20return%20'triggered'%3B%0A%09%09case%20'armed_perimeter'%3A%20return%20'perimeter'%3B%0A%09%7D%0A%09return%20state%3B%0A%7D%2C%0A%20%20%20%2F%2F%20Responding%20to%20user%20inputs%0A%20%20%20callcode%3A%20function(ev)%20%7B%0A%20%20%20%09ev.stopPropagation()%3B%0A%20%20%20%09var%20digit%20%3D%20ev.target.getAttribute('data-digit')%3B%0A%20%20%20%09this.code%20%3D%20this.code%20%2B%20digit%3B%0A%20%20%20%09var%20display_digit%20%3D%20digit%3B%0A%20%20%20%09if%20(this.alarm.attributes.hide_passcode)%20%7B%0A%20%20%20%09%20%20display_digit%20%3D%20'*'%3B%0A%20%20%20%09%7D%0A%20%20%20%09this.display_code%20%3D%20this.display_code%20%2B%20display_digit%3B%0A%20%20%7D%2C%0A%20%20callclearcode%3A%20function(ev)%20%7B%0A%20%20%09ev.stopPropagation()%3B%0A%20%20%09this.code%20%3D%20''%3B%0A%20%20%09this.display_code%20%3D%20''%3B%0A%20%20%7D%2C%0A%20%20callService%3A%20function(ev)%20%7B%0A%20%20%09ev.stopPropagation()%3B%0A%20%20%09var%20call%20%3D%20ev.target.getAttribute('data-call')%3B%0A%20%20%20%20%20%20if%20(call%20%3D%3D%20'cancel')%20%7B%20%2F%2Fcancel%20alarm%20set%20and%20return%20page%20to%20default%20settings%0A%20%20%20%20%20%20%09this.resetButtons()%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(ev.target.getAttribute('data-override'))%20%7B%20%2F%2FOverride%20of%20open%20sensors%20has%20been%20pressed%20so%20activate%20alarm%0A%20%20%20%20%20%20%09this.hass.callService('alarm_control_panel'%2C%20call%2C%20%7B'entity_id'%3A%20this.alarm.entityId%2C%20'code'%3A%20this.code%7D)%3B%0A%20%20%20%20%20%20%7D%20else%20if%20((call%20%3D%3D%20'alarm_arm_home'%20%7C%7C%20call%20%3D%3D%20'alarm_arm_away'%20%7C%7C%20call%20%3D%3D%20'alarm_arm_night')%20%26%26%20this.checkOpenSensors(call))%20%7B%20%2F%2FCheck%20if%20trying%20to%20activate%20home%20with%20open%20sensors.%20If%20so%20ping%20the%20warning%20message%0A%20%20%20%20%20%20%09console.log('WARNING%20open%20sensors')%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%20%2F%2FNo%20open%20sensors%20or%20another%20service%20call%0A%20%20%20%20%20%20%09this.hass.callService('alarm_control_panel'%2C%20call%2C%20%7B'entity_id'%3A%20this.alarm.entityId%2C%20'code'%3A%20this.code%7D)%3B%0A%20%20%20%20%20%20%09this.code%20%3D%20''%3B%0A%20%20%20%20%20%20%09this.display_code%20%3D%20''%3B%0A%20%20%20%20%20%20%7D%0A%20%20%7D%2C%0A%20%20checkOpenSensors%3A%20function(call)%20%7B%0A%20%20%20%20%20%20if%20(this.opencount%20%3D%3D%200)%20return%20false%3B%20%2F%2Fcheck%20to%20see%20how%20many%20open%20sensors%20there%20are%2C%20if%20none%20arm%20alarm%0A%0A%20%20%20%20%20%20for%20(var%20sensor%20in%20this.allsensors)%20%7B%20%2F%2Fcheck%20to%20see%20if%20the%20open%20sensor%20is%20one%20to%20ignore%2C%20if%20so%20arm%20alarm%0A%09%20%2F%2Fis%20it%20open%3F%0A%09%20if%20(%5B'on'%2C%20'open'%2C%20'true'%2C%20'detected'%2C%20'unlocked'%5D.indexOf(this.allsensors%5Bsensor%5D.state.toLowerCase())%20%3E%20-1)%20%7B%20%2F%2Fyes%0A%09%20%20%20%20%2F%2Fis%20it%20in%20the%20override%20list%3F%0A%09%20%20%20%20if%20(this.overrideSensors.indexOf(this.allsensors%5Bsensor%5D)%20%3D%3D%20-1)%20%7B%20%2F%2FNo%3A%20return%20so%20display%20message%0A%09%20%20%20%20%20%20%20this.attemptedArm%20%3D%20true%3B%20%2F%2Fdisplay%20the%20warning%20message%20and%20shake%0A%0A%09%20%20%20%20%20%20%20var%20btnArmHome%20%20%20%20%20%20%3D%20Polymer.dom(this.root).querySelector('%23arm-home')%3B%0A%09%20%20%20%20%20%20%20var%20btnArmAway%20%20%20%20%20%20%3D%20Polymer.dom(this.root).querySelector('%23arm-away')%3B%0A%0A%09%20%20%20%20%20%20%20if%20(this.alarm.attributes.perimeter_mode)%20%7B%0A%09%20%20%20%20%20%20%20%09var%20btnArmPerimeter%20%3D%20Polymer.dom(this.root).querySelector('%23arm-perimeter')%3B%0A%09%20%20%20%20%20%20%20%09btnArmPerimeter.classList.add('remove')%3B%0A%09%20%20%20%20%20%20%20%7D%0A%09%20%20%20%20%20%20%20btnArmHome.classList.add('big')%3B%0A%09%20%20%20%20%20%20%20btnArmAway.classList.add('little')%3B%0A%0A%09%20%20%20%20%20%20%20this.override%20%3D%20document.createAttribute(%22data-override%22)%3B%0A%09%20%20%20%20%20%20%20this.override.value%20%3D%20%22true%22%3B%0A%09%20%20%20%20%20%20%20btnArmHome.setAttributeNode(this.override)%3B%0A%0A%09%20%20%20%20%20%20%20var%20arm_mode%20%3D%20document.createAttribute(%22data-call%22)%3B%0A%09%20%20%20%20%20%20%20arm_mode.value%20%3D%20call%3B%0A%09%20%20%20%20%20%20%20btnArmHome.setAttributeNode(arm_mode)%3B%0A%0A%09%20%20%20%20%20%20%20var%20arm_mode2%20%3D%20document.createAttribute(%22data-call%22)%3B%0A%09%20%20%20%20%20%20%20arm_mode2.value%20%3D%20'cancel'%3B%0A%09%20%20%20%20%20%20%20btnArmAway.setAttributeNode(arm_mode2)%3B%0A%09%20%20%20%20%20%20%20btnArmHome.innerHTML%20%3D%20'Override%20Sensors%20and%20Arm%20Alarm'%3B%0A%09%20%20%20%20%20%20%20btnArmAway.innerHTML%20%3D%20'Cancel%20Arm'%3B%0A%0A%09%20%20%20%20%20%20%20var%20pageContent%20%3D%20Polymer.dom(this.root).querySelector('.content')%3B%0A%09%20%20%20%20%20%20%20pageContent.classList.add('shake')%3B%0A%0A%09%20%20%20%20%20%20%20return%20true%3B%0A%09%20%20%20%7D%0A%09%7D%20%20%20%20%20%20%20%20%20%20%0A%7D%0A%7D%2C%0AresetButtons%3A%20function()%20%7B%0A%09this.attemptedArm%20%3D%20false%3B%0A%0A%09var%20pageContent%20%3D%20Polymer.dom(this.root).querySelector('.content')%3B%0A%09pageContent.classList.remove('shake')%3B%0A%0A%09var%20btnArmHome%20%20%20%20%20%20%3D%20Polymer.dom(this.root).querySelector('%23arm-home')%3B%0A%09var%20btnArmAway%20%20%20%20%20%20%3D%20Polymer.dom(this.root).querySelector('%23arm-away')%3B%0A%09if%20(this.alarm.attributes.perimeter_mode)%20%7B%0A%09%09var%20btnArmPerimeter%20%3D%20Polymer.dom(this.root).querySelector('%23arm-perimeter')%3B%0A%09%09btnArmPerimeter.classList.remove('remove')%3B%0A%09%7D%0A%09btnArmHome.classList.remove('big')%3B%0A%09btnArmAway.classList.remove('little')%3B%0A%0A%20%20%20%20%20%20%2F%2Fvar%20override%20%3D%20document.createAttribute(%22data-override%22)%3B%0A%20%20%20%20%20%20btnArmHome.removeAttributeNode(this.override)%3B%0A%0A%20%20%20%20%20%20var%20arm_mode%20%3D%20document.createAttribute(%22data-call%22)%3B%0A%20%20%20%20%20%20arm_mode.value%20%3D%20'alarm_arm_home'%3B%0A%20%20%20%20%20%20btnArmHome.setAttributeNode(arm_mode)%3B%0A%0A%20%20%20%20%20%20var%20arm_mode2%20%3D%20document.createAttribute(%22data-call%22)%3B%0A%20%20%20%20%20%20arm_mode2.value%20%3D%20'alarm_arm_away'%3B%0A%20%20%20%20%20%20btnArmAway.setAttributeNode(arm_mode2)%3B%0A%0A%20%20%20%20%20%20btnArmHome.innerHTML%20%3D%20%22%3Ciron-icon%20icon%3D'mdi%3Alock-outline'%3E%3C%2Firon-icon%3E%26nbsp%3BHome%20Mode%22%3B%0A%20%20%20%20%20%20btnArmAway.innerHTML%20%3D%20%22%3Ciron-icon%20icon%3D'mdi%3Alock'%3E%3C%2Firon-icon%3E%26nbsp%3BAway%20Mode%22%3B%0A%0A%20%20%7D%2C%0A%20%20entityTapped%3A%20function%20(ev)%20%7B%0A%20%20%09ev.stopPropagation()%3B%0A%20%20%09var%20entityId%20%3D%20ev.target.getAttribute('data-entity')%3B%0A%20%20%09this.fire('hass-more-info'%2C%20%7B%20entityId%3A%20entityId%20%7D)%3B%0A%20%20%7D%2C%0A%20%20%20%2F%2F%20Observer%3A%20polymer%20gaurantees%20that%20this%20won't%20be%20called%20util%20hass%20and%20panel%20are%20both%20defined%0A%20%20%20onPanelUpdate%3A%20function(hass%2C%20panel)%20%7B%0A%20%20%20%20%20%20%2F%2Fconsole.log('onPanelUpdate')%3B%0A%20%20%20%20%20%20this.alarm%20%3D%20hass.states%5Bpanel.config.alarmid%5D%3B%0A%20%20%20%20%20%20%2F%2Fconsole.log('Alarm%20is%20'%2C%20this.alarm)%3B%0A%20%20%7D%2C%0A%7D)%3B%0A%0A%2F%2F%23%20sourceURL%3Dhttp%3A%2F%2Fhassio.local%3A8123%2Ffrontend%2Fpanels%2Falarm-001f97509c39e788542bd2b51deb052d.html.js%0A:0:0 Script error.
12:15 components/system_log/__init__.py (ERROR)
  1. stop your HA / sudo sytemctl stop home-assistant@homeassistant (or name what you put it)
  2. clear your browser cache and history from Google Chrome (recommend google chrome)
  3. delete your home-assistant-v2.db <== I cannot remember the exact name but the it is ***.db file.
  4. in panel_custom.yaml change the alarmid: alarm_control_panel.Home <== change to home <== no captital letter here
  5. all of your pir already supported in this alarm system so put # in front of below option

##[OPTIONAL] - 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:
# - ‘Detected’ #Motion & Smoke Detector
#custom_supported_statuses_off:
# - ‘Clear’ #Motion & Smoke Detector

  1. reboot your server. This will take a little longer to load HA because you have deleted ***.db file but everything clean from HA and browser.