AlarmSystem with appdaemon

I thought the system also detects when no devices are at home and then it arms automaticaally?.. it used to work before but somehow just one day to another it stopped woring… like I said : Onlyy not_home > home change is recognized :frowning:

Hmm that’s strange I will upload a new version in the next days. This works for me with the latest release. It also supports some new features.

Cool I’ll wait then … do I mind sharing the new features as well ?

The biggest feature is that the telegram image sending now works with a folder watcher listener. In my case I have combined that with the image processing component. Which means you only get meaningful pictures. It also supports image processing as an alarm sensor. I have just committed the file to my GitHub repo.

is it normal that the armed_home or armed_away sensor won’t show up in log?

2019-10-02 15:52:33.732454 INFO AppDaemon: Initializing app alarm_system using class AlarmSystem from module alarm
2019-10-02 15:52:33.733928 INFO alarm_system: Hello from AlarmSystem
2019-10-02 15:52:33.735266 INFO alarm_system: Got armed_home sensors []
2019-10-02 15:52:33.736410 INFO alarm_system: Got armed_away sensors []
2019-10-02 15:52:33.737304 INFO alarm_system: Got device trackers ['device_tracker.phone_emilie', 'device_tracker.phone_thorsten', 'device_tracker.phone_evan']
2019-10-02 15:52:33.738404 INFO alarm_system: Got 1 device_trackers home and 2 device_trackers not home
2019-10-02 15:52:33.739304 INFO alarm_system: Got guest_mode False
2019-10-02 15:52:33.740193 INFO alarm_system: Got vacation_mode False
2019-10-02 15:52:33.741069 INFO alarm_system: Got silent mode False
2019-10-02 15:52:33.742000 INFO alarm_system: Got info volume 10
2019-10-02 15:52:33.742883 INFO alarm_system: Got alarm volume 100
2019-10-02 15:52:33.743716 INFO alarm_system: Got notify service notify.thorsten
2019-10-02 15:52:33.744686 INFO alarm_system: Got alarm state disarmed

So I tested again and there’s something strange. I still get the home recognition by the app but not not_home

2019-10-02 15:52:33.732454 INFO AppDaemon: Initializing app alarm_system using class AlarmSystem from module alarm
2019-10-02 15:52:33.733928 INFO alarm_system: Hello from AlarmSystem
2019-10-02 15:52:33.735266 INFO alarm_system: Got armed_home sensors []
2019-10-02 15:52:33.736410 INFO alarm_system: Got armed_away sensors []
2019-10-02 15:52:33.737304 INFO alarm_system: Got device trackers ['device_tracker.phone_emilie', 'device_tracker.phone_thorsten', 'device_tracker.phone_evan']
2019-10-02 15:52:33.738404 INFO alarm_system: Got 1 device_trackers home and 2 device_trackers not home
2019-10-02 15:52:33.739304 INFO alarm_system: Got guest_mode False
2019-10-02 15:52:33.740193 INFO alarm_system: Got vacation_mode False
2019-10-02 15:52:33.741069 INFO alarm_system: Got silent mode False
2019-10-02 15:52:33.742000 INFO alarm_system: Got info volume 10
2019-10-02 15:52:33.742883 INFO alarm_system: Got alarm volume 100
2019-10-02 15:52:33.743716 INFO alarm_system: Got notify service notify.thorsten
2019-10-02 15:52:33.744686 INFO alarm_system: Got alarm state disarmed
2019-10-02 15:58:28.283738 INFO alarm_system: Callback alarm_disarm_auto from device_tracker.phone_thorsten:state not_home->home
2019-10-02 15:58:28.285203 INFO alarm_system: Ignoring status home of device_tracker.phone_thorsten because alarm system is in state disarmed

Dunno why but all of sudden it seems to work …

2019-10-02 15:52:33.733928 INFO alarm_system: Hello from AlarmSystem
2019-10-02 15:52:33.735266 INFO alarm_system: Got armed_home sensors []
2019-10-02 15:52:33.736410 INFO alarm_system: Got armed_away sensors []
2019-10-02 15:52:33.737304 INFO alarm_system: Got device trackers ['device_tracker.phone_emilie', 'device_tracker.phone_thorsten', 'device_tracker.phone_evan']
2019-10-02 15:52:33.738404 INFO alarm_system: Got 1 device_trackers home and 2 device_trackers not home
2019-10-02 15:52:33.739304 INFO alarm_system: Got guest_mode False
2019-10-02 15:52:33.740193 INFO alarm_system: Got vacation_mode False
2019-10-02 15:52:33.741069 INFO alarm_system: Got silent mode False
2019-10-02 15:52:33.742000 INFO alarm_system: Got info volume 10
2019-10-02 15:52:33.742883 INFO alarm_system: Got alarm volume 100
2019-10-02 15:52:33.743716 INFO alarm_system: Got notify service notify.thorsten
2019-10-02 15:52:33.744686 INFO alarm_system: Got alarm state disarmed
2019-10-02 15:58:28.283738 INFO alarm_system: Callback alarm_disarm_auto from device_tracker.phone_thorsten:state not_home->home
2019-10-02 15:58:28.285203 INFO alarm_system: Ignoring status home of device_tracker.phone_thorsten because alarm system is in state disarmed
2019-10-02 16:29:15.375565 INFO alarm_system: Callback alarm_arm_away_auto from device_tracker.phone_thorsten:state home->not_home
2019-10-02 16:29:15.499459 INFO alarm_system: Calling service alarm_control_panel/alarm_arm_away
2019-10-02 16:29:15.571619 INFO alarm_system: Callback alarm_state_from_disarmed_to_pending from alarm_control_panel.ha_alarm:state disarmed->pending
2019-10-02 16:29:15.874729 INFO alarm_system: Starting flash warning timer with color yellow and brightnes 50
2019-10-02 16:29:16.578663 INFO alarm_system: Flash warning count 1
2019-10-02 16:29:17.463076 INFO alarm_system: Flash warning count 2
2019-10-02 16:29:18.604702 INFO alarm_system: Flash warning count 3
2019-10-02 16:29:19.416741 INFO alarm_system: Flash warning count 4
2019-10-02 16:29:20.463890 INFO alarm_system: Flash warning count 5
2019-10-02 16:29:21.930427 INFO alarm_system: Flash warning count 6
2019-10-02 16:29:22.545548 INFO alarm_system: Flash warning count 7
2019-10-02 16:29:23.468024 INFO alarm_system: Flash warning count 8
2019-10-02 16:29:24.582229 INFO alarm_system: Flash warning count 9
2019-10-02 16:29:26.502050 INFO alarm_system: Flash warning count 10
2019-10-02 16:29:27.625448 INFO alarm_system: Flash warning count 11
2019-10-02 16:29:28.559414 INFO alarm_system: Flash warning count 12
2019-10-02 16:29:29.543899 INFO alarm_system: Flash warning count 13
2019-10-02 16:29:30.546383 INFO alarm_system: Flash warning count 14
2019-10-02 16:29:31.551772 INFO alarm_system: Flash warning count 15
2019-10-02 16:29:32.478412 INFO alarm_system: Flash warning count 16
2019-10-02 16:29:33.580120 INFO alarm_system: Flash warning count 17
2019-10-02 16:29:34.550956 INFO alarm_system: Flash warning count 18
2019-10-02 16:29:36.010113 INFO alarm_system: Flash warning count 19
2019-10-02 16:29:36.540434 INFO alarm_system: Flash warning count 20
2019-10-02 16:29:37.544258 INFO alarm_system: Flash warning count 21
2019-10-02 16:29:38.477668 INFO alarm_system: Flash warning count 22
2019-10-02 16:29:39.524624 INFO alarm_system: Flash warning count 23
2019-10-02 16:29:40.463517 INFO alarm_system: Flash warning count 24
2019-10-02 16:29:41.586116 INFO alarm_system: Flash warning count 25
2019-10-02 16:29:42.490635 INFO alarm_system: Flash warning count 26
2019-10-02 16:29:43.480678 INFO alarm_system: Flash warning count 27
2019-10-02 16:29:44.508312 INFO alarm_system: Flash warning count 28
2019-10-02 16:29:45.963893 INFO alarm_system: Flash warning count 29
2019-10-02 16:29:46.046397 INFO alarm_system: Callback alarm_state_armed_away from alarm_control_panel.ha_alarm:state pending->armed_away
2019-10-02 16:29:46.071204 INFO alarm_system: Stopping flash warning timer
2019-10-02 18:37:34.286677 INFO alarm_system: Callback alarm_disarm_auto from device_tracker.phone_thorsten:state not_home->home
2019-10-02 18:37:34.287521 INFO alarm_system: Calling service alarm_control_panel/alarm_disarm
2019-10-02 18:37:34.304969 INFO alarm_system: Callback alarm_state_disarmed from alarm_control_panel.ha_alarm:state armed_away->disarmed

The config changed a bit you have to rename the sensors to armed_home_binary_sensors and armed_away_binary_sensors

This was necessary in order to support additional sensors.

I also think about adding these features:

  • Auto arm home if all devices are at home and after 10pm und disarm at 6am… Time can be configured
  • Additional sensors support for fire and water which would trigger alarm even in disarmed state
  • Vacuum cleaner support which would disable indoor sensors during cleaning
  • Video recording support (I did some tests which did not work well if anybody is able to record a video and send it via telegram please send me a pm, my video did not contain the full length)
  • scene and script support for each alarm state

BTW. I have also a telegram bot for which used to work fine but doesn’t work with the latest ha releases

1 Like

First: Thanks fir the hint to rename the sensors :stuck_out_tongue: my bad.

I like the idea of vacuum cleaner support. I was also facing this problem but was then thinking: To trigger a sensor INSIDE my home they would have to pass a door or window which is equipped with sensors also. So this feature might be overkill or for people without window / door sensors.
I don’t use telegram but XMPP as I wanna host all services my own. It works well to record and send a video (with scripts etc). If you want you can register an acc on my server to test. PM me for details :slight_smile:

For arm_home I use a xiaomi button on my bed. Once we go to bed we put this button as this also turns off ALL lights TV and puts my system like in night mode.

The ere are sooo many attempts to archieve automations… but I am now more interested in appdaemon apps… they are shorter to program and easier to manage.

I*ll switch all my automations (light, climate etc) to appdaemon. Do you have some useful links with interesting appdaemon apps?

The sensors inside have some value, for example if somebody would jam the zigbee stuff my poe camera senors with image processing would still trigger. Also the battery of the door sensor might be empty before other sensors are empty.

I have a few other apps which take care of heat, light and power control:



Feel free to test them. I have migrated most of my stuff to appdaemon because I do not like the native automations…

I will get back to you concerning the video stuff in the future.

Here you can find a lot of repos from people using appdaemon

Plus my own one (which is also in the above link haha)

Thanks…already watched this. I what I’m missing is a real light control with luminance sensor and/or sun tracker … occupation and brightness. A whole bunch of configurable options

Unfortunately I’m binded to appdaemon 3 for the moment du to hassio but wanna setup a second instance with docker …is that possible? Normally yes right ?

I have all this integrated into my light control, however you can’t just copy/paste my code :slight_smile:
Why not write your own light control app?

Appdaemon 3 shouldn’t be a problem, I’m using it as well.

I am not a programmer at all… reading code or writing it will break my head :stuck_out_tongue: but I understand a bit and can apadt present code to my needs so far

Me neither :wink: There are some very good tutorials to get started writing your own apps in the AppDaemon section of the forum.

Also check out this custom component to control lights. It was originally in AppDaemon, but the developer then decided to make it an own component.

I am too stupid to set this up… I added the files to custom_components and mae a basic config entry in my configuration.yaml. but i get error custom_component entity_controller not found is there a write-up how to install this app? where or what do i have to install?

I think you should be able to add it via HACS

Otherwise I would suggest you post your issue in the thread of the and they will be able to help you set this up.

o yeah!! i Just added the repo to hacs and it is installed :slight_smile: thanks mate!

But I still miss a kind of COnditon like luminace sensor … I can’t figure out how i can make it with those app

My light app supports luminace sensors…

For real ? Didn’t see could you please update your config examples …this is what I need infact …