This object is in archive! 

Netatmo integration: Add value (current outside temp) to virtual thermometer via url

Dieter Wijckmans shared this question 9 years ago
Need Answer

Hi team,


I'm looking to create some rules based on the outside temperature.

Although the virtual weather station is a good start it is not update frequently enough to be reliable and usable in my scenarios.

I also have a Netatmo weather station which updates more frequently. I managed to install the API on my synology and have an URL that only gives a value on the page "99.9" nothing more nothing less.


I've created the virtual thermometer and got the URL of the virtual thermometer and paste my URL after the "=" sign. I get a GUID back but the temperature is not updated.


Are there any constraints in data that needs to be passed to the zipato? Do I need it to be in an array? Does it need to be int or float?


Anyone out there who already managed to get this working?


Thanks in advance!

Replies (11)

photo
1

I use this : // Script développé par Cédric Locqueneux. http://maison-et-domotique.com

// Synthase: http://www.maison-et-domotique.com/scripts/netatmo.php?login=VOTRE_EMAIL&password=MOTDEPASSE

It's works

photo
1

Here a part of the code I'm using :


To get the value's from netatmo :


if(isset($res[0]) && isset($res[0]["beg_time"]))

{

$time = $res[0]["beg_time"];


$tempLiving = $res[0]["value"][0][0];

$humidityLiving = $res[0]["value"][0][1];

$co2Living = $res[0]["value"][0][2];

}


Post the value's :


// Temp Living

$url = "https://my.zipato.com/zipato-web/remoting/attribute/set?serial=xxx&apiKey=xxx";

$url = $url."&value4=".$tempLiving;

$ch = curl_init($url);

curl_exec($ch);

curl_close($ch);


If you need more details let me know.

photo
1

I have never tried to set a value on a virtual thermometer, I use a virtual meter.

I can see that my URL differs from yours. In addition to the ?serial=x&apikey=y i also have a ep=z

So my URL looks like this in the PHP code:

"&apiKey=[some]https://my.zipato.com/zipato-web/remoting/attribute/set?serial=[serial]&apiKey=[some GUID]&ep=[some GUID]&value1=".$netatmo_outside_temp;

photo
1

Here's the code I use. Some of the included php files in the top were downloaded from Netatmo, if I remember right. By using these, the code gets generic and really (re)usable

EDIT: In addition to using the netatmo PHP API-code, I use Tobias Redmanns simple-netatmo-api ( https://github.com/tobias-redmann/simple-netatmo-php )

The project is really well documentet and fairly easy to use.

Heres my code, based on the example code of Tobias Redmann:


  1. <?php
  2. require('lib/simple-netatmo-php.php'); //Tobias Redmanns netatmo API wrapper
  3. require ('netatmo_api/NAApiClient.php'); //downloaded from Netatmo web site
  4. require ('curl_get.php'); //just to abstract the CURL code away from the script
  5. require ('credentials.php'); //netatmo credentials in here
  6. $device_name = 'Netatmo';
  7. $module_name = 'Outside';
  8. $measurement_type = 'temperature';
  9. $client = new NAApiClient($credentials);
  10. $netatmo = new Netatmo($client);
  11. $device = $netatmo->getDevice($device_name);
  12. $module = $device->getModule($module_name);
  13. $measurement = $module->getLatestMeasurement();
  14. $temperature = $measurement->get($measurement_type);
  15. $zipa_meter_url = "https://my.zipato.com/zipato-web/remoting/attribute/set?serial=REMOVED&apiKey=REMOVED&ep=REMOVED&value1=".$temperature;
  16. curl_get($zipa_meter_url)
  17. ?>

photo
photo
1

Hi I'm new with the zipato system. Can you explain how to add the netatmo to zipabox?

photo
1

You must have a script between the Zipabox and the Netatmo API. The script must read Netatmo values by calling the Netatmo API and then it must call a Zipabox virtual meter and set the value of the Netatmo device. Both can be reached with HTTP.


Typically your script will run on a NAS or other script enabled and Internet exposed server/computer.


My (php) script runs every 15 minutes on my NAS.

photo
photo
1

Hello,


it seems that Zipato still has not integrated the different Netatmo devices to the box. It is a pity that we have to pass by an NAS script.

photo
1

Hi,


my script is almost ready and i will publish it this week.

But its already running...


regards Helle

photo
1

Hi

I am very excited and interested about your solution.


Are you going to publish it in your blog?


Best regards

Michel

photo
1

Hi Michel,


yes.


regards Helle

photo
photo
1

Hi,


any news about your script?


Best regards

Michel

photo
1

Hi,


almost ready....script is running for 2 weeks very well.

I hope to publish it tomrrow evening.


regards Helle

photo
1

Here is the script I am using. Just published it to GitHub: https://github.com/innodron/ZipaNetatmoGW


You will need a Netatmo developer account to provide OAUTH credentials to the Netatmo python library. Though it is easy to get one.

photo
1

Hi,


if you want to integrate your NetAtmo into your Zipabox try this:

http://zipabox.de/netatmo-liefert-werte-zur-zipabox/

If you have any problems or suggestion, please let me know.


regards Helle

photo
1

Hi,

thank you for your detailed documentation.

I will try to adopt it.


Best regards

Michel

photo
photo
1

Have anyone tried to integrate the Netatmo presence to Zipabox? basically I'm thinking to enable alerts if Zipabox security system is armed Away, and disable if disarmed. Netatmo presence seems to be a very nice product.

photo
1

Via IFTTT I think would be easiest.

photo
1

Hmm looks like triggers exist only for Welcome, not Presence (At least for arming/desarming), hard to test without one.

photo
photo
2

Is anyone who heard from Zipato if they will integrate Netatmo?


Or is it still Netatmo developer account to provide OAUTH, that is the only solution


I bought both the whether units and both cameras, and want integrate with ZIPABOX

Leave a Comment
 
Attach a file