Let's touch the API of Netatmo Weather Station with Python. #Python #Netatmo

What is Netatmo Weather Station?

Netatmo Weather Station is an IoT terminal that can be installed indoors and outdoors to measure indoor and outdoor weather information [API](https: //) dev.netatmo.com/dev/resources/technical/introduction) is also available. I would like to hit this API with Python.

Preparation

We don't officially publish the Python library, so we'll use a third-party library. For the library, lnetatmo created by philippelt is convenient.

Library installation

lnetatmo After cloning the project from here, use `` `setup.py``` to install the library.

Terminal


$python setup.py install

It can also be installed with pip.

Terminal


$pip install lnetatmo

Prepare user information

Prepare the user information. You can check your CLIENT_ID and CLIENT_SECRET after logging in to here.


"CLIENT_ID" :  "",     
"CLIENT_SECRET" : "",  
"USERNAME" : "mail address",      
"PASSWORD" : "password"                

Try to get weather information

Try to get the latest weather information using lnetatmo.

sample.py


#!/usr/bin/python3
# encoding=utf-8

import lnetatmo

#Get token
authorization = lnetatmo.ClientAuth(
                clientId = "",
                clientSecret = "",
                username = "",
                password = "",
                scope = ""
)

#Get weather information
weather_station = lnetatmo.WeatherStationData(authorization)

#Display of weather information
print(weather_station.lastData())

If you can get it like this, you are successful. Screen Shot 0029-01-26 at 14.04.48.png

Recommended Posts

Let's touch the API of Netatmo Weather Station with Python. #Python #Netatmo
Call the API with python3.
Let's use the Python version of the Confluence API module.
Get the weather with Python requests
Get the weather with Python requests 2
Hit the Etherpad-lite API with Python
Let's summarize the degree of coupling between modules with Python code
Let's touch Google's Vision API from Python for the time being
Check the existence of the file with python
Let's read the RINEX file with Python ①
I tried to get the authentication code of Qiita API with Python.
Hit a method of a class instance with the Python Bottle Web API
Get the number of articles accessed and likes with Qiita API + Python
I tried to get the movie information of TMDb API with Python
Prepare the execution environment of Python3 with Docker
Receive websocket of kabu station ® API in Python
2016 The University of Tokyo Mathematics Solved with Python
[Note] Export the html of the site with python.
Check the date of the flag duty with Python
I tried to touch the API of ebay
Convert the character code of the file with Python3
Let's do web scraping with Python (weather forecast)
[Python] Determine the type of iris with SVM
Let's simulate the transition of infection rate with respect to population density with python
Let's play with Python Receive and save / display the text of the input form
Try out the touch of data-driven testing with Selenium Python Bindings and py.test
Touch the sample v20-python-samples of the OANDA v20 REST API wrapper library for Python
the zen of Python
Extract the table of image files with OneDrive & Python
Learn Nim with Python (from the beginning of the year).
[Python] Get the text of the law from the e-GOV Law API
Let's use the API of the official statistics counter (e-Stat)
I tried to touch the CSV file with Python
Let's break down the basics of TensorFlow Python code
Visualize the range of interpolation and extrapolation with python
Calculate the regression coefficient of simple regression analysis with python
Let's use the open data of "Mamebus" in Python
Summary of the basic flow of machine learning with Python
Get the operation status of JR West with Python
[Python] Use the Face API of Microsoft Cognitive Services
Note calling the CUDA Driver API with Python ctypes
Extract the band information of raster data with python
Let's operate GPIO of Raspberry Pi with Python CGI
I moved the automatic summarization API "summpy" with python3.
[Python] Let's change the URL of the Django administrator site
I tried hitting the API with echonest's python client
Build API server for checking the operation of front implementation with python3 and Flask
Second half of the first day of studying Python Try hitting the Twitter API with Bottle
I tried to find the entropy of the image with python
Try scraping the data of COVID-19 in Tokyo with Python
Try hitting the Twitter API quickly and easily with Python
I tried "gamma correction" of the image with Python + OpenCV
Use Trello API with python
A note about hitting the Facebook API with the Python SDK
Towards the retirement of Python2
The story of implementing the popular Facebook Messenger Bot with python
Unify the environment of the Python development team starting with Poetry
Visualize the results of decision trees performed with Python scikit-learn
Let's run Excel with Python
Let's decide the position of the fire station by combinatorial optimization
The first API to make with python Djnago REST framework