YET another take on an alarm system

Thank you for replying. It’s odd; whenever I do javascript_version: auto, the frontend shows correctly on PC but not on iOS. When I click the HA info button, on PC it shows “latest” for the version, but “es5” on iOS (Safari & Chrome) and then throws an error when I go to the Alarm. I’ll clear the cache as you suggested and even restart my phone (just to be sure) with the same issue.

I’m curious; which iOS device are you using?

You could also use loop. I copied this code from another member. I have 14 seconds delay to start because I have another TTS going on before the siren so you need to reduce the seconds to your need.

xiaomi_alarm_siren:
  alias: Xiaomi Alarm Siren
  sequence:
  - delay:
      seconds: 2
  - service: xiaomi_aqara.play_ringtone
    data_template:
      ringtone_id: 1
      ringtone_vol: 95
      gw_mac: xx:
  - delay:
#### time for siren to play before restarting
      seconds: 14
  - service: script.turn_on
    data:
      entity_id: script.xiaomi_alarm_siren_loop

# LOOP BACK TO START SIREN AGAIN
xiaomi_alarm_siren_loop:
  alias: Xiaomi Alarm loop
  sequence:
  - delay:
#### time for siren to start
      seconds: .1
  - service: script.turn_on
    data:
      entity_id: script.xiaomi_alarm_siren
# CANCEL Siren when Disarm - refer to Automation
xiaomi_alarm_siren_cancel:
  alias: Cancel Siren Cancel
  sequence:
  - delay:
      seconds: 1
  - service: script.turn_off
    data:
      entity_id: script.xiaomi_alarm_siren
  - service: xiaomi_aqara.stop_ringtone
    data:
      gw_mac: xx:
2 Likes

Oh great thanks. I didn’t know about that one.
That should suit :slight_smile:

Although I put javascript_version: auto in configuration / On my pc ha frontend also show latest.

I use latest ios version (not developer version) on iphone 6 plus and iphone 7 plus. If I change to javascript_version: latest I have problem on my iphone 7 plus.

i use node red and trigger the xiaomi siren more times after some delays.

hello, because of the restart problem I leave you some details. As you will see in the images there are two, one before the restart and another after restarting the raspberry. the sensors go from active to inactive.
provisionally we have been able to fix that with an automation for each mode.
type like this:

  • alias: reinicio ha modo AWAY
    trigger:
    • event: start
      platform: homeassistant
      condition:
    • condition: state
      entity_id: alarm_control_panel.house
      state: ‘armed_away’
      action:
    • service: alarm_control_panel.alarm_disarm
    • delay: 00:00:03
    • alias: ‘’
      service: alarm_control_panel.alarm_arm_away!
      the first photo is after the restart and the second before the restart

I have the same issue and it’s utterly annoying, I have tried everything and then I give up for a couple of months. I am at it again today but man…heh

So does Lovelace change everything and push back the release date?

2 Likes

For some reason I keep getting errors that point to line 175 of the alarm.html.

	updateTime(hass){
		if (this.alarm.attributes.clock){
			this.time = this.hass.states['sensor.time'];
			if (this.time == null){
				this.error("Time Sensor (sensor.time) not found in HA");

It says that there is a problem with this.alarm and that it is undefined.
“TypeError: this.alarm is undefined 175:1”

I cleared cache in the browsers I tested, updated to the latest alarm.html but still getting the same error.

I feel like I’ve come so far to just pull the plug on the whole thing and give up.

Any help would be greatly appreciated

You need to have date and time sensor in HA so that it can be display in your alarm system.

Do I add this to alarm.yaml or configuration.yaml? I have this in configuration.yaml, currently.

reading the time&date link you were provided it says:
To enable this sensor in your installation, add the following to your configuration.yaml file:

I think it should go in your configuration.yaml unless you have a separate sensor.yaml file where you have all your sensors then i would put it there.

1 Like

add to configuration.yaml under sensor platform, can be individual file if you have sensor.yaml then the alarm will read from ha

1 Like

Ok so I have it in the right place then, spelling correct as provided.

I have had this in the configuration.yaml file for almost a month now, but I still get the error

check from entity_id page that you have sensor.time

or hide the clock in alarm.yaml
clock: False

I can confirm that I do have sensor.time as a listed entity

Try left the clock: False and see if the the alarm system works.

I set the clock to false but the error remains

check what is the error.