-
Notifications
You must be signed in to change notification settings - Fork 22
Home
#Introduction# [https://play.google.com/store/apps/details?id=com.imperihome.lite Imperihome] is a smart phone application that integrates natively with several domoticz systems. A Generic REST API has been made available for other systems to integrate themselves with it.
The below procedures are made to provide a gateway that will permit a user to use the smartphone app with Domoticz.
The Gateway will act as an interface between domoticz and Imperihome, so that Imperihome can interact with the Gateway, that will in return interract with Domoticz.
There will be a Client (ImperiHome), a protocolar gateway (The gateway below) and the Server (Domoticz). The gateway will be a REST/Web server with its own IP:port to be chosen and to be different from Domoticz if it runs on the same server.
{|style="margin: 0 auto;" | File:Screenshot_2014-06-20-19-47-48-200px.jpg | File:Screenshot_2014-06-20-19-47-53-200px.jpg |}
- all switches (but no arm, no ack as not available in DZ)
- all temp/humidity/weather/uv/pressure sensors
- all utilities
- all scenes
- rooms have been mapped upon DZ tabs for more clarity
- basic thermostat setpoint as in DZ
Please remember that unix scripts need the execution right and read right.
Please remember that a script starts on the first with the interpreter path, line without any space which should be for Perl : #!/usr/bin/perl
If you run the gateway on a different server than domoticz, add it in the setup so it won't require login/password if you have set so.
Support in English: [http://domoticz.com/forum/viewtopic.php?f=31&t=6619&p=43787#p43787] Support in French: [http://easydomoticz.com/forum/viewtopic.php?f=12&t=573]
cd ~/domoticz/ git clone https://github.com/empierre/MyDomoAtHome MyDomoAtHome cd MyDomoAtHome cp config.yml.def config.yml cp production.yml.def production.yml cp development.yml.def development.yml
The url has to be changed by your domoticz system address/port (replace 192.168.0.24 by your IP and 8080 by your port): *development.yml *production.yml *config.yml
Also edit MyDomoAtHome.sh and change the path line 20 to your home installation, and then run this script to install dependencies and install the service at startup:
sh ./run-once.sh
If you want to change the default port (5001) please do so in the MyDomoAtHome.sh .
To start the service:
sudo service MyDomoAtHome.sh start
To stop the service :
sudo service MyDomoAtHome.sh stop
To restart the service :
sudo service MyDomoAtHome.sh reload
In a web browser call the url:
http://gateway_ip:gateway_port/devices
'''If the result does not show devices, please remember to allow access without password to the gateway IP within Domoticz Settings.'''
In another tab call those url:
http://domoticz_ip:domoticz_port/json.htm?type=devices&filter=all&used=true&order=Name
http://domoticz_ip:domoticz_port/json.htm?type=scenes
http://domoticz_ip:domoticz_port/json.htm?type=cameras (for this one, please change login/pass if any... don't post it as it on public forum...)
In the first you'll get what Imperihome will see, in the second what Domoticz provide. In case you need support in the [http://www.domoticz.com/forum/viewtopic.php?f=5&t=2713 Forum], please include both and send the domoticz.db to domoticz AT e-nef.com.
You can now add a device within the Imperihome app: *go to parameters / My Systems / Add a system *select Imperihome Standard System *type in your gateway base url your_ip:port then next and finished !
Simply run the following command in the MyDomoAtHome directory:
sh ./update-mdah.sh
The best way is to setup the nginx for both domoticz and the gateway: http://www.domoticz.com/wiki/Secure_Remote_Access
In the domoticz configuration add a section to redirect to the gateway such as this (change your ip below), and create a .htpasswd for both (using htpasswd from package apache2-utils => htpasswd -c .htaccess YOURusername YOURpasswd)
location /iss/ {
proxy_pass http://192.168.0.28:5001/;
auth_basic "Access Restricted";
auth_basic_user_file "/etc/nginx/.htpasswd";
access_log /var/log/nginx/domoticz.access.log;
error_log /var/log/nginx/domoticz.error.log;
}