-
Notifications
You must be signed in to change notification settings - Fork 1
temphistory
wolfen351 edited this page Mar 21, 2025
·
1 revision
The TempHistory module is responsible for tracking and managing temperature data over time. It provides telemetry data, processes incoming telemetry, and serves historical temperature data through web routes.
- Tracks hourly, daily, and monthly temperature data.
- Provides telemetry data such as min, max, and average temperatures.
- Stores and retrieves historical temperature data from disk.
- Serves temperature history details via web routes.
No specific hardware or pinout configuration is required for this module.
The module provides the following telemetry data:
-
tempmin: Minimum temperature recorded in the current hour. -
tempmax: Maximum temperature recorded in the current hour. -
tempavg: Average temperature recorded in the current hour. -
tempcount: Number of temperature readings in the current hour. -
daymin: Minimum temperature recorded in the current day. -
daymax: Maximum temperature recorded in the current day. -
dayavg: Average temperature recorded in the current day. -
daycount: Number of temperature readings in the current day.
The module processes telemetry data with the following fields:
-
time: ISO 8601 formatted timestamp of the telemetry data. -
tempReadAt: Timestamp of the last temperature reading. -
temperature*: Temperature readings (e.g.,temperature1,temperature2).
The module does not provide any commands.
The module does not consume any commands.
-
Routes:
The module provides the following web routes:-
/temphistory: Serves the main temperature history page. -
/temphistorydetailtoday: Provides detailed temperature data for the current day. -
/temphistorydetailyesterday: Provides detailed temperature data for the previous day. -
/temphistorydetailmonth: Provides detailed temperature data for the current month.
-
-
Data Storage:
The module saves historical temperature data to a file namedtemphistory.jsonand loads it on startup. -
Dependencies:
- Requires the
datetimemodule for processing timestamps. If not available, it attempts to install it using WiFi. - Uses
ujsonfor JSON serialization and deserialization.
- Requires the