This is a Home Assistant custom integration that exposes FranklinWH control
services you can use in automations. It uses the franklinwh Python library,
which is the same library used by the existing franklin_wh sensor/switch
integration.
- Enable automations to react to FranklinWH export conditions.
- Provide control actions that are supported by the FranklinWH API library.
- Keep the solution compatible with your existing
franklin_whsensors.
- Custom integration
franklinwh_automationthat exposes control services. - Home Assistant package that implements the export‑driven automation.
- Use
franklinwhPython library calls (mode + grid status) as control actions.
- Direct “import limit” control (not exposed by the current API/library).
- UI dashboard work beyond service usage.
- You already run the
franklin_whintegration for sensors. - Two gateways (aGates) are configured and available in HA.
- Export is detectable via
sensor.franklinwh_grid_use(negative = export). - You can store gateway IDs in
secrets.yaml.
- Install the custom integration from this repo into HA.
- Configure it with username/password + gateway ID for the target aGate.
- Add the package
franklinwh_automation.yamlto your HA config. - Tune thresholds and SOC values in HA.
- Does
sensor.franklinwh_grid_usego negative on export in your setup? - Which gateway should be controlled when the other is exporting?
- Any preferred SOC thresholds or time‑of‑use behaviors?
- Copy
custom_components/franklinwh_automationinto your Home Assistant config folder (or use a custom components workflow). - Restart Home Assistant.
- Add the integration via Settings → Devices & Services → Add Integration.
You will be prompted for:
username: FranklinWH account email.password: FranklinWH account password.gateway_id: Target aGate gateway ID (SN).
franklinwh_automation.set_mode
service: franklinwh_automation.set_mode
data:
gateway_id: "10060005A02X24470657"
mode: self_consumption
soc: 20franklinwh_automation.set_grid_status
Example automation action:
service: franklinwh_automation.set_grid_status
data:
gateway_id: "10060005A02X24470657"
status: offgrid
soc: 5sensor.<name>_modeshows the current gateway mode.- Attribute
min_socreflects the SOC value reported for that mode.
The FranklinWH API does not currently expose a documented import limit control. This integration focuses on the supported controls exposed by the upstream library. If/when an import limit endpoint is discovered, we can add a new service here.