{"id":24199466,"url":"https://github.com/tredmann/simple-netatmo-php","last_synced_at":"2025-07-05T14:34:18.266Z","repository":{"id":7874769,"uuid":"9248109","full_name":"tredmann/simple-netatmo-php","owner":"tredmann","description":"Simple Wrapper for the Netatmo API","archived":false,"fork":false,"pushed_at":"2013-04-05T21:05:51.000Z","size":128,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T20:40:59.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tredmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-05T18:46:35.000Z","updated_at":"2022-02-13T10:19:23.000Z","dependencies_parsed_at":"2022-09-03T09:41:23.465Z","dependency_job_id":null,"html_url":"https://github.com/tredmann/simple-netatmo-php","commit_stats":null,"previous_names":["tredmann/simple-netatmo-php"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tredmann%2Fsimple-netatmo-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tredmann%2Fsimple-netatmo-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tredmann%2Fsimple-netatmo-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tredmann%2Fsimple-netatmo-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tredmann","download_url":"https://codeload.github.com/tredmann/simple-netatmo-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241638326,"owners_count":19995168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-13T20:36:24.440Z","updated_at":"2025-03-03T09:23:58.448Z","avatar_url":"https://github.com/tredmann.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"simply-netatmo-php\n==================\n\nSimple Wrapper for the Netatmo API\n\n# Requirements\n\nFirst of all you need also the official API of NetAtmo. To be more specific the Client API which we will use to wrap around. You can get the API from the [PHP API repository](https://github.com/Netatmo/Netatmo-API-PHP) at Github as well.\n\n# Install\n\nTo use the Simply Netatmo PHP API just include the simple-netatmo-php.php file into your code. You will find the file in the lib folder.\n\n    require('lib/simple-netatmo-php.php');\n\nFor sure you need to download the lib from here.\n\n# Usage\n\nAs I already mentioned you need an instance of a NAApiClient to use the libary. You can create a client one like this:\n\n    $credentials = array(\n      'client_id'     =\u003e 'your_client_id',\n\t    'client_secret' =\u003e 'your_client_secret',\n      'username'      =\u003e 'your_username',\n      'password'      =\u003e 'your_password'\n    );\n    \n    $client = new NAApiClient($credentials);\n\nThis client instance can we now use to create our wrapper instance.\n\n## Creating the API wrapper\n\nYou just need to create a new Netatmo instance with the client as parameter:\n\n    $netatmo = new Netatmo($client);\n    \n## Devices\n\nWith this instance we can get all our devices:\n\n    $devices = $netatmo-\u003egetDevices();\n    \n    foreach($devices as $device) {\n    \n      echo $device-\u003egetName();\n    \n    }\n    \n    \nWe can also get a know device:\n\n\t$device = $netatmo-\u003egetDevice('device_name');\n\t\nWith this device we can now work with the modules.\n\n## Modules\n\nEvery device can have modules - in fact the device itself is a module. To get measurements we need to have a module instance. First we can get all modules per device.\n\n    $modules = $device-\u003egetModules();\n    \n    foreach($modules as $module) {\n    \n      echo $module-\u003egetName();\n    \n    }\n    \nWe can also get a named module. At this time there should always be two modules for every device called 'Indoor' and 'Outdoor'. You can select them directly with:\n\n    $outdoor_module = $device-\u003egetModule('Outdoor');\n    \nFrom these module we can get some measurements.\n\n## Measurements\n\nYou can get measurements by calling module functions. For example you can get the latest measurements like this:\n\n    $measurement = $outdoor_module-\u003egetLatestMeasurement();\n    \n    echo 'Temperature: ' . $measurement-\u003eget('temperature');\n    echo 'CO2:         ' . $measurement-\u003eget('co2');\n    \nBut you can also get measurements for given day:\n\n\t$measurements = $outdoor_module-\u003egetMeasurementByDay('2013-04-05');\n\t\n\tforeach($measurements as $measurement) {\n\t\n\t  echo 'Time:        ' . $measurement-\u003egetTime('H:i:s');\n\t  echo 'Temperature: ' . $measurement-\u003eget('temperature');\n\t\n\t}\n\t\nThe function currently work only in 30min steps - but in the future there will be more functions and parameters.\n\n# Example\n\nJust to wrap everything up a copy\u0026paste example to get the temperature from an outdoor module:\n\n    $device_name = 'my_device';\n    $module_name = 'outdoor';\n    \n    $credentials = array(\n      'client_id'     =\u003e 'your_client_id',\n\t    'client_secret' =\u003e 'your_client_secret',\n      'username'      =\u003e 'your_username',\n      'password'      =\u003e 'your_password'\n    );\n    \n    $client = new NAApiClient($credentials);\n    \n    $netatmo = new Netatmo($client);\n    \n    $device = $netatmo-\u003egetDevice($device_name);\n    \n    $module = $device-\u003egetModule($module_name);\n    \n    $measurement = $module-\u003egetLatestMeasurement();\n    \n    $temperature = $measurement-\u003eget('temperature');\n    \n    // or\n    \n    // $netatmo-\u003egetDevice($device_name)-\u003egetModule($module_name)-\u003egetLatestMeasurement()-\u003eget('temperature');\n    \n# Bugs and contact\n \nYes, we have bugs and problems! To report them use the issue tracker here. You can also contact me:\n\nMail: tobias@tricd.co\n\nWeb: [www.tricd.de](http://www.tricd.de)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftredmann%2Fsimple-netatmo-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftredmann%2Fsimple-netatmo-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftredmann%2Fsimple-netatmo-php/lists"}