Skip to content

Add dual-sensor support for simultaneous Power and Energy uploads#4

Merged
Crim merged 2 commits into
mainfrom
spp/AdditionalPowerSensor
May 19, 2026
Merged

Add dual-sensor support for simultaneous Power and Energy uploads#4
Crim merged 2 commits into
mainfrom
spp/AdditionalPowerSensor

Conversation

@Crim
Copy link
Copy Markdown
Contributor

@Crim Crim commented May 19, 2026

This PR introduces the ability to configure an optional secondary solar sensor, allowing users to push both Power (W) and Energy (Wh) data to PVOutput simultaneously.

What Changed:

  • Added an optional secondary_entity_id to the config_flow schema and const.py.

  • Updated the init.py payload logic to dynamically evaluate both selected sensors. It automatically assigns the correct v1 (Energy) and v2 (Power) parameters based on their units.

  • Added a safety net to detect if a user accidentally selects two sensors of the same type (e.g., two Watt sensors), gracefully ignoring the duplicate and logging a warning.

  • Updated all translation files (English, German, Spanish, Japanese, Traditional/Simplified Chinese) with markdown-formatted UI instructions explaining "Smart Detection" vs. "Maximum Accuracy."

Details:

Previously, users could only provide a single generation sensor, forcing PVOutput's backend to mathematically estimate the missing metric (which can cause graph lag or inaccuracies on cloudy days). By uploading both the exact live power curve and the exact daily yield at the same time, this update provides the "gold standard" for dashboard accuracy.

Because the new field is optional, this change is 100% backwards compatible for existing users.

Example Logs

With a single (total energy generated) sensor configured:

2026-05-20 08:30:00.258 INFO (MainThread) [custom_components.pvoutput_publisher] PVOutput [NameHere | ID: 1234] Preparing to send: Gen1 (Lifetime): 1330166.0 wh -> v1=1330166 | Con (Power): 120.0 w -> v4=120 | Temp: 22.6°C -> v5=22.6°C

With both total energy generated and power sensors configured:

2026-05-20 08:35:00.429 INFO (MainThread) [custom_components.pvoutput_publisher] PVOutput [NameHere | ID: 1234] Preparing to send: Gen1 (Lifetime): 1330207.0 wh -> v1=1330207 | Gen2 (Power): 260.0 w -> v2=260 | Con (Power): 350.0 w -> v4=350 | Temp: 21.1°C -> v5=21.1°C

Issue: #1

@Crim Crim merged commit 4f478cf into main May 19, 2026
2 checks passed
@Crim Crim deleted the spp/AdditionalPowerSensor branch May 19, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant