Netatmo: Difference between revisions

From Domoticz
Jump to navigation Jump to search
Walter vl (talk | contribs)
m beta - 2024.1
 
Walter vl (talk | contribs)
mNo edit summary
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
NETATMO Thermostat & Thermostatic radiator valve
== About Netatmo Hardware ==
Features supported:
* Temperature sensor,
* Set point switch,
* "away" mode switch,
* Heating Status Switch,
* Temperature & Humidity Sensor,
* Barometer Sensor,
* Rain Sensor,
* Air QUality Sensor,
* Sound Sensor,
* Wind Sensor,
* Alert Sensor for Security Events,
 
== New Installation ==
Be sure you have enabled "Accept new Hardware Devices" in menu Setup - Settings
 
 
 
New Netatmo Authentication method implemented from 2024.1
 
'''NOTE:''' In Domoticz beta 2025.1 changes have been made to adapt to latest Netatmo authorisation changes. So if you have issues in an older Domoticz version update to latest beta 2025
 
 
Log in on dev.netatmo.com (<nowiki>https://dev.netatmo.com/</nowiki>)
 
On dev.netatmo.com you create an App.
 
The Redirect URI should contain the IP and port of the Domoticz server. If you run into issues later on you can try to leave the Redirect URI field empty.
 
The Webhook URI should be empty.
[[File:Netatmo-app-changed.png|none|frame]]
 
 
 
Press save 2 times.
 
This gives you the <code>Clientid</code> and <code>Clientsecret</code>
 
 
 
 
On the Hardware page from Domoticz (menu Setup - Hardware):
 
* Hardware Type: Netatmo.
 
*Name: This is the name you want for your Hardware module.
*  Log level: Leave default
*  Data Timeout: leave default
* Client ID: <code>Client ID</code> obtained from Netatmo Development Site
* Client Secret: <code>Client Secret</code> obtained from Netatmo Development Site.
* Scope: Select here the Scope for your Netatmo Devices, make sure you only select scopes compatible with your devices!
 
[[File:Netatmo-2.png|none|frame]]
 
 
 
Press Button '''Login'''.
 
You can Login to Netatmo with E-mail and Password. (If you are already Login in you get directly to the Accept page.)
[[File:Netatmo-app2.png|none|frame]]
 
 
You see a configuration screen from Netatmo.
[[File:Netatmo-app3.png|none|frame]]
 
 
Then the Accept Page is displayed, You scroll to the bottom.
[[File:Netatmo-app4.png|none|frame]]
[[File:Netatmo-app5.png|none|frame]]
 
 
 
And press '''Accept'''.
 
This closes the window and when everything is correct the plugin works, Netatmo device will be added to Domoticz.
 
In menu Setup - Devices the connected devices should be shown (can take some time)
 
'''NOTE:''' Do '''NOT''' click on the '''ADD''' button to add the hardware as this is not working for Netatmo Hardware.
 
 
 
If you get a message that nothing is selected:
 
You can select the Netatmo Hardware line and press the '''Login''' button.
 
 
== With an existing Netatmo installation from older version ==
New Netatmo Authentication method implemented from 2024.1
 
'''NOTE:''' In Domoticz beta 2025.1 changes have been made to adapt to latest Netatmo authorisation changes. So if you have issues in an older Domoticz version update to latest beta 2025
 
 
Be sure you have enabled "Accept new Hardware Devices" in menu Setup - Settings
 
 
 
On the Hardware page from Domoticz menu Setup - Hardware
 
Select the Netatmo Hardware Gateway line
 
Fill in <code>Clientid</code> and <code>clientsecret</code>
 
Select the correct scope(s) for your devices (see for reference screenshots in new install)
 
Press Button '''Login'''.
 
You can Login to Netatmo with E-mail and Password. (If you are already Login in you get directly to The accept page.
 
You see a configuration screen from Netatmo.
 
Then the Accept Page is displayed, You scroll to the bottom.
 
And press '''Accept'''.
 
This closes the window and when everything is correct the plugin works.
 
== Enabling/Disabling Hardware gateway ==


Features supported:


*Temperature sensor
When you want to disable the gateway you select the Hardware Line on the Hardware page from Domoticz.
*Set point switch
*"away" mode switch


Install<span> </span>:
Switch the Enable button to Red and press '''Update'''


*Enable "Accept new Hardware Devices" in Setup/Setting
*Add a "Netatmo" Hardware in Setup/Hardware. Input your Netatmo login and password. 5 minutes Data Timeout(not sure about that).
*Turned the Thermostat up and down via the iPhone app and it showed up in Domoticz!
*In Setup/Devices, display the "not used" and "add" the 3 news devices.


Forum thread:
When you want to enable the gateway you select the Hardware Line on the Hardware page from Domoticz.
[https://www.domoticz.com/forum/viewtopic.php?f=31&t=6846#p45449]


Switch the Enable button to Green and press '''Update'''


'''New Netatmo Authentication method implemented from 2024.1'''
'''Note:''' Do not use the Add button as it will create a new instance of the Netatmo gateway.


step 1:
== Problem situation ==
When you restart Domoticz or enable the gateway to close to the authentication then Netatmo Blocks the request,


Setup an App under MyApps in the Netatmo developers portal (https://dev.netatmo.com/)
and keeps blocking as long as there are continuous requests.


The Redirect_URI has to contain
When I manually stop the system and wait 20 min then the Block is lifted and the authentication is OK
<code><nowiki>http://localhost/netatmo</nowiki></code>
Once configured correctly, the Client_ID and Client_Secret will be generated and shown.


step 2:
There is a access token and refresh token


In the domoticz hardware setup:
== supported Devices ==
At the moment, the supported Devices are;


*Create/modify the Netatmo hardware
* Weather station,
* Netatmo thermostat,
* Netatmo Valves,
* Homecoach,
* CO2detector,
* Smokedetector,
* Presence camera (Only Events),
* Welkom camera  (Only Events),
* Door Tag,


*the username should contain <client_id>:<client_secret>
<span id="troubleshooting"></span>


*the password should contain the retrieved <SOMECODE> as instructed below:
== Troubleshooting ==
So, you think if you have done everything correctly but things do not work (in some way) as you expected. Here are a couple steps you can do to find the cause.


To retrieve the code (a.k.a. authorisation_code), use the browser and type the following URL. Make sure to fill in the <YOURCLIENTID> with your clientid!
<span id="turn-on-debug-logging"></span>
<code><nowiki>https://api.netatmo.com/oauth2/authorize?client_id=</nowiki><YOURCLIENTID>&redirect_uri=http%3A%2F%2Flocalhost%2Fnetatmo&state=teststate&scope=read_station%20read_thermostat%20write_thermostat%20read_homecoach%20read_smokedetector%20read_presence%20read_camera</code>
=== Turn on debug logging ===
This URL brings you to the My Netatmo page where you have to identify yourself and are asked for permission to grant access to certain devices and types (based on the scope provided).
Edit your /etc/systemd/system/domoticz.service file to;


After confirmation, your browser will try to redirect you to a page it cannot find so you will get an error. But the URL of that page is visible in the browser and looks like
ExecStart=/home/domoticz/domoticz -www 8484 -sslwww 8443 -log "/var/log/domoticz.log" -loglevel all -debuglevel normal,hardware,received,eventsystem
<code><nowiki>http://localhost/netatmo?state=teststate&code=</nowiki><SOMECODE></code>
WorkingDirectory=/home/domoticz
You need to copy this SOMECODE as the password in the domoticz hardware screen. The <SOMECODE> you retrieved is only valid for a few minutes, so if you take too long and Domoticz says  it cannot login, error: No access granted, check credentials...


Please retrieve a new code and be a little quicker....


NOTE:
Or alternatively stop Domoticz service and start Domoticz manually from command line with the debug options. See for instruction the [[Troubleshooting#Check the Domoticz log fileshttps://wiki.domoticz.com/Troubleshooting#Check the Domoticz log files|Troubleshooting Wiki page]].


At the moment, the scopes are fixed to
<code>./domoticz -www 8080 -sslwww 443 -log "/var/log/domoticz.log" -loglevel all -debuglevel normal,auth,hardware,received,webserver,eventsystem,python,thread_id</code>


*read_station
=== Get help ===
*read_thermostat
*write_thermostat
*read_homecoach
*read_smokedetector
*read_presence
*read_camera


<br />
The Domoticz forum is a great resource for help and solutions. Check the [https://forum.domoticz.com Forum].

Latest revision as of 12:48, 5 May 2025

About Netatmo Hardware

Features supported:

  • Temperature sensor,
  • Set point switch,
  • "away" mode switch,
  • Heating Status Switch,
  • Temperature & Humidity Sensor,
  • Barometer Sensor,
  • Rain Sensor,
  • Air QUality Sensor,
  • Sound Sensor,
  • Wind Sensor,
  • Alert Sensor for Security Events,

New Installation

Be sure you have enabled "Accept new Hardware Devices" in menu Setup - Settings


New Netatmo Authentication method implemented from 2024.1

NOTE: In Domoticz beta 2025.1 changes have been made to adapt to latest Netatmo authorisation changes. So if you have issues in an older Domoticz version update to latest beta 2025


Log in on dev.netatmo.com (https://dev.netatmo.com/)

On dev.netatmo.com you create an App.

The Redirect URI should contain the IP and port of the Domoticz server. If you run into issues later on you can try to leave the Redirect URI field empty.

The Webhook URI should be empty.


Press save 2 times.

This gives you the Clientid and Clientsecret



On the Hardware page from Domoticz (menu Setup - Hardware):

  • Hardware Type: Netatmo.
  • Name: This is the name you want for your Hardware module.
  • Log level: Leave default
  • Data Timeout: leave default
  • Client ID: Client ID obtained from Netatmo Development Site
  • Client Secret: Client Secret obtained from Netatmo Development Site.
  • Scope: Select here the Scope for your Netatmo Devices, make sure you only select scopes compatible with your devices!


Press Button Login.

You can Login to Netatmo with E-mail and Password. (If you are already Login in you get directly to the Accept page.)


You see a configuration screen from Netatmo.


Then the Accept Page is displayed, You scroll to the bottom.


And press Accept.

This closes the window and when everything is correct the plugin works, Netatmo device will be added to Domoticz.

In menu Setup - Devices the connected devices should be shown (can take some time)

NOTE: Do NOT click on the ADD button to add the hardware as this is not working for Netatmo Hardware.


If you get a message that nothing is selected:

You can select the Netatmo Hardware line and press the Login button.


With an existing Netatmo installation from older version

New Netatmo Authentication method implemented from 2024.1

NOTE: In Domoticz beta 2025.1 changes have been made to adapt to latest Netatmo authorisation changes. So if you have issues in an older Domoticz version update to latest beta 2025


Be sure you have enabled "Accept new Hardware Devices" in menu Setup - Settings


On the Hardware page from Domoticz menu Setup - Hardware

Select the Netatmo Hardware Gateway line

Fill in Clientid and clientsecret

Select the correct scope(s) for your devices (see for reference screenshots in new install)

Press Button Login.

You can Login to Netatmo with E-mail and Password. (If you are already Login in you get directly to The accept page.

You see a configuration screen from Netatmo.

Then the Accept Page is displayed, You scroll to the bottom.

And press Accept.

This closes the window and when everything is correct the plugin works.

Enabling/Disabling Hardware gateway

When you want to disable the gateway you select the Hardware Line on the Hardware page from Domoticz.

Switch the Enable button to Red and press Update


When you want to enable the gateway you select the Hardware Line on the Hardware page from Domoticz.

Switch the Enable button to Green and press Update

Note: Do not use the Add button as it will create a new instance of the Netatmo gateway.

Problem situation

When you restart Domoticz or enable the gateway to close to the authentication then Netatmo Blocks the request,

and keeps blocking as long as there are continuous requests.

When I manually stop the system and wait 20 min then the Block is lifted and the authentication is OK

There is a access token and refresh token

supported Devices

At the moment, the supported Devices are;

  • Weather station,
  • Netatmo thermostat,
  • Netatmo Valves,
  • Homecoach,
  • CO2detector,
  • Smokedetector,
  • Presence camera (Only Events),
  • Welkom camera (Only Events),
  • Door Tag,

Troubleshooting

So, you think if you have done everything correctly but things do not work (in some way) as you expected. Here are a couple steps you can do to find the cause.

Turn on debug logging

Edit your /etc/systemd/system/domoticz.service file to;

ExecStart=/home/domoticz/domoticz -www 8484 -sslwww 8443 -log "/var/log/domoticz.log" -loglevel all -debuglevel normal,hardware,received,eventsystem WorkingDirectory=/home/domoticz


Or alternatively stop Domoticz service and start Domoticz manually from command line with the debug options. See for instruction the Troubleshooting Wiki page.

./domoticz -www 8080 -sslwww 443 -log "/var/log/domoticz.log" -loglevel all -debuglevel normal,auth,hardware,received,webserver,eventsystem,python,thread_id

Get help

The Domoticz forum is a great resource for help and solutions. Check the Forum.