Skip to content

[driver] Generic "PV (Home Assistant MQTT)" driver for inverters that FTW can't read directly #215

Open

Description

Device make and model

Any PV source available in Home Assistant. My case: SOFAR 11KTL-X (non-hybrid three-phase string inverter) with an LSW-3 Solarman stick logger, read in Home Assistant.

Protocol or local API

MQTT: a JSON message published by a Home Assistant automation, e.g. {"pv_w": 110.0, "total_kwh": 64303.0}. In Home Assistant the inverter is read through the community Solarman integration (Solarman V5 over TCP port 8899, profile sofar_string.yaml).

Public protocol documentation

Hardware available for testing

SOFAR 11KTL-X (non-hybrid, 10 kW nominal, 2 MPPT) with an LSW-3 stick logger, read in Home Assistant. FTW runs as an add-on on a Home Assistant Green next to Home Assistant and Mosquitto. I can compare PV power, string voltages and currents, and lifetime energy against the inverter's own display and the Solarman app, and test a release candidate over several days.

Contribution

  • I can provide device documentation or help test on hardware.

Activity

  1. frahlg commented on Nov 21, 2026

    @frahlg
    Member

    Thanks for the offer to test. FTW has no PV driver fed from Home Assistant over MQTT today. home_assistant_vehicle.lua is the pattern: an automation publishes one JSON message and the driver only subscribes. For PV it needs the topic as a setting, pv_w and total_kwh, the time the value was read so FTW can tell old data from new, and no value (not 0) when Home Assistant has none. Please send an example message and how often your automation publishes it.

  2. johannesingemanson-glitch commented on Nov 22, 2026

    @johannesingemanson-glitch
    Author

    Thanks for taking a look. Answers to your points:

    Example message. My automation publishes to ftw/pv/state (the driver's default). This is a real message from my broker, captured at night with the inverter asleep:

    {"pv_w": 0, "read_at": null, "total_kwh": null}

    In daylight the same message looks like this (format only, the numbers are an example):

    {"pv_w": 110.0, "read_at": 1763805960, "total_kwh": 64303.0}
    • pv_w: watts, >= 0. 0 only when sun.sun is below the horizon, null when Home Assistant has no value and the sun is up.
    • total_kwh: lifetime counter in kWh, null when the sensor is unavailable. The stick is powered by the inverter, so it drops off the network at night.
    • read_at: Unix seconds, from the sensor's last_reported. null when the sensor has no value.

    How often. The automation publishes every 10 s (time_pattern, seconds: /10), no retain. The Solarman integration refreshes the sensor about every 5 s in daylight (its own "Update Interval" diagnostic stays around 5 s, with occasional spikes up to ~15 s and a rare 54 s gap), so consecutive messages normally carry a fresh value.

    Topic as a setting. Agreed, default ftw/pv/state, overridable with a topic key in the device config.

    No value, not 0. Agreed: a missing, null or non-numeric pv_w should make the driver emit nothing. The draft driver does that.

    Time of reading. Good point, that is what read_at is for, so the driver can ignore a value that is older than about 3 minutes (the longest gap I saw today was 54 s). Which time function does the driver host offer for that, os.time() or something in host? I'll add the check to the draft driver once I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions