npm.io
1.0.0 • Published 2d ago

homebridge-octopus-power-lightsensor

Licence
MIT
Version
1.0.0
Deps
0
Size
15 kB
Vulns
0
Weekly
0

homebridge-octopus-power-lightsensor

Polls your Octopus Home Mini's live telemetry and exposes whole-house power demand in HomeKit as a Light Sensor. The lux value shown is actually watts — this is the standard workaround for the fact that classic HomeKit (HAP) has no watts/kWh characteristic at all.

What this does and doesn't do

  • Live-ish (poll-interval-limited) whole-house wattage as a tile in the Home app and Eve, usable in automations ("if > 3000, do X").
  • Does not appear in iOS 27's new Energy tab — that tab reads Matter's Electrical Power/Energy Measurement clusters, not classic HAP, and Homebridge's Matter bridge doesn't expose those device types to plugins yet. If/when it does, this should become a proper ElectricalMeter Matter accessory instead of this lux hack.
  • Export (negative demand, e.g. from solar) floors at ~0 rather than showing direction, since HomeKit's lux characteristic can't go negative. Not an issue for import-only households.

Requirements

  • A Homebridge instance (Node 18.15+).
  • An Octopus Home Mini already linked to your account and showing live usage in the Octopus app — this plugin reads the same data, it doesn't set anything up on the Mini itself.
  • Your Octopus API key: Octopus dashboard → Personal Details → API access.
  • Your Octopus account number (starts with A-, on any bill or the dashboard).

Install

Copy this folder onto your Homebridge host (e.g. your Synology, alongside your other custom plugins) so it's resolvable as a global module, e.g.:

cd /volume1/homebridge/node_modules   # wherever your other plugins live
cp -r homebridge-octopus-power-lightsensor .

No npm install is required inside the folder — it has zero dependencies and uses Node's built-in fetch.

Restart Homebridge, then add the accessory via Config UI X (it'll appear as "Octopus Power Light Sensor" in the plugin list) or by hand in config.json:

{
  "accessories": [
    {
      "accessory": "OctopusPowerLightSensor",
      "name": "Whole House Power (W)",
      "apiKey": "sk_live_xxxxxxxxxxxxxxxxxxxx",
      "accountNumber": "A-XXXXXXXX",
      "pollInterval": 30
    }
  ]
}

Troubleshooting

  • Accessory shows as "Not Responding" or StatusActive goes inactive: check the Homebridge log — after 3 consecutive failed polls it flips StatusActive to false so it's visually obvious in Eve. It'll flip back automatically once a poll succeeds.
  • "Could not resolve a Home Mini device ID": confirm the Mini is showing live data in the official Octopus app first. The plugin tries the standard meter lookup, then falls back to octocareUsageInfo — if both come back empty, the Mini likely isn't properly linked yet.
  • Frequent auth errors: the plugin re-authenticates automatically on any failure, so transient issues self-heal within one poll cycle. If it persists, double-check the API key was copied in full.

Keywords