YET another take on an alarm system

Well, the only possible error from configuration.yaml is:

alarm_control_panel: !include alarm.yaml
panel_custom: !include panel_custom.yaml

So weird :thinking:

How do you know?

Oops! I forgot that clearing cache often help w/ these. I should have done that. Thank you! That fixed it.

Well, I removed Hass Custom Alarm configuration details in configuration.yaml and related installation files:

alarm_control_panel: !include alarm.yaml
panel_custom: !include panel_custom.yaml

And include Manual Alarm Control Panel configuration details in configuration.yaml:

alarm_control_panel:

  • platform: manual
    name: Home Alarm
    code: 1234
    pending_time: 2
    trigger_time: 10

System log did not appear this error log and displays the default alarm panel as per expected.

Now I also confused which part is going wrong :thinking:

Well, there should be something regarding this alarm it the log if itā€™s not configured properly.
Could you double check that your logger is set up with default: warning?

Will revert back if I found anyhings on my logger.

Thanks.

For everyone trying to get debug information in log - read this

1 Like

Just posted a thread here on how people are handling babysitters/dog walkers etc. Just letting everyone know in case anyone has any top tips. I am using a router device tracker to monitor for babysitters. Itā€™s far from ideal.

The location tracker is already working. Thats not my question.
I want to combine that with a code panel and also want the alarm arming and disarming when the code panel is active.
Sorry for my english :wink:

Maybe some of you have recently noticed that the alarm panel stopped to show error messages if it fails to start.
Here is a PR Iā€™d recommend everyone to apply to their code. Any comments about that are welcome.

This alarm panel has alarm_arm_home, alarm_arm_away, alarm_disarm services.
Search this thread, there are examples how to use it.

Hi Everybody,

I tried tonight to move the HASS Alarm into its own folder (bwalarm), but ever since doing that, the alarm panel component wonā€™t load. Iā€™ve implemented all of the recommended tweaks outlined here and also here, but so far Iā€™m still getting the error.

My Lovelave frontend says:

The error in my log looks like this:

{myHAdomain}/api/panel_custom/alarm:2092:41 Uncaught TypeError: Cannot read property 'state' of undefined

Line 2092 of alarm.html looks like this:

if (instance.alarm.state != 'disarmed')

Perhaps I dropped a character (such as a semicolon at the end of the line?), maybe Iā€™m looking in the wrong place, or maybe something completely different is wrong. Any help is much appreciated.

Just to add on to this, I added a ; to the end of the line above, restarted, and there was no change.

I also noticed the following error when HA tries to setup the bwalarm platform:

Error while setting up platform bwalarm
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/asyncio/coroutines.py", line 120, in coro
    res = func(*args, **kw)
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 316, in async_setup_platform
    alarm = BWAlarm(hass, config, mqtt)
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 341, in __init__
    self.init_variables()
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 441, in init_variables
    self.immediate  = self._states[self._state]["immediate"]
KeyError: 'disarmed'

And I did work through the suggested tweaks from @AhmadK in the post above from 4 days ago.

Again any help is appreciated.

Ok, letā€™s start.

  1. Dod your alarm work properly before you moved it so we can surely say that move is the reason of your troubles, or not quite?

  2. this

is most likely the result of ā€œEntity not availableā€ as it tries to accesses entityā€™s property.

isnā€™t it this? look here

Thanks for your reply.

The alarm panel was working as expected before the move to the new folder.

I went back and checked my alarm_control_panel.py, and it turns out that I was using the version from Github without the persistence fix. That must have happened when I moved the file. Thanks for catching that.

I updated with the persistence fix, and now Iā€™m not seeing:

File ā€œ/config/custom_components/bwalarm/alarm_control_panel.pyā€, line 441, in init_variables self.immediate = self._states[self._state][ā€œimmediateā€] KeyError: ā€˜disarmedā€™

in my logs. I am, however, still seeing:

{myHAdomain}/api/panel_custom/alarm:2092:41 Uncaught TypeError: Cannot read property ā€˜stateā€™ of undefined

and it has me a bit confused. The error on the frontend:

still remains unchanged. Any additional thoughts?

I suppose I could go back to everything from the Github except for the persistence fix, since that was what was working before. Is that what you would suggest?

Edit: Quick update: after another restart, the alarm component now loads (!) - with the keypad display, which was missing before

However, the:

{myHAdomain}/api/panel_custom/alarm:2092:41 Uncaught TypeError: Cannot read property ā€˜stateā€™ of undefined

Still seems to be filling up my logā€¦

Thanks.

clear your cache and restart browser. restart HA

Unfortunately, the cannot read state of ā€˜undefinedā€™ errors are continuing despite restarting HA and clearing browser cache. The alarm seems to work (arm/disarm) etc.

But Iā€™d definitely still appreciate any help for getting to the bottom of the issue. Thanks.

please post here your log

If you are able to run appdaemon this is the way to go
No manual intervention required, Alarm system enabled and disabled based on presence

As it turns out the errors were coming from cached data on one of my wall tablets, and clearing the cache seemed to address the situation.

On another note though, I have a bit of concern about updating to 0.89 when a core piece of my setup depends on the Hass Alarm custom component.

Has anyone updated to 0.89 smoothly? What were the keys to have in place to avoid borking/fubaring your alarm? Thanks.

I had the same few months ago and now know the rule :wink:

yep. make a backup of your HA and roll it back if anything goes wrong.