2.3 KiB
Install
Single one-shot. No daemon, no systemd unit, no service to keep running.
Prerequisites
- OpenEVSE WiFi firmware already configured to publish to the broker
(
mqtt_enabled:true,mqtt_connected:1in/statusJSON). - Broker reachable from the machine you're running this on.
uvinstalled and on$PATH(the script is a PEP-723 inline-deps script —uvresolvespaho-mqttandpyyamlon first run).
1. Verify OpenEVSE is publishing
mosquitto_sub -h <BROKER> -u <USER> -P <PASS> -t 'openevse/#' -W 5 -v
Expect a steady stream of openevse/{power,voltage,amp,...} plus retained
openevse/announce/<id>, openevse/config, etc. If nothing arrives, the
EVSE isn't talking to the broker — fix that first via the OpenEVSE web UI
at http://<EVSE>/.
2. Preview the discovery payloads (optional)
~/solar/openevse/bin/openevse-publish-discovery --dry-run --device-id a048
Prints the 23 topics + JSON payloads it would publish without connecting.
3. Publish
Broker creds default-load from ~/.config/powermon/powermon.yaml:
~/solar/openevse/bin/openevse-publish-discovery
The tool reads the retained openevse/announce/<id> payload to discover
the device id automatically. Override broker / device id if needed:
~/solar/openevse/bin/openevse-publish-discovery \
--host 10.0.0.41 --user mqtt --password '...' \
--device-id a048
Re-running is idempotent — the broker just overwrites the retained payloads in place.
4. Verify
The 23 retained discovery configs:
mosquitto_sub -h <BROKER> -u <USER> -P <PASS> \
-t 'homeassistant/sensor/+/config' \
-t 'homeassistant/binary_sensor/+/config' \
-W 5 -F '[r=%r] %t' | grep openevse | sort -u
Expect 20 sensor + 3 binary_sensor entries, all [r=1].
In HA: Settings → Devices & Services → MQTT should show "OpenEVSE-a048" as a new device. If not, force a reload:
mosquitto_pub -h <BROKER> -u <USER> -P <PASS> \
-t 'homeassistant/status' -m 'online'
HA listens on this topic and re-scans retained discovery on receipt.
Rollback
~/solar/openevse/bin/openevse-publish-discovery --purge
Publishes empty retained payloads to all 23 config topics; HA forgets the
entities on next reload. The OpenEVSE-side openevse/<key> topics are not
touched (they're not ours to clear).