Read temperatures from an iMonnit temperature sensor embedded in the pool and generate an image for digital signage by the pool.
This service exposes two endpoints:
GET /api/v1/temperature
$ curl -s https://spt.tsak.dev/api/v1/temperature
{
"temperature": 13.4,
"datetime": "2024-11-07T22:30:00Z"
}
GET /api/v1/temperatures
$ curl -s https://spt.tsak.dev/api/v1/temperatures
[
{
"temperature": 13.4,
"datetime": "2024-11-07T22:30:00Z"
},
{
"temperature": 13.6,
"datetime": "2024-11-07T22:19:58Z"
},
{
"temperature": 13.5,
"datetime": "2024-11-07T22:09:58Z"
}
]
- Go 1.23
- Air
- iMonnit API details
Copy .env.sample
to .env
and fill in MONNIT_SENSOR_ID
, MONNIT_API_KEY_ID
and MONNIT_API_SECRET_KEY
Run air
and connect to localhost:3001
# Continuously build and reload
air
Create bude-seapool-temperature
binary
go build