From fd9ad29951c25b809cd2ed3821b1577d6ec58fca Mon Sep 17 00:00:00 2001 From: Jeroen ter Heerdt Date: Wed, 30 Aug 2017 16:55:42 +0200 Subject: [PATCH 1/3] Update alarm_control_panel.egardia.markdown --- .../alarm_control_panel.egardia.markdown | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/source/_components/alarm_control_panel.egardia.markdown b/source/_components/alarm_control_panel.egardia.markdown index c9a5e285652f..c60e0ae7d365 100644 --- a/source/_components/alarm_control_panel.egardia.markdown +++ b/source/_components/alarm_control_panel.egardia.markdown @@ -34,8 +34,8 @@ Configuration variables: - **password** (*Required*): Password for Egardia/Woonveilig account. - **port** (*Optional*): The port of the alarm panel. Defaults to 80. - **name** (*Optional*): Name to use for the alarm panel. Defaults to `Egardia`. -- **report_server_enabled** (*Optional*): Enable reporting by server. Defaults to `False`. -- **report_server_port** (*Optional*): Port of the Egardia server. Defaults to 85. +- **report_server_enabled** (*Optional*): Enable reporting by server (see advanced configuration below). Defaults to `False`. +- **report_server_port** (*Optional*): Port of the Egardia server (see advanced configuration below). Defaults to 52010. - **report_server_codes** list (*Optional*): List of codes for the different states. Note that this basic configuration will only enable you to read the armed/armed away/disarmed status of your alarm and will **not** update the status if the alarm is triggered. This is because of how Egardia built their system. The alarm triggers normally go through their servers. @@ -43,7 +43,7 @@ You can change this, however, using the following procedure. This is a more adva 1. Log in into your alarm system's control panel. You will need to access http://[ip of your control panel]. You know this already since you need it in the basic configuration from above. Log in to the control panel with your Egardia/Woonveilig username and password. 2. Once logged in, go to *System Settings*, *Report* and change the Server Address for your primary server to the IP or hostname of your Home Assistant machine. Also, update the port number 85 or to anything you like. The provided software that you will set up in the next steps runs on port 85 by default. **Make sure to change the settings of the primary server otherwise the messages will not come through. Note that this will limit (or fully stop) the number of alarm messages you will get through Egardia's / Woonveilig services.** Maybe, that is just what you want. Make sure to save your settings by selecting 'OK'. -3. On your Home Assistant machine run `$ sudo python3 egardiaserver.py`. This will receive status codes from your alarm control panel and display them. You will need the codes to include in your configuration.yaml. Make sure to change the status of your alarm to all states (disarm, arm, armhome) as well as trigger the alarm in all ways possible to get 100% coverage. **Before triggering the alarm it might be good to disable the siren temporarily (can be done in Panel Settings).** +3. On your Home Assistant machine run `$ sudo python3 egardiaserver.py`. Make sure to start this after activating your python virtual environment if you are using it. This will receive status codes from your alarm control panel and display them. You might have to pass in parameters such as hostname for your Home Assistant server, port number and password. Be sure to pass your password with '' if it has special characters. Run `$ python3 egardiaserver.py --help` for more info on this. You will need the codes to include in your configuration.yaml. Make sure to change the status of your alarm to all states (disarm, arm, armhome) as well as trigger the alarm in all ways possible to get 100% coverage. **Before triggering the alarm it might be good to disable the siren temporarily (can be done in Panel Settings).** 4. Once you have the codes, update your `configuration.yaml`: ```yaml # Example configuration.yaml entry @@ -53,7 +53,7 @@ alarm_control_panel:   username: YOUR_USERNAME   password: YOUR_PASSWORD report_server_enabled: True - report_server_port: PORT_OF_EGARDIASERVER (85 as per the instructions above) + report_server_port: PORT_OF_EGARDIASERVER (52010 as per the instructions above) report_server_codes: arm: XXXXXXXXXXXXXXXX disarm: XXXXXXXXXXXXXXXX @@ -67,4 +67,20 @@ alarm_control_panel: python3 [path/to/]egardiaserver.py & ``` **Do not forget the trailing & here; otherwise you will be having a hard time logging back into the machine.** + You can also use one of the methods mentioned here: https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/ or device your own. A sample shell script that can be used the init.d method and configures logging as well is shown below: +```bash +#!/bin/bash +# /etc/init.d/egardiaserver.sh +### BEGIN INIT INFO +# Provides: egardiaserver.sh +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start egardiaserver at boot time +# Description: Enable service provided by egardiaserver. +### END INIT INFO +source /srv/homeassistant/homeassistant_venv/bin/activate +python3 /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pythonegardia/egardiaserver.py -host [YOURHOST] -password '[YOURPASSWORD]' -ssl True > /tmp/egardiaserver.log 2>&1 +``` 6. Test your setup and enjoy. The component will update if the alarm status changes, including triggers. You can use this to build your own automations and send notifications as you wish. From 8c1a1b8751da83c837fb7531bbd83d546c2edb1c Mon Sep 17 00:00:00 2001 From: Jeroen ter Heerdt Date: Fri, 1 Sep 2017 10:53:02 +0200 Subject: [PATCH 2/3] Update alarm_control_panel.egardia.markdown --- .../alarm_control_panel.egardia.markdown | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/source/_components/alarm_control_panel.egardia.markdown b/source/_components/alarm_control_panel.egardia.markdown index c60e0ae7d365..7b59e5bb016c 100644 --- a/source/_components/alarm_control_panel.egardia.markdown +++ b/source/_components/alarm_control_panel.egardia.markdown @@ -34,8 +34,8 @@ Configuration variables: - **password** (*Required*): Password for Egardia/Woonveilig account. - **port** (*Optional*): The port of the alarm panel. Defaults to 80. - **name** (*Optional*): Name to use for the alarm panel. Defaults to `Egardia`. -- **report_server_enabled** (*Optional*): Enable reporting by server (see advanced configuration below). Defaults to `False`. -- **report_server_port** (*Optional*): Port of the Egardia server (see advanced configuration below). Defaults to 52010. +- **report_server_enabled** (*Optional*): Enable reporting by server. Defaults to `False`. +- **report_server_port** (*Optional*): Port of the Egardia server. Defaults to 85. - **report_server_codes** list (*Optional*): List of codes for the different states. Note that this basic configuration will only enable you to read the armed/armed away/disarmed status of your alarm and will **not** update the status if the alarm is triggered. This is because of how Egardia built their system. The alarm triggers normally go through their servers. @@ -43,7 +43,7 @@ You can change this, however, using the following procedure. This is a more adva 1. Log in into your alarm system's control panel. You will need to access http://[ip of your control panel]. You know this already since you need it in the basic configuration from above. Log in to the control panel with your Egardia/Woonveilig username and password. 2. Once logged in, go to *System Settings*, *Report* and change the Server Address for your primary server to the IP or hostname of your Home Assistant machine. Also, update the port number 85 or to anything you like. The provided software that you will set up in the next steps runs on port 85 by default. **Make sure to change the settings of the primary server otherwise the messages will not come through. Note that this will limit (or fully stop) the number of alarm messages you will get through Egardia's / Woonveilig services.** Maybe, that is just what you want. Make sure to save your settings by selecting 'OK'. -3. On your Home Assistant machine run `$ sudo python3 egardiaserver.py`. Make sure to start this after activating your python virtual environment if you are using it. This will receive status codes from your alarm control panel and display them. You might have to pass in parameters such as hostname for your Home Assistant server, port number and password. Be sure to pass your password with '' if it has special characters. Run `$ python3 egardiaserver.py --help` for more info on this. You will need the codes to include in your configuration.yaml. Make sure to change the status of your alarm to all states (disarm, arm, armhome) as well as trigger the alarm in all ways possible to get 100% coverage. **Before triggering the alarm it might be good to disable the siren temporarily (can be done in Panel Settings).** +3. On your Home Assistant machine run `$ sudo python3 egardiaserver.py`. This will receive status codes from your alarm control panel and display them. You will need the codes to include in your configuration.yaml. Make sure to change the status of your alarm to all states (disarm, arm, armhome) as well as trigger the alarm in all ways possible to get 100% coverage. **Before triggering the alarm it might be good to disable the siren temporarily (can be done in Panel Settings).** 4. Once you have the codes, update your `configuration.yaml`: ```yaml # Example configuration.yaml entry @@ -53,7 +53,7 @@ alarm_control_panel:   username: YOUR_USERNAME   password: YOUR_PASSWORD report_server_enabled: True - report_server_port: PORT_OF_EGARDIASERVER (52010 as per the instructions above) + report_server_port: PORT_OF_EGARDIASERVER (85 as per the instructions above) report_server_codes: arm: XXXXXXXXXXXXXXXX disarm: XXXXXXXXXXXXXXXX @@ -62,25 +62,24 @@ alarm_control_panel: standby: XXXXXXXXXXXXXXXX ``` Note that you can have more than one code for triggered since every sensor generates its own code. arm, disarm, armhome and standby will all be one code. -5. Start the `egardiaserver.py` script on boot of your Home Assistant machine, for example by adding the following to your `/etc/rc.local`: +5. Start the `egardiaserver.py` script on boot of your Home Assistant machine, for example by using systemd. To use this method, create a shell script named `egardiaserver.sh` that contains the following: ```bash - python3 [path/to/]egardiaserver.py & -``` - **Do not forget the trailing & here; otherwise you will be having a hard time logging back into the machine.** - You can also use one of the methods mentioned here: https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/ or device your own. A sample shell script that can be used the init.d method and configures logging as well is shown below: -```bash -#!/bin/bash -# /etc/init.d/egardiaserver.sh -### BEGIN INIT INFO -# Provides: egardiaserver.sh -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start egardiaserver at boot time -# Description: Enable service provided by egardiaserver. -### END INIT INFO source /srv/homeassistant/homeassistant_venv/bin/activate python3 /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pythonegardia/egardiaserver.py -host [YOURHOST] -password '[YOURPASSWORD]' -ssl True > /tmp/egardiaserver.log 2>&1 ``` + +Mark it as executable (`$ chmod +x`) and run `sudo nano /lib/systemd/system/egardiaserver.service`. Enter the following into the `egardiaserver.service` file: +```bash +[Unit] +Description=Egardia Server Service + +[Service] +ExecStart=/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pythonegardia/egardiaserver.sh +StandardOutput=journal+console + +[Install] +WantedBy=multi-user.target +Alias=egardiaserver.service +``` +Save and then run `sudo systemctl enable egardiaserver.service` and `sudo systemctl start egardiaserver.service`. 6. Test your setup and enjoy. The component will update if the alarm status changes, including triggers. You can use this to build your own automations and send notifications as you wish. From 0558df84a26bc26c1efce14b43582e3fe0e416cb Mon Sep 17 00:00:00 2001 From: Jeroen ter Heerdt Date: Mon, 4 Sep 2017 12:01:14 +0200 Subject: [PATCH 3/3] Update alarm_control_panel.egardia.markdown --- source/_components/alarm_control_panel.egardia.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/alarm_control_panel.egardia.markdown b/source/_components/alarm_control_panel.egardia.markdown index 7b59e5bb016c..e091c2d83b97 100644 --- a/source/_components/alarm_control_panel.egardia.markdown +++ b/source/_components/alarm_control_panel.egardia.markdown @@ -43,7 +43,7 @@ You can change this, however, using the following procedure. This is a more adva 1. Log in into your alarm system's control panel. You will need to access http://[ip of your control panel]. You know this already since you need it in the basic configuration from above. Log in to the control panel with your Egardia/Woonveilig username and password. 2. Once logged in, go to *System Settings*, *Report* and change the Server Address for your primary server to the IP or hostname of your Home Assistant machine. Also, update the port number 85 or to anything you like. The provided software that you will set up in the next steps runs on port 85 by default. **Make sure to change the settings of the primary server otherwise the messages will not come through. Note that this will limit (or fully stop) the number of alarm messages you will get through Egardia's / Woonveilig services.** Maybe, that is just what you want. Make sure to save your settings by selecting 'OK'. -3. On your Home Assistant machine run `$ sudo python3 egardiaserver.py`. This will receive status codes from your alarm control panel and display them. You will need the codes to include in your configuration.yaml. Make sure to change the status of your alarm to all states (disarm, arm, armhome) as well as trigger the alarm in all ways possible to get 100% coverage. **Before triggering the alarm it might be good to disable the siren temporarily (can be done in Panel Settings).** +3. On your Home Assistant machine run `$ sudo python3 egardiaserver.py`. Refer to the [python-egardia repository](https://github.com/jeroenterheerdt/python-egardia) for detailed documentation on parameters. This will receive status codes from your alarm control panel and display them. You will need the codes to include in your configuration.yaml. Make sure to change the status of your alarm to all states (disarm, arm, armhome) as well as trigger the alarm in all ways possible to get 100% coverage. **Before triggering the alarm it might be good to disable the siren temporarily (can be done in Panel Settings).** 4. Once you have the codes, update your `configuration.yaml`: ```yaml # Example configuration.yaml entry