A battery that lasts: thresholds, standby and On the device

Let a battery device save power, turn its radio off before it runs flat and come back by itself. Set four thresholds once and see whether the device took them.

HydroNode 7 min read
The On the device box of a HydroNode sensor with send interval and battery thresholdsThe On the device box of a HydroNode sensor with send interval and battery thresholds

A sensor on a battery should run for months and not simply die on a grey November day. That is why a HydroNode device looks after its own battery: it sends less often as the battery weakens, turns the radio off before it is empty and carries on by itself once it has recovered. You set the values once in HydroNode, the device keeps them, and HydroNode shows you whether it took them.

What you need

A battery measurementA voltage divider on an analog pin, a fuel gauge (MAX17043/48/49, LC709203F, BQ27441) or an INA219, INA226 or INA260.
HydroNode firmware 0.8.0 or laterFlashed with the Device Builder. New values then arrive over the air.
Or your own sketchWith the Arduino library 1.8.0 or later and onSettings().
Or a HydroNode stationFirmware 2.1 over LoRaWAN, with downlinks switched on.

ESPHome devices from component 0.5.0 report their values with the power: block. HydroNode shows them, but you change them in the YAML only.

Four thresholds

All values are per cell, so for a single 3.7 V cell, however many sit in series. The device works out the pack voltage by itself.

  1. NormalYour interval
  2. SaveHalf as often
  3. Radio offLast round, then quiet
  4. StandbyWakes once an hour
  5. ResumeBack to normal
Back to normal only after two good readings at least a minute apart.
ThresholdBelow it the deviceLiPoLi-ionLiFePO4
Save belowSends half as often and skips gas and dust sensors.3.50 V3.45 V3.10 V
Radio off belowSends one last round, turns radio and outputs off and only checks the battery.3.30 V3.20 V3.00 V
Standby belowSleeps as deep as it can and wakes once an hour.3.20 V3.00 V2.80 V
Resume atRuns normally again.3.60 V3.50 V3.20 V
The rules Standby sits at least 0.05 V below Radio off, Radio off at least 0.05 V below Save. Resume sits at least 0.10 V above Radio off and at most 0.40 V above Save. If something does not fit, the field tells you right away which rule it breaks. A failed reading never sends a device into standby.

When you first flash

  1. Wire the measurementAdd the voltage divider or fuel gauge in the Wiring step. If it is missing, the builder reminds you with Add a battery measurement so the device can protect the battery.
  2. Describe the batteryIn the Power step pick the battery under Powered by, plus Battery type, Cells in series and Capacity (mAh).
  3. Check the thresholdsDevice thresholds holds suggestions for your battery type. Most of the time you can keep them.
The power step in the Device Builder with battery type, capacity and the four thresholdsThe power step in the Device Builder with battery type, capacity and the four thresholds
The Power step: battery, thresholds and the sleep mode with its estimated current below.

Change them later: On the device

On the sensor page, under SettingsPressure and battery, the On the device box shows the send interval and the four thresholds the device runs right now. Change a value and press Send to device. HydroNode turns it into an update job, and the device picks up the values with its next contact.

The On the device box with the send interval and four thresholds in volts per cellThe On the device box with the send interval and four thresholds in volts per cell
Green dots mean the device runs exactly these values.
ColourMeans
GreenThe device runs these values.
YellowSaved and waiting for the device. It takes them with its next contact.
RedThe device refused the change. The reason is shown, and Send again tries once more.
BlueThe device runs other values, for example after a reset. Use device value keeps them.
GreyThe device reports its values but cannot take new ones, or has not reported yet.

Several devices at once? Tick them on the dashboard, press Change config, then Device thresholds. How that dialog continues is in Update every device over the air.

Stations over LoRaWAN

A HydroNode station gets new values as a downlink through your network server. Connect The Things Network or ChirpStack once under ProfileDownlinks: connect, test, switch on. After that every change goes out after the station's next uplink. If the station does not answer within six uplinks, HydroNode sends the change again, three times at most. Stations change one at a time, not in bulk.

When the battery runs low

When the voltage drops below Radio off, the device signs off with one last round. HydroNode then shows Low battery standby instead of offline, and STANDBY on the dashboard, and widgets and Live Activities do not treat the old value as a fault either. You get a message through the Low battery standby channel under SettingsMonitoring, a push by default, and another one when the device is back.

Read more