An open API service indexing awesome lists of open source software.

https://github.com/tkmru/remo_to_mackerel


https://github.com/tkmru/remo_to_mackerel

aws-lambda aws-lambda-python mackerel nature-remo smarthome

Last synced: 7 months ago
JSON representation

Awesome Lists containing this project

README

          

# remo to mackerel
This code get my room temperature from [Nature Remo](https://nature.global/), and post it as service metrics to [Mackerel](https://mackerel.io/ja/) by AWS Lambda.

![image](./img/mackerel.png)

## Usage
set Nature Remo api token, Mackerel api key to environment variable.

```
$ export REMOTOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$ export MACKERELKEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$ pip install requests
$ python lambda_function.py
```

### work on AWS Lambda

![image](./img/lambda.png)

```
$ mkdir packages
$ cd packages/
$ pip install requests -t .
$ zip -r9 ../function.zip .
$ zip -g function.zip lambda_function.py
```

and upload function.zip to AWS Lambda.