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.
- Store credentials in a local
.envfile or environment variables. - Do not commit secrets to git. The
.gitignorealready excludes.env.
pip install -r requirements.txtCreate a .env file in the project root:
METEOBOT_EMAIL=your-email@example.com
METEOBOT_PASSWORD=your-passwordAlternatively, export environment variables in your shell:
export METEOBOT_EMAIL="your-email@example.com"
export METEOBOT_PASSWORD="your-password"python main.py <device_id> <data_type> <data_range>- device_id: Measurement ID from Meteobot
- data_type: Sensor type code (see Data types)
- data_range: day, week, month, year
| Location Name | Device ID (use this) |
|---|---|
| Pine Ridge | 1049283756104928 |
| Harbor Crest | 8901746209853746 |
| Red Valley | 6754092837401965 |
| North Meadow | 2209457810638294 |
| 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 |
| Evapotranspiration | 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 |
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- 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.
- 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.
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
}
]