I think this post need some summary for Synology users to install netatmo script to use in domoticz :
Before, you will have netatmo station working and an account in netatmo website !
1) install python package in packages center
2) go in domoticz setting/system to allow "create new hardware device". Don't forgot to apply change !
3) create a user account in
https://dev.netatmo.com/ ->create an app with your already have netatmo account.
This create en API account to use with domoticz and give you : client id, client secret, request token url, authorize url.
4) download netatmo.py and netatmo_settings.xml in attachments.
5) create virtual switch in domoticz using : http://192.168.X.X:80XX/json.htm?type=command¶m=addhardware&htype=15&port=1&name=NetAtmo&enabled=true or create in manual in domoticz virtual switch for dummy.
be carrefour with your socket. mine is
http://192.168.X.X:8084 for domoticz. Remplace with your own domoticz ip address.
6) check if virtual switch appear right with http://192.168.X.X:80XX/json.htm?type=hardware
you will see :
Code: Select all
{
"Address" : "",
"DataTimeout" : 0,
"Enabled" : "true",
"Mode1" : 0,
"Mode2" : 0,
"Mode3" : 0,
"Mode4" : 0,
"Mode5" : 0,
"Mode6" : 0,
"Name" : "NetAtmo",
"Password" : "",
"Port" : 1,
"SerialPort" : "1",
"Type" : 15,
"Username" : "",
"idx" : "6"
}
idx is your hardware id to use in netatmo_setting
7) edit netatmo_settings.xml and complete client_id=, client_secret=, password=, username=, hardware_id= and url=.
You have client_id and client_secret from netatmo api. password and user name is your password and username from netatmo account. hardware_id is your idx result and url= is your localhost with the right port 80XX to access domoticz
8) Now you have to transfer netatmo.py and netatmo_setting.xml in your synology. You can use winscp for windows and duck for mac users. login in root with your synology password. You have to transfert this two files in /var/packages/domoticz/scripts.
9) With terminal console or others ssh tools, connect in root and go to /var/packages/domoticz/scripts.
show you your 2 files netatmo.py and netatmo_setting.xml. enter
give to right to the file to be execute.
10) enter the command
to run once. You have now a new file name "token" in /var/packages/domoticz/scripts if the link between netatmo and domoticz is ok.
11) open the netatmo_setting.xml with text editor and you see some new code between <devices></devices>
Code: Select all
<device data_type="Temperature" domoticz_dev_id="90001" domoticz_dev_subtype="10" domoticz_dev_type="80" id="xx:xx:xx:xx:xx:xx" module_id="" />
<device data_type="CO2" domoticz_dev_id="90002" domoticz_dev_subtype="0" domoticz_dev_type="249" id="xx:xx:xx:xx:xx:xx" module_id="" />
<device data_type="Humidity" domoticz_dev_id="90003" domoticz_dev_subtype="0" domoticz_dev_type="81" id="xx:xx:xx:xx:xx:xx" module_id="" />
<device data_type="Noise" domoticz_dev_id="90004" domoticz_dev_subtype="24" domoticz_dev_type="243" id="xx:xx:xx:xx:xx:xx" module_id="" />
<device data_type="Pressure" domoticz_dev_id="90005" domoticz_dev_subtype="9" domoticz_dev_type="243" id="xx:xx:xx:xx:xx:xx" module_id="" />
<device data_type="Temperature" domoticz_dev_id="90006" domoticz_dev_subtype="10" domoticz_dev_type="80" id="xx:xx:xx:xx:xx:xx" module_id="xx:xx:xx:xx:xx:xx" />
<device data_type="Humidity" domoticz_dev_id="90007" domoticz_dev_subtype="0" domoticz_dev_type="81" id="xx:xx:xx:xx:xx:xx" module_id="xx:xx:xx:xx:xx:xx" />
<device data_type="Temperature" domoticz_dev_id="90008" domoticz_dev_subtype="10" domoticz_dev_type="80" id="xx:xx:xx:xx:xx:xx" module_id="xx:xx:xx:xx:xx:xx" />
<device data_type="CO2" domoticz_dev_id="90009" domoticz_dev_subtype="0" domoticz_dev_type="249" id="xx:xx:xx:xx:xx:xx" module_id="xx:xx:xx:xx:xx:xx" />
<device data_type="Humidity" domoticz_dev_id="90010" domoticz_dev_subtype="0" domoticz_dev_type="81" id="xx:xx:xx:xx:xx:xx" module_id="xx:xx:xx:xx:xx:xx" />
<device data_type="Rain" domoticz_dev_id="90011" domoticz_dev_subtype="0" domoticz_dev_type="85" id="xx:xx:xx:xx:xx:xx" module_id="xx:xx:xx:xx:xx:xx" />
You have to fill domoticz_dev_id= like here, domoticz_dev_subtype like here and domoticz_dev_type like here. id is already fill with netatmo station mac.
12) run one more
and now go to domoticz devices list. If all are good, you see the new netatmo devices.
13) At last, go to synology setting in task schedule and add a new task netatmo with the following
Code: Select all
python /var/packages/domoticz/scripts/netatmo.py
. Schedule each five minutes, daily from 0:00 to 23:55
There is a new netatmo.py to use that correct https connections and add noise and air quality measures. It's the right ones in attachments.
that's all folk. I hope this can help you in each step