Domoticz testing as alternative to Vera Controller

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.
Post Reply
gerardosamara
Posts: 33
Joined: Sunday 23 October 2016 19:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Contact:

Domoticz testing as alternative to Vera Controller

Post by gerardosamara » Sunday 30 October 2016 1:52

Hello ,

I have in mind in the future to migrate my Vera controllers (1 x VeraLite and 1 x VeraEdge in production + 1 x VeraLite for testing) to Domoticz so my primary goal is to first evaluate the Domoticz solution using a Win10 PC as I do not have a RPi .

The hardware configuration used for the test is based on the stable version 3.5.5837 installed on a Windows 10 PC with an USB300 ESP3 EnOcean dongle , an Arduino UNO MySensors serial GW and a Vera Controller as Z-Wave dongle.
Now it is the time to test Domoticz on the Rpi 3 platform with :

- Aeotec Z stick Gen5 (ZW090) ... https://s3.amazonaws.com/cdn.freshdesk. ... tion%2Fpdf
- Aeotec Smart switch Gen2 (DSC24) ... https://s3.amazonaws.com/cdn.freshdesk. ... tion%2Fpdf


[b][u]1) Raspbian Jessie installation on RPi 3 platform (Raspbian version 4.9.35-v7 ) [/u][/b]

- Download Raspbian Jessie and copy it on SD card Kingston 8GO 45Mb/s using Win32DiskImager (+ ssh file for ssh activation)
- Boot Rpi3 and login via Putty + raspi-config ( expand root file system and timezone Pacific/galapagos) + fixed IP
- Update the Rpi firmware (sudo apt-get update + sudo apt-get install rpi-update)
- Update ntp server config in /etc/ntp.conf ( replace ntp server debian.pool.ntp.org by pool.ntp.org )

[b][u]2) Domoticz installation & Setup (Version stable V3.8153) on RPi 3 platform) [/u][/b]

- Installation of Domoticz version 3.5877 stable (sudo curl -L install.domoticz.com | sudo bash)
- Setup of Domoticz ( Startup at boot , startup script , mail , pushbullet notification , backup)
- Change logrotate setup to daily period and 2 files of backlog in /etc/logrotate.conf , /etc/logrotate.d/rsyslog , /home/pi/domoticz/scripts/logrotate/domoticz
- Setup RAM drive of 10M in /etc/fstab for future Domoticz log (./var/log) + sudo mount -a
- Installation of Domoticz Lite Android App V0.1.408

[u][b]3) Imperihome GW "MyDomoAtHome" [/b][/u]

- nodejs version 0.10.29 outdated in raspbian jessie .
- Installation npm version 3.10.10
- installation nodejs version 6.11.2 , but the wiki Imperihome page needs to be updated :
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
- installation MyDomoAtHome GW version 0.2.8
- Integration of ImperiHome V3.0.1 with "MyDomoAtHome" GW

[b][u]4) UPS manager - Post #4 [/u][/b]

Installation of nut in Rpi (UPS manager)

- installation usbutils ( Integrated in Domoticz stable version v3.8153 )
- installation nut 2.7.2-4
- configuration nutclient in /etc/nut/nut.conf file (mode=standalone)
- configuration of the UPS Forza SL-761 in /etc/nut/ups.conf file (driver = blazer_usb)
- test of the UPS bash script : sudo upsc Forza_UPS

- Create virtual sensor UPS management (Input.Voltage)
- Create Virtual sensor UPS management ( Battery.Voltage)
- Create bash script "/home/pi/domoticz/scripts/ups.sh" to read UPS data and upload to Domoticz UPS virtual device
- Update the crontab to run the script every 5 mn (crontab -e)

[u][b]5) Motherboard Sensors hardware[/b][/u]

- Setup of Motherboard Sensors hardware
- Create the Rpi devices CPU usage , Internal temperature , Memory Usage , Hard Disk usage

[b][u]6) Monitoring internet speed - Post#'5 [/u][/b]

- Installation of speedtest-cli from github site
- Find the test server reference number using speedtest command for future use in the monitoring script
- Create virtual devices ( Ping , Download , Upload)
- Create the internet monitoring bash script to update the virtual devices
- Update crontab to run the script every 5 mn

[u][b]7) MyDomoticz - Domoticz remote access - Post #7[/b][/u]

To use the "MyDomoticz" remoe access service , a registration is required use the service .

- Configuration in the settings page , MyDomoticz section
- Log in "https://my.domoticz.com"
- Click on the connection icn


[u][b]8) House mode - Post#6[/b][/u]

"House Mode" security switch in order to have an alarm/automation system setup according presence in the house

- Create a selector switch "House Mode"
- Assign level names Disarm,Home , Away,Night and Vacation to the selector switch
- Assign level actions with housemode python script to the selector switch
- Create a python script per house mode ( housemode_disarm , .) with the necessary actions
- Make the python scripts as executable using chmod +x

[b][u]9) Zwave network[/u][/b]

- Installation and setup of Zwave+ controller Aeotec Z stick Gen5 added (ZW090) - Version: 1.4-2501-g5af6780-dirty (/dev/ttyACM0)
- Inclusion and setup of smart switch DSC24 Gen2 ZW120

[b][u]10) EnOcean network[/u][/b]

- Installation EnOcean controller ESP3 ( /dev/ttyUSB0 )

[b][u]11) Misceallenous[/u][/b]

- Installation of the SQLite manager ( SQLite Expert Personal ) and sqlite3_analyser.exe tool )


[u]2) ToDoList [/u]

- Test Scène avec Lua
- Geofence
- Events using Lua
- Sonos Player1
- MySensors Serial GW (Arduino)
- Caméra IP
- IR remote control
- Availability of EnOcean devices
- Availability of weather sensor
- Availability of MySensors devices
- Availability of Utility sensor
- Availablilty of IR remote control
- Rsyslog
- Fail2ban app to monitor Domoticz failed login attemps
- System Alive Checker
- Weather forecast


[u]3) Bug closure :[/u]

- PR#1: Node Js version 0.10.29 outdated in Raspbian jessie
- PR#2 : Nut log error "raspberrypi kernel: [79755.044507] usb 1-1.5: usbfs: USBDEVFS_CONTROL failed cmd blazer_usb rqt 33 rq 9 len 8 ret -110" about every 5s
- PR#3 : Missing alarm panel part in the github TODO list (house mode change). Only the display of the status of the Domoticz alarm panel is supported , impossible to change the alarm mode ).
- PR#5 : "Normal" status in the Domoticz security panel to be changed to "Disarm"
Last edited by gerardosamara on Sunday 27 August 2017 17:28, edited 179 times in total.
Domoticz RPi3 V3.8153 + App Android Domoticz Lite V0.1.408 & Imperihome Pro V2.8.4
Zwave+ Z Stick Z90 USB dongle + USB300 Ocean GW dongle + Arduino Serial GW
Smart witch Aeotec DSC24 Gen2

gerardosamara
Posts: 33
Joined: Sunday 23 October 2016 19:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Contact:

Re: Domoticz testing as alternative to Vera Controller

Post by gerardosamara » Tuesday 01 November 2016 18:11

Domoticz screenshots

Domoticz dashboard
Dz_dashboardsecurity panel.png
Dz_dashboardsecurity panel.png (127.59 KiB) Viewed 1222 times
Last edited by gerardosamara on Wednesday 01 February 2017 1:41, edited 6 times in total.
Domoticz RPi3 V3.8153 + App Android Domoticz Lite V0.1.408 & Imperihome Pro V2.8.4
Zwave+ Z Stick Z90 USB dongle + USB300 Ocean GW dongle + Arduino Serial GW
Smart witch Aeotec DSC24 Gen2

gerardosamara
Posts: 33
Joined: Sunday 23 October 2016 19:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Contact:

Re: Domoticz testing as alternative to Vera Controller

Post by gerardosamara » Sunday 06 November 2016 18:28

HARDWARE ( CONTROLLERS AND DEVICES)

1) VeraLite Zwave controller

A spare Veralite is available for use as a Zwave controller with its zwave devices shown as virtual sensors.
The configuration required is Vera as Master and Domoticz as Slave in order to get informations froms devices like sensors , power switch etc
The current limitation is that no action can be sent to Zwave devices like wall switch etc. ( http://www.domoticz.com/wiki/VERA )
This hardware is unusable for a production application

Hardware : Aeon Labs Z-Stick Z-Wave Plus Gen5 ZW090-A

An USB Z-Stick Zwave Plus has been added to support zwave devices

13/01/2017 : Aeon Z-Stick Zwave Plus received

2017-01-14 16:13:44.188 OpenZWave: Starting...
2017-01-14 16:13:44.203 OpenZWave: Version: 1.4-2228-gbce4a88-dirty
2017-01-14 16:13:44.203 OpenZWave: using config in: /home/pi/domoticz/Config/
2017-01-14 16:13:44.442 OpenZWave: Driver Ready
2017-01-14 16:13:44.458 OpenZWave: All Nodes queried


Hardware : EnOcean USB300 ESP3 dongle

04/01/2017 : USB300 integrated in hardware section

2017-01-05 02:33:27.033 EnOcean: Using serial port: /dev/ttyUSB0
2017-01-05 02:33:27.034 EnOcean Send: 55 00 01 00 05 70 08 38
2017-01-05 02:33:27.034 EnOcean Send: 55 00 01 00 05 70 03 09
2017-01-05 02:33:27.109 EnOcean: 02 (05/01) 00 FF F1 93 00 0A
2017-01-05 02:33:27.109 EnOcean: Transceiver ID_Base: 0xfff19300
2017-01-05 02:33:27.309 EnOcean: 02 (21/00) 00 02 08 02 00 02 04 04 00 01 85 E3 26 45 4F 01 03 47 41 54 45 57 41 59 43 54 52 4C 00 00 00 00 00
2017-01-05 02:33:27.309 EnOcean: Version_Info, App: 02.08.02.00, API: 02.04.04.00, ChipID: 01.85.e3.26, ChipVersion: 45.4f.01.03, Description: GATEWAYCTRL

2) Smart switch DSC24 Gen2 ZW120
Last edited by gerardosamara on Tuesday 15 August 2017 17:42, edited 5 times in total.
Domoticz RPi3 V3.8153 + App Android Domoticz Lite V0.1.408 & Imperihome Pro V2.8.4
Zwave+ Z Stick Z90 USB dongle + USB300 Ocean GW dongle + Arduino Serial GW
Smart witch Aeotec DSC24 Gen2

gerardosamara
Posts: 33
Joined: Sunday 23 October 2016 19:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Contact:

Re: Domoticz testing as alternative to Vera Controller

Post by gerardosamara » Wednesday 04 January 2017 22:45

UPS MANAGER


1) Virtual switch "UPS input.voltage" and "UPS battery.voltage"

To read the input voltage of the UPS using nut ( to monitor the stability of input AC from electricity company
To read the battery voltage of the UPS using nut ( to monitor the load of the battery)

The nut application has been installed in the Rpi (UPS manager) and the ups test is performed by the command sudo upsc Forza_UPS

- installation usbutils ( Integrated in Domoticz stable version v3.8153 )
- installation nut
- configuration nutclient in /etc/nut/nut.conf file (mode=standalone)
- configuration of the UPS Forza SL-761 in /etc/nut/ups.conf file (driver = blazer_usb)
- test of the UPS bash script : sudo upsc forza

To setup the ups management :

- Create virtual sensor ups in Domoticz ( inverter and battery input voltage )
- Create bash script "/home/pi/domoticz/scripts/ups.sh" to read UPS data and upload to Domoticz UPS virtual device
- Update the crontab to run the script every x mn (crontab -e)


--- bash script ups.sh ------

#!/bin/sh
# Settings
DOMO_IP="192.168.1.xxx" # Domoticz IP Address
DOMO_PORT="8080" # Domoticz Port
UPSINVOLT_IDX="1" # Virtual switch UPS INPUT VOLTAGE
UPSBATVOLT_IDX="2" # Virtual switch UPS BATTERY VOLTAGE
LOGIN="xxxx"
PASSWORD="yyyyy"
UPS_INVOLT=`upsc Forza_UPS 2>&1 | grep -v '^Init SSL' | grep 'input.voltage:' | awk '{print $NF}'`
UPS_BATVOLT=`upsc Forza_UPS 2>&1 | grep -v '^Init SSL' | grep 'input.voltage:' | awk '{print $NF}'`
#echo $UPS_INVOLT
#echo $UPS_BATVOLT
# Upload to Domoticz
curl "http://$LOGIN:[email protected]$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$UPSINVOLT_IDX&nvalue=0&svalue=$UPS_INVOLT" > /dev/null 2>&1
curl "http://$LOGIN:[email protected]$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$UPSBATVOLT_IDX&nvalue=0&svalue=$UPS_BATVOLT" > /dev/null 2>&1

------------
Last edited by gerardosamara on Tuesday 15 August 2017 0:52, edited 5 times in total.
Domoticz RPi3 V3.8153 + App Android Domoticz Lite V0.1.408 & Imperihome Pro V2.8.4
Zwave+ Z Stick Z90 USB dongle + USB300 Ocean GW dongle + Arduino Serial GW
Smart witch Aeotec DSC24 Gen2

gerardosamara
Posts: 33
Joined: Sunday 23 October 2016 19:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Contact:

Re: Domoticz testing as alternative to Vera Controller

Post by gerardosamara » Tuesday 10 January 2017 20:39

MONITORING INTERNET SPEED

- Installation of speedtest-cli from github site
- Find the test server reference number using speedtest command for future use in the monitoring script (speedtest-cli --list | grep –i Costa Rica)
- Create virtual devices ( Ping , Download , Upload)
- Create the internet monitoring bash script "speedtest.sh" to update the virtual devices
- Test the internet monitoring script by command "speedtest"
- Update crontab to run the script every 5 mn

------------------------------------------
#!/bin/bash
speedtest-cli --server 4442 --share --simple > st_results_simple # Kolbi San Jose
#sleep 2m
cut -d' ' -f 2 st_results_simple > st_result_cut
#sed -e "s/ //g" st_result_cut > st_result_cutnospace


# variable recup fichier cut
PING=$(sed -n '1 p' st_result_cut)
DOWN=$(sed -n '2 p' st_result_cut)
UP=$(sed -n '3 p' st_result_cut)

echo $PING
echo $DOWN
echo $UP


# envoie info domoticz
curl 'http://192.168.1.150:8080/json.htm?type ... lue='$PING
curl 'http://192.168.0.10:8080/json.htm?type= ... lue='$DOWN
curl 'http://192.168.0.10:8080/json.htm?type= ... value='$UP
-------------------------------------
Last edited by gerardosamara on Friday 18 August 2017 1:33, edited 22 times in total.
Domoticz RPi3 V3.8153 + App Android Domoticz Lite V0.1.408 & Imperihome Pro V2.8.4
Zwave+ Z Stick Z90 USB dongle + USB300 Ocean GW dongle + Arduino Serial GW
Smart witch Aeotec DSC24 Gen2

gerardosamara
Posts: 33
Joined: Sunday 23 October 2016 19:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Contact:

Re: Domoticz testing as alternative to Vera Controller

Post by gerardosamara » Sunday 22 January 2017 17:00

HOUSE MODE

The "Security Modes" of Domoticz ( Disarm , Arm Home , Arm Away) allows to automate multiple functions according the presence of persons in the house but the alarm panel is partially supported in the Imperihome gateway "MyDomoAtHome" ( it means display the status of the Domoticz alarm panel but no change Arm Home , Arm Away , Disarm).
The work around proposed by @mlamie is to use a selector swith instead to handle the house mode function .

1) Under setup - hardware include the Dummy device, this allows you to create dummy devices
2) Press create virtual sensor and type a name (i used AlarmActive) and select Switch as sensor type
3) Under setup - devices , you will find the Dummy device created and also it will be shown as a Switch (AlarmActive)
4) Create a new event "HouseMode"as shown below in the Domoticz screenshot
5) Arm and disarm the alarm is set via a selector switch in the dashboard or android apps Domoticz Lite and ImperiHome

The house mode can be changed from the Domoticz dashboard or from the Android App Domoticz and Imperihome using the switch selector created to handle actions (python script) according the house mode ( Disarm , Arm home , Arm Away , Arm Night , Arm Vacation) :


All modes
- On house mode change , Print to Log , send email , send Pushbullet notification for user information
Mode « Disarm »
- De-activate the IP camera motion sensors by a http request to the camera API
- Change the house mode to Arm Away at 6PM if still "Disarm" or "Arm Home"
Mode « Arm Home»
- Activate the IP camera motion sensors of the perimeter of the house (basement) by a http request to the camera API
Mode «Arm Away»
- Activate all the IP camera motion sensors by a http request to the camera API
Mode «Arm Night»
- Activate all the IP camera motion sensors by a http request to the camera API
Mode «Arm Vacation»
- Activate all the IP camera motion sensors by a http request to the camera API

Screenshot
House mode selector switch.PNG
House mode selector switch.PNG (21.28 KiB) Viewed 392 times
Screenshot
House mode actions.PNG
House mode actions.PNG (68.32 KiB) Viewed 392 times
------------ HouseMode Python script , Disarm example--------------

#
# Le script python 'housemode_disarm.py utilise l'interface JSON pour le dialogue avec les devices
# event = disarm button from house_mode_selector_switch
# 1) dsc24_switch Off
# 2) send email
# 3) send notification pusbullet
# ......
#
#----------- Modules import
import requests
import json
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.header import Header
#~~~~~~~~~~ Parameters Domoticz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
debug = True
domoticz_ip_port='192.168.1.xxx:8080'
dz_user=''
dz_password=''
idx_dcs24_switch = '1'
idx_housemode_selector_switch = '8'
from_email = "[email protected]"
to_email = "[email protected]"
smtp_password = "xxxxxx"
pb_access_token = 'xxxxxxxxxxxxxxxxx'
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if debug : print "House mode script : Start Disarm mode"
# ------- Json url pour log domoticz
requete='http://'+domoticz_ip_port+'/json.htm?type=command&param=addlogmessage&message=---------- housemode_disarm.py script : start ----------'
if debug : print requete
result=requests.get (requete).json
if debug : print result
# ------- 1) Json url pour action Off sur switch dsc24
requete = 'http://'+domoticz_ip_port+'/json.htm?type=command&param=switchlight&idx='+idx_dcs24_switch+'&switchcmd=Off'
if debug : print requete
result=requests.get (requete).json
if debug : print result
# ------- 2) smtplib pour envoi email
msg = MIMEMultipart()
msg['From'] = from_email
msg['To'] = to_email
msg['Subject'] = "House Mode : Disarm"
body = "House Mode Disarm activated"
msg.attach(MIMEText(body, 'plain'))
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(from_email, smtp_password)
text = msg.as_string()
server.sendmail(from_email, to_email, text)
server.quit()
# ------- 3) Json url pour envoi notification pusbullet
title = "House Mode : Disarm"
body = "House Mode Disarm activated"
data_send = {"type": "note", "title": title, "body": body}
result = requests.post('https://api.pushbullet.com/v2/pushes', data=json.dumps(data_send), headers={'Authorization': 'Bearer ' + pb_access_token , 'Content-Type': 'application/json'})
if debug : print result
# ------- Json url pour log domoticz
requete='http://'+domoticz_ip_port+'/json.htm?type=command&param=addlogmessage&message=---------- housemode_disarm.py script : End ----------'
if debug : print requete
result=requests.get (requete).json
if debug : print result
if debug : print "House mode script : End "
#---------------------------------------------------------------
Last edited by gerardosamara on Tuesday 22 August 2017 4:11, edited 22 times in total.
Domoticz RPi3 V3.8153 + App Android Domoticz Lite V0.1.408 & Imperihome Pro V2.8.4
Zwave+ Z Stick Z90 USB dongle + USB300 Ocean GW dongle + Arduino Serial GW
Smart witch Aeotec DSC24 Gen2

gerardosamara
Posts: 33
Joined: Sunday 23 October 2016 19:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Contact:

Re: Domoticz testing as alternative to Vera Controller

Post by gerardosamara » Thursday 09 February 2017 20:06

MyDomoticz - Remote access service

The MyDomoticz service allows for accessing Domoticz remotely via internet, without having the need of opening public external http ports in the internet router.
Registration is required use the service

To setup the service in Domoticz from the settings page and then the MyDomoticz section , fill the API key field with the user ID received in the registration email , the password and then "apply settings".

To connect to the service , log in "https://my.domoticz.com" and a dashboard is displayed when connected , with an icon to connect to Domoticz .
Domoticz RPi3 V3.8153 + App Android Domoticz Lite V0.1.408 & Imperihome Pro V2.8.4
Zwave+ Z Stick Z90 USB dongle + USB300 Ocean GW dongle + Arduino Serial GW
Smart witch Aeotec DSC24 Gen2

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests