Python script for Netatmo weather station

Python and python framework

Moderator: leecollings

User avatar
krazny
Posts: 27
Joined: Saturday 01 November 2014 23:31
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Python script for Netatmo weather station

Post by krazny »

hfbilly wrote:I can confirm this as well. The following call with fails. Note the url below is used by the netatmo script to update the value.

http://192.168.178.31:8080/json.htm?typ ... value=21.2
{
status: "ERR"
}

the following is successfull

http://192.168.178.31:8080/json.htm?typ ... .2&idx=206
{
status: "OK",
title: "Update Device"
}

I have been trying to see if i can get the idx in there but unfortunately the only thing i know about python is they live in the zoo ;-)
In v2.2532 this problem is solved..
Unfortunately, my problem with getting the values from Netatmo are still present. :(
The values won't update.
Raspberry Pi, Aeon Z-Stick, Fibaro Motion Sensor, 4x Fibaro Wall Plug, 2x Fibaro Dimmer, Netatmo Weatherstation
multinet
Posts: 97
Joined: Friday 05 December 2014 22:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by multinet »

Hello

Is the v2.2532 available for raspberry ? i have no update avail inbeta mode (i'm currently 2.2531)

Thanks !
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
brakc
Posts: 28
Joined: Friday 13 March 2015 12:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by brakc »

RFAH wrote:Hallo,

I also had the problem that my sensors in Domoticz recieved no values.
Also no error was shown.

However, recently Netatmo only accepts https calls and does not support http anymore.
In the netatmo.py script, there are two records with http (line 20 and 21 in my script). I changed that to https and my problem was solved.
Hope this will do the trick for you as well.

I did not have the problem that my settings where gone.
netatmo.py ==> change with https OK
token.xml ==> generation OK
netatmo_settings.xml
- with my credential and password, generation is OK. Good communication with API because all Netatmo devices are present in file with good mac adress.
- verification hardware ID : ==> OK, my virtual device is really 5

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" : "",
         "Type" : 15,
         "Username" : "",
         "idx" : "5"
      },
- set

Code: Select all

domoticz_dev_id="xxxxx"
==> OK, all id are single number

Code: Select all

<domoticz hardware_id="5" url="http://127.0.0.1:8080" /><devices>
<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" />
</devices>
crontab
*/5 * * * * python /home/domoticz/scripts/netatmo.py & ==> OK

Domoticz configuration
- release : 2533
- I delete all my old virtual devices, all is clean
- execute "python netatmo.py" via ssh ==> no error but KO, no new device generated in Domoticz

Any suggestion please?

Fab
multinet
Posts: 97
Joined: Friday 05 December 2014 22:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by multinet »

krazny wrote:
hfbilly wrote:I can confirm this as well. The following call with fails. Note the url below is used by the netatmo script to update the value.

http://192.168.178.31:8080/json.htm?typ ... value=21.2
{
status: "ERR"
}

the following is successfull

http://192.168.178.31:8080/json.htm?typ ... .2&idx=206
{
status: "OK",
title: "Update Device"
}

I have been trying to see if i can get the idx in there but unfortunately the only thing i know about python is they live in the zoo ;-)
In v2.2532 this problem is solved..
Unfortunately, my problem with getting the values from Netatmo are still present. :(
The values won't update.
Hello i've updated to 2534 and I still have an error executing the netatmo python script at the time to transfert measure :
pi@DomoticzTEST ~/domoticz/scripts $ python ./netatmonew.py
http://localhost:8080/json.htm?type=com ... 0&nvalue=0
Error in TransferMeasures

did and hid are correct

Any idea to help me ?

Thanks a lot
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
User avatar
Mediacj
Posts: 74
Joined: Wednesday 11 February 2015 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Python script for Netatmo weather station

Post by Mediacj »

Thanks there is progress but I get the exact same error on 2534: Error in TransferMeasures

When I place the generated URL from netatmo.py in the webbrowser I get a connection timeout:
http://192.168.178.75:8080/json.htm?typ ... nvalue=418
RFAH
Posts: 15
Joined: Monday 16 March 2015 11:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6395
Location: Netherlands
Contact:

Re: Python script for Netatmo weather station

Post by RFAH »

I have version 2.2534 installed and it is working again (except the rain sensor, but that did never work at all)

@ brakc
Maybe a stupid question, but did you allow Domoticz to add new devices?
(Settings -> settings -> system -> accept new hardware/sensors)

@multinet
I did have that problem when i needed to login in Domoticz .
So i removed the login for my internal network. (not the best solution, but it did solve the problem)
brakc
Posts: 28
Joined: Friday 13 March 2015 12:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by brakc »

RFAH wrote: @ brakc
Maybe a stupid question, but did you allow Domoticz to add new devices?
(Settings -> settings -> system -> accept new hardware/sensors)
yes it's selected ;)
RFAH wrote: @multinet
I did have that problem when i needed to login in Domoticz .
So i removed the login for my internal network. (not the best solution, but it did solve the problem)
+1
multinet
Posts: 97
Joined: Friday 05 December 2014 22:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by multinet »

Hello

Well I need you help to know why my netatmo in domoticz is like this :

Idx Matériel ID Unit Nom Type Sous-type Donnée Niveau du signal RF Niveau de batterie Dernier contact
71 NETATMO 000F 2 Humidité Jardin Humidity Unknown Humidity 49 % 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:08:22
12 NETATMO 90003 1 Pression Air Salon General Pressure 1021.3 Bar 12 - Supprimer le dispositifRenommer le dispositif 2015-06-09 00:08:21
68 NETATMO 15F91 1 Température Salon Temp TFA 30.3133 26.8 C 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:08:21
69 NETATMO 000F 1 Humidité Salon Humidity Unknown Humidity 47 % 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:08:21
70 NETATMO 000F 2 Température Jardin Temp TFA 30.3133 22.1 C 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:08:21
77 NETATMO 82065 1 Noise General Sound Level 0 dB 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:08:21
74 NETATMO 82072 1 Air Qualité Air Quality Unknown 0 ppm 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:00:10

My settings :

Code: Select all

<settings>
   <authentication client_id="xxxxxx" client_secret="xxxxxxx" password="xxxxxx" username="[email protected]" />
   <domoticz hardware_id="6" url="http://127.0.0.1:8080" />
   <devices>
   <device data_type="Temperature" domoticz_dev_id="90001" domoticz_dev_subtype="10" domoticz_dev_type="80" id="xxxxx" module_id="" />
   <device data_type="CO2" domoticz_dev_id="" domoticz_dev_subtype="0" domoticz_dev_type="249" id="xxxxx" module_id="" />
   <device data_type="Noise" domoticz_dev_id="82065" domoticz_dev_subtype="24" domoticz_dev_type="243" id="xxxxx" module_id="" />
   <device data_type="Humidity" domoticz_dev_id="15F92" domoticz_dev_subtype="0" domoticz_dev_type="81" id="xxxxx" module_id="" />
   <device data_type="Pressure" domoticz_dev_id="90003" domoticz_dev_subtype="9" domoticz_dev_type="243" id="xxxxx" module_id="" />

   <device data_type="Temperature" domoticz_dev_id="15F95" domoticz_dev_subtype="10" domoticz_dev_type="80" id="xxxxxxx" module_id="yyyyyy" />
   <device data_type="Humidity" domoticz_dev_id="15F96" domoticz_dev_subtype="0" domoticz_dev_type="81" id="xxxxxxxx" module_id="yyyyyy" /> 
   </devices>

My questions are :
1- why there is multiple same ID (000F) in domoticz and why is it upadate correctly whereas in the setting it is not the same ID (and if i change it in setting it recreate a new hardware)
2- why my Air Quality and Noise are created by the script but not updated (value for Noise and not updated at all for Air Quality (see date/time upadte)

Thank you for your explanations :)

Multinet
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
User avatar
Mediacj
Posts: 74
Joined: Wednesday 11 February 2015 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Python script for Netatmo weather station

Post by Mediacj »

Mediacj wrote:Thanks there is progress but I get the exact same error on 2534: Error in TransferMeasures

When I place the generated URL from netatmo.py in the webbrowser I get a connection timeout:
http://192.168.178.75:8080/json.htm?typ ... nvalue=418
It works again, I had a wrong ip adres and I still can use the login for Domoticz.
User avatar
Mediacj
Posts: 74
Joined: Wednesday 11 February 2015 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Python script for Netatmo weather station

Post by Mediacj »

multinet wrote:Hello

Well I need you help to know why my netatmo in domoticz is like this :

Idx Matériel ID Unit Nom Type Sous-type Donnée Niveau du signal RF Niveau de batterie Dernier contact
71 NETATMO 000F 2 Humidité Jardin Humidity Unknown Humidity 49 % 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:08:22
12 NETATMO 90003 1 Pression Air Salon General Pressure 1021.3 Bar 12 - Supprimer le dispositifRenommer le dispositif 2015-06-09 00:08:21
68 NETATMO 15F91 1 Température Salon Temp TFA 30.3133 26.8 C 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:08:21
69 NETATMO 000F 1 Humidité Salon Humidity Unknown Humidity 47 % 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:08:21
70 NETATMO 000F 2 Température Jardin Temp TFA 30.3133 22.1 C 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:08:21
77 NETATMO 82065 1 Noise General Sound Level 0 dB 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:08:21
74 NETATMO 82072 1 Air Qualité Air Quality Unknown 0 ppm 12 - Supprimer le dispositifRenommer le dispositif Log 2015-06-09 00:00:10

My settings :

Code: Select all

<settings>
   <authentication client_id="xxxxxx" client_secret="xxxxxxx" password="xxxxxx" username="[email protected]" />
   <domoticz hardware_id="6" url="http://127.0.0.1:8080" />
   <devices>
   <device data_type="Temperature" domoticz_dev_id="90001" domoticz_dev_subtype="10" domoticz_dev_type="80" id="xxxxx" module_id="" />
   <device data_type="CO2" domoticz_dev_id="" domoticz_dev_subtype="0" domoticz_dev_type="249" id="xxxxx" module_id="" />
   <device data_type="Noise" domoticz_dev_id="82065" domoticz_dev_subtype="24" domoticz_dev_type="243" id="xxxxx" module_id="" />
   <device data_type="Humidity" domoticz_dev_id="15F92" domoticz_dev_subtype="0" domoticz_dev_type="81" id="xxxxx" module_id="" />
   <device data_type="Pressure" domoticz_dev_id="90003" domoticz_dev_subtype="9" domoticz_dev_type="243" id="xxxxx" module_id="" />

   <device data_type="Temperature" domoticz_dev_id="15F95" domoticz_dev_subtype="10" domoticz_dev_type="80" id="xxxxxxx" module_id="yyyyyy" />
   <device data_type="Humidity" domoticz_dev_id="15F96" domoticz_dev_subtype="0" domoticz_dev_type="81" id="xxxxxxxx" module_id="yyyyyy" /> 
   </devices>

My questions are :
1- why there is multiple same ID (000F) in domoticz and why is it upadate correctly whereas in the setting it is not the same ID (and if i change it in setting it recreate a new hardware)
2- why my Air Quality and Noise are created by the script but not updated (value for Noise and not updated at all for Air Quality (see date/time upadte)

Thank you for your explanations :)

Multinet
See this post for the Noise value you have to change the netatamo.py for it:
http://www.domoticz.com/forum/viewtopic ... =40#p36381

In my version of netatmo.py it is on line 453
multinet
Posts: 97
Joined: Friday 05 December 2014 22:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by multinet »

Hello

Big Thanks ! I've my noise value back in domiticz ;)

any idea for the air quality ?

Have a great evening
Multinet
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
RFAH
Posts: 15
Joined: Monday 16 March 2015 11:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6395
Location: Netherlands
Contact:

Re: Python script for Netatmo weather station

Post by RFAH »

Hello Multinet,

Have you checked that CO is written in capitals?
Not only in your settings it needs to be written in capitals (which it already is), but also in the Netatmo script
A line (line 54 in my script) needs to be changed into

Code: Select all

DATATYPE_CO2 = 'CO2'
Maybe it is written in lower-case letters

see alo the following post
http://www.domoticz.com/forum/viewtopic ... =40#p36381
multinet
Posts: 97
Joined: Friday 05 December 2014 22:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by multinet »

Hello

Excellent ! Many Thanks
it was Co2 in my python script instead of CO2 :)

Last question : I was using TempHumBaro (for inside) and TempBaro (for outside) before. Is there a way to continu to use it ?

Have a great day

Multinet
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
RFAH
Posts: 15
Joined: Monday 16 March 2015 11:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6395
Location: Netherlands
Contact:

Re: Python script for Netatmo weather station

Post by RFAH »

Multinet wrote:Last question : I was using TempHumBaro (for inside) and TempBaro (for outside) before. Is there a way to continu to use it ?
I'm not sure what you mean.
If you were using it with Netatmo before, i think that you can use it again.
But please explain your problem.
brakc
Posts: 28
Joined: Friday 13 March 2015 12:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by brakc »

Hello,

I'm in 2533 in Debian via Proxmox VM.
I d'ont understand because my Graph in Domoticz doesn't generate since 1st june.

I think my API Netatmo it's OK because netatmo_settings.xml is correctly generate with correct MAC adresse of all my devices.
I custom same this:

Code: Select all

<domoticz hardware_id="5" url="http://127.0.0.1:8080" /><devices>
<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" />
</devices>
fyi : hardware_id is correct = 5

One idea please?
richardh
Posts: 15
Joined: Sunday 25 January 2015 19:50
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands, Roermond
Contact:

Re: Python script for Netatmo weather station

Post by richardh »

The netatmo URL's changed to https:// instead of http:// And update to the latest version of domoticz beta channel.
brakc
Posts: 28
Joined: Friday 13 March 2015 12:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by brakc »

richardh wrote:The netatmo URL's changed to https:// instead of http:// And update to the latest version of domoticz beta channel.
perfect in 2548, thank you Richardh ;)
brandon
Posts: 1
Joined: Sunday 19 April 2015 13:37
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by brandon »

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&param=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.

Code: Select all

ls
show you your 2 files netatmo.py and netatmo_setting.xml. enter

Code: Select all

chmod +x ./netatmo.py
give to right to the file to be execute.

10) enter the command

Code: Select all

python netatmo.py
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

Code: Select all

python netatmo.py
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
Attachments
netatmo.py.zip
(4.11 KiB) Downloaded 119 times
netatmo_settings.xml.zip
(811 Bytes) Downloaded 109 times
User avatar
gizmocuz
Posts: 2363
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Python script for Netatmo weather station

Post by gizmocuz »

There is now native support for netatmo in domoticz from the hardware page
.... i'm not sure if the rain gauge is working 100%, maybe someone can look at this...
(Also big thanks to Seb)
Quality outlives Quantity!
fwehrle
Posts: 41
Joined: Tuesday 11 February 2014 18:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for Netatmo weather station

Post by fwehrle »

gizmocuz wrote:There is now native support for netatmo in domoticz from the hardware page
.... i'm not sure if the rain gauge is working 100%, maybe someone can look at this...
(Also big thanks to Seb)
Nice news. I'll give it à try asap. Thank you.
Post Reply

Who is online

Users browsing this forum: jvdz and 1 guest