YET another take on an alarm system

I can’t seem to get an actual list of sensors to watch to “stick” with the newUI. I just end up with a blank config in the alarm.yaml. If I edit this in the GUI, nothing happens, and if I edit it manually, it just erases it at the next boot. So I can’t actually set an alarm because nothing is being “watched” - I can turn the alarm on, but there’s no associated sensors.

states:
  armed_home:
    immediate: []
    delayed: []
    pending_time: 0
    override: []
    trigger_time: 600
    warning_time: 0

If I turn on the “sensor” panel block in the GUI, it’s just empty.

Same problem, but I don’t see these lines in these places. in v1.1.2 for example this is the first turn_on:

new_state = self._state
if old_state != new_state:
    _LOGGER.debug("[ALARM] Alarm changing from {} to {}".format(old_state, new_state))
    # Things to do on entering state
    if new_state == STATE_ALARM_WARNING:
        _LOGGER.debug("[ALARM] Turning on warning")
        if self._config.get(CONF_WARNING):
            self._hass.services.call("switch", "turn_on", {self._config.get(CONF_WARNING)})
        self._timeoutat = now() +  datetime.timedelta(seconds=int(self._states[self._armstate][CONF_WARNING_TIME]))
        self._update_log('', LOG.TRIPPED, self._lasttrigger)

I got this working, the trick was changing to:
self._hass.services.call(“switch”, “turn_on”, {‘entity_id’:self._config.get(CONF_WARNING)})
self._hass.services.call(“switch”, “turn_on”, {‘entity_id’:self._config.get(CONF_ALARM)})

at all locations which were previously:
self._hass.services.call(“switch”, “turn_on”, {self._config.get(CONF_WARNING)})
self._hass.services.call(“switch”, “turn_on”, {self._config.get(CONF_ALARM)})

(all different line numbers than noted in alexisromagnoli’s post)

Also as Alexis mentioned, the missing “break:” statements in alarm.html needed to be fixed as well.

I use the new ui. v 1.1.2
Please kindly advice on number 2
1.My activity page show wrong date and time. The date and time can be adjust in alarm.html
search for “computeLog(entry, type)” and re-correct to your time zone.

		computeLog(entry, type){
			switch (type){
				case 'time': 
					var t = new Date(entry[0] * 1000);
					return t.toLocaleString('en-GB', { timeZone: 'Asia/Bangkok' }).split(",")[1] + " - " + t.toLocaleString('en-GB', { timeZone: 'Asia/Bangkok' }).split(",")[0]; 
					break;
  1. I still have problem on Activity page for the information report which couldn’t read out the name of my sensor, binary_sensor “Alarm has been tripped! Sensor:” (which one is tripped?!?) as seen on picture attached.

Hello guys, is it possible to get the alarm panel in a card on the interface with Lovelace?

You can try by follow this Lovelace: Alarm card

I don’t know if this is also how the standard alarm component is behaving too, but I just realized if the alarm is armed home and an automation is trying to arm away it doesn’t do anything. I have to first disarm and then I can arm away.

Hi guys, how do I change the clock to 12 hr with AM/PM and the temperature sign from celsius to fahrenheit?.
Great project, worked right out of the box.

it you mean from alarm frontend. It is in the setting to show/hide clock with am/pm or 24 hr which read from sensor.time in ha. For temperature it read out from dark sky sensor. If your dark sky temp read out in F then show in alarm frontend with F.

Thank you for responding, which setting you are referring to?, maybe I’m missed something.
Do you mean alarm.yaml?

I assume that’s the new ui? , I have the regular one, mine looks different. Thank you for responding

I’m using new ui. On sensors page, the sensor checkboxes are not showing! Someone can help?

Hi Folks,

New release up. Apologies I’ve been away, work has taken over recently. A lot of fixes added. Still have the strange one with the checkboxes not appearing on sensors page. Please test and feedback.

In the near future I will be moving away from using polymer in favour of react. This will allow the panel to operate both inside of the HA panel and as a stand alone page. I’ve tested it on an old Samsung Galaxy tablet and it’s a lot faster, could be related to polymer.

Theres still work to do and I want to sort multi languages next for those that keep asking. Documentation also needs to be done.

5 Likes

We’ve missed you! I will test your new update this weekend and will report back to you.

1 Like

Not off to a good start:

Unable to find service alarm_control_panel/alarm_yaml_user

Do I need to change this in panel_custom.yaml?

# Location where the panel is hosted during development
js_url: http://192.168.0.2:8080/main.js

You need to clear all your alarm.yaml left only 2 lines / I didn’t use react so I didn’t add more in panel custom / my round buttons still need to set every time, the setting fro round buttons don’t remember what I set. / for clock 12 hr didn’t show am/pm so it hard to tell what time it is exactly.

##########################################################
## CUSTOM ALARM COMPONENT ALARM.YAML
## https://github.com/gazoscalvertos/Hass-Custom-Alarm
## VERSION:  1.0.2
## MODIFIED: 18/04/18
## CHANGE LOG:
## Add Multi Codes, names, pics        ##
## optional code to arm alarm          ##
## HG28!!&dn                           ##
#########################################

platform: bwalarm
name: youralarmname

I did that. I used the new alarm.yaml file provided in the repository. I replaced all the other files provided too.

Today I’m going to delete all the files and associated config. Restart. Then try adding the new blank files again.

In the settings part , sensors, I can’t add sensors, when added it shows a short checkmark but right away the box gets empty again and nothing is saved…

2018-11-24 00:22:09 ERROR (MainThread) [frontend.js.latest.201811033] https://xxxxxxxxxxxxxxxxx/local/lib/jscolor.js:532:50 TypeError: undefined is not an object (evaluating ‘e.path[0]’)

Ok so I deleted my previous files, restarted and followed the install instructions again. Restarted again.

I am now configuring the system (I am using Firefox 63.0.3).

Things of note as I go along (questions in italics):

Design Settings
I can’t set themes or it is covered by the bottom toolbar. Is this enabled yet? See below

Alarm Settings
The last “user specific code” is covered by the bottom toolbar and I cant scroll down any further.

Is the Homeassistant user required for automated arming/disarming? No it isn’t.

Sensor Settings
Sensor checkboxes do not stay checked. File save call is made. Nothing is written to alarm.yaml file. No sensors visible in the Sensors Panel. Edit: see below.

====

After setting up I restarted HA, still nothing viewable in the Sensors panel (Enable Sensors Panel switch is on).

I tried Chrome browser but could not log into the settings panel with either my set admin password or the default password. See below

Went back to firefox and the entry/exit times were not saved. I may not have hit the tick icon to save them. Tried again and they were saved to file.

Went back to add sensors and all the checkboxes next to the sensors had disappeared but clicking on the sensor name did make them turn orange and did save to the alarm.yaml file this time.

Sensor settings list is not sorted alphabetically. Should it be? It would be easier, all my alarm sensors are prefixed with ‘PIR’.

Tried shadow text effects. Did not like it so disabled it. Shadow effect still visible on clock - even after a restart. Does the clock always have the shadow effect?

Sensor Panel only shows ‘all sensors’. Can this be split into delayed and immediate, home and away?

Interestingly after a third restart the sensor settings checkboxes were back but they were not staying checked (when clicking on the text or checkbox) and nothing was being written to the alarm.yaml file again. Did a CTRL + F5, logged back into the settings and the checkboxes had disappeared again but changes were being saved to file. Something funny going on here.

Chrome was still not able to log in to the settings. It was making a system log write (https://10.1.1.100:8123/api/panel_custom/alarm:1869:9 Uncaught ReferenceError: sha256_digest is not defined) with every key press in the password field. Aha! That’s probably what the other two files not covered in the install instructions were - this needs to be added to the instructions.

Copied jscolor.js and sha256.js to config\www\lib but no apparent change. Did a CTRL + F5 and it now works with Chrome. Also I now have the ability to add a new theme in design settings in Chrome (other options may be hidden by the bottom toolbar). In Firefox the “new” button is nearly visible but mostly covered by the bottom toolbar. Can’t scroll down any further.

Firefox scrolled all the way down:

EDIT: Despite all this, I will say, Well done Gaz! It’s a fantastic custom component.

1 Like