Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meteobot CLI

Overview

This CLI logs in to Meteobot, requests chart data for a device and sensor over a specific time range, and prints the Values array as JSON. It also prints the calculated start and end timestamps in both raw and human-readable form so you can verify the requested range.

The script authenticates with the Meteobot web app, extracts the CSRF token from the login form, submits your credentials, and then calls the chart endpoint using the sensor code you provide.

Important

  • Store credentials in a local .env file or environment variables.
  • Do not commit secrets to git. The .gitignore already excludes .env.

Requirements

pip install -r requirements.txt

Configuration

Create a .env file in the project root:

METEOBOT_EMAIL=your-email@example.com
METEOBOT_PASSWORD=your-password

Alternatively, export environment variables in your shell:

export METEOBOT_EMAIL="your-email@example.com"
export METEOBOT_PASSWORD="your-password"

Usage

python main.py <device_id> <data_type> <data_range>

Arguments

  • device_id: Measurement ID from Meteobot
  • data_type: Sensor type code (see Data types)
  • data_range: day, week, month, year

Device IDs

Location Name Device ID (use this)
Pine Ridge 1049283756104928
Harbor Crest 8901746209853746
Red Valley 6754092837401965
North Meadow 2209457810638294

Data types

Name Code (use this)
Solar panel voltage SolarPanelVoltage
Battery voltage BatteryVoltage
Air temperature AirTemperature
Relative air humidity AirHumidity
Air pressure AirPressure
Dew point DewPoint
Rain Precipitation
Wind speed WindSpeed
Evapo­transpiration Evapotranspiration
Soil moisture 1 EarthHumidity%3a0
Rain + Soil moisture 1 Precipitation%3bEarthHumidity%3a0
Soil temperature 1 EarthTemperature%3a0
Solar radiation SolarRadiation
Solar irradiation SolarEnergy
Sunshine duration SunshineDuration

Examples

python main.py 8901746209853746 Evapotranspiration week
python main.py 2209457810638294 Precipitation week
python main.py 6754092837401965 AirTemperature day
python main.py 1049283756104928 WindSpeed month
python main.py 8901746209853746 SolarRadiation year
python main.py 6754092837401965 EarthHumidity%3a0 week
python main.py 2209457810638294 Precipitation%3bEarthHumidity%3a0 week

Notes

  • data_range controls the time span used in the request.
  • data_type is passed directly to the API as the sensors value.
  • Use the codes exactly as shown, including URL-encoded forms.

Troubleshooting

  • If you see "Missing dependency: python-dotenv", run pip install -r requirements.txt.
  • If login fails, verify credentials and ensure your account can log in via the web app.
  • If the Values array is empty, confirm device ID, data type, and date range.

Sample output

start: 20260415000000 (2026-04-15 00:00:00)
end:   20260519000000 (2026-05-19 00:00:00)
[
  {
    "0": "20260415000000",
    "128_3_0": 0.0
  },
  {
    "0": "20260416000000",
    "128_3_0": 0.0
  }
]

About

This CLI logs in to Meteobot, requests chart data for a device and sensor over a specific time range, and prints the Values array as JSON

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages