Metadata-Version: 2.4
Name: laerke-eu-pressure-reading-plugin
Version: 1.0.3
Summary: Return a pressure reading every interval from an laerke.eu pressure sensor.
Home-page: https://laerke.eu/
Author: Martin Malthe Borch and Lars Woetmann Pedersen
Author-email: mmbo@biosustain.dtu.dk
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: smbus2
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

## Pioreactor Laerke.eu Pressure Reading Plugin

This plugin adds a background job to Pioreactor that reads pressure from a connected Laerke.eu sensor (MS5837), publishes readings over MQTT, stores them in the Pioreactor database, and exposes pressure and pressure change rate charts in the UI.

## Setup

After installation of the plugin the following needs to be added to the `[ui.overview.charts]` section in the shared config.ini file in order to see the charts in the overview section

```ini
laerke_eu_pressure_readings=1
laerke_eu_pressure_deltas=1
```

## What This Plugin Does

- Runs background job: `laerke_eu_pressure_reading`
- Publishes pressure (`mbar`) and pressure change rate (`mbar/s`)
- Stores readings in SQLite tables:
	- `laerke_eu_pressure_readings`
	- `laerke_eu_pressure_deltas`
- Adds two Overview charts:
	- `Pressure`
	- `Pressure Change Rate`

## How To Use

After installation, start the job from the Pioreactor UI

The job then continuously:

- Takes a pressure reading every interval
- Calculates `pressure_delta` from historical readings. The change rate is calculated from the difference between the current pressure reading and the reading 6 interval previous.
- Publishes and records data for charts/export

## Settings

The plugin exposes one user-settable setting:

- `interval` (seconds): time between pressure reading cycles

Default value:

```ini
[laerke_eu_pressure_reading.config]
interval=10
```

Important limits:

- Minimum allowed interval is `5` seconds
- Values below `5` are rejected and logged
- Invalid values at startup fall back to `5` seconds

### Change Settings In UI

Open the running job in the Pioreactor UI and update **Time between pressure readings** (`interval`).

### Change Settings In Config File

Edit the relevant Pioreactor config entry:

```ini
[laerke_eu_pressure_reading.config]
interval=10
```

Restart the job after changing config values.

## Self-Test

The plugin registers a self-test for the pressure sensor. Run Pioreactor self-tests after installation to verify:

- Sensor is detected
- Sensor can be read
- Pressure is in an expected range

