Note: This integration is in an early stage of development. Please report any issues you encounter.
This custom integration forwards Home Assistant entity values into an InfluxDB bucket used by your SOLECTRUS instance. It is tailored for the SOLECTRUS sensor keys so you can map each one to a Home Assistant entity, optionally overriding measurement and field names.
- Configure InfluxDB URL, token, organisation, and bucket directly in the config flow.
- Map every SOLECTRUS sensor to a Home Assistant entity via the options flow; measurement/field defaults are pre-filled but can be overridden.
- Writes are batched and sent every 5 seconds; points are deduplicated by
(sensor, timestamp)(value may repeat). - When a sensor stayed at
0for a longer time and then resumes with a positive value, the integration inserts an extra0point 1 second before the resume to avoid interpolation ramps.
- Home Assistant
2024.6or newer - InfluxDB 2.x reachable from Home Assistant (URL + org + bucket + token)
- An InfluxDB token with read and write access to the target bucket (read is used to detect existing field types so the integration matches them automatically)
- HACS → Integrations → ⋮ → Custom repositories
- Add
https://github.com/solectrus/ha-integrationas type Integration - Install SOLECTRUS
- Restart Home Assistant
- Copy
custom_components/solectrusinto your Home Assistantconfig/custom_components/folder - Restart Home Assistant
- Ensure the integration is installed (see Installation above).
- Go to Settings → Devices & services → Add integration and search for SOLECTRUS.
- Enter your InfluxDB connection details (URL, token, org, bucket). The integration validates access by writing a test point.
- Open the integration Options and map the SOLECTRUS sensor keys to the Home Assistant entities you want to forward.
Notes:
- This integration does not create entities; it exports values of existing entities you select in the options flow.
- If you don't configure any mappings, no data will be written.
The integration determines the InfluxDB field type for each (measurement, field) pair automatically on startup:
- If the bucket already contains data for the field, the existing type wins (Influx freezes the field type on first write, so we have to match it).
- Otherwise, a curated default per sensor is used (
intfor power,floatfor SOC/temperatures,boolfor connection states,stringfor status).
If the incoming Home Assistant state cannot be converted to the resolved type, it is skipped.
In the options flow you can enable Advanced options. This shows additional fields per sensor:
- Measurement: override the default measurement name.
- Field: override the default field name.
Once configured, the integration listens for entity state changes and writes them to InfluxDB following the above rules.
scripts/setup # Install/update dependencies into .venv
scripts/test # Run the test suite (supports pytest args, e.g. scripts/test -v)
scripts/lint # Format and lint the codebase with ruff
scripts/develop # Start Home Assistant with the integration loaded- Setup error "Bucket not found": ensure the bucket exists and the token has write access to it.
- TLS/certificate errors:
https://connections verify certificates; use a valid cert/CA, usehttp://for local non-TLS InfluxDB, or disable Verify SSL certificate (insecure). field type conflictin InfluxDB: this should no longer happen, since the integration auto-detects the existing field type from InfluxDB on startup. If it does, check that the configured token has read access to the bucket — without read, the integration cannot inspect the schema and falls back to its built-in defaults, which may not match.