mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-30 12:46:51 +00:00
updateupdate
This commit is contained in:
parent
d91ee0b2d4
commit
04641b009b
@ -33,10 +33,10 @@ To set up the integration, you need a username and password with access to the [
|
||||
|
||||
An example of a Statistics graph that shows hourly production per module for the past 7 days.
|
||||
|
||||

|
||||

|
||||
|
||||
{% note %}
|
||||
The statistic IDs below are examples. It's recommended to press on **SHOW VISUAL EDITOR** to select the statistics based on their name instead.
|
||||
The statistic IDs below are examples. It's recommended to use **SHOW VISUAL EDITOR** to select the statistics by name instead.
|
||||
{% endnote %}
|
||||
|
||||
```yaml
|
||||
@ -57,7 +57,7 @@ title: Hourly production per module on east side
|
||||
Another example of a Statistics graph that shows daily production per module for the past 7 days.
|
||||
It's easier here to identify any problematic modules.
|
||||
|
||||

|
||||

|
||||
|
||||
```yaml
|
||||
chart_type: line
|
||||
@ -123,17 +123,21 @@ AverageProduction AS (
|
||||
WHERE total_production > 0
|
||||
)
|
||||
SELECT
|
||||
GROUP_CONCAT(
|
||||
mp.name || ' (' || printf("%.1f", (mp.total_production * 100.0 / ap.average_total_production)) || '%)',
|
||||
', '
|
||||
IFNULL(
|
||||
GROUP_CONCAT(
|
||||
mp.name || ' (' || printf("%.1f", (mp.total_production * 100.0 / ap.average_total_production)) || '%)',
|
||||
', '
|
||||
),
|
||||
''
|
||||
) AS problematic_modules
|
||||
FROM
|
||||
ModuleProduction mp, AverageProduction ap -- Implicit cross join, AP will have 1 row
|
||||
WHERE
|
||||
-- TODO: Adjust the 96% threshold if needed
|
||||
mp.total_production < (0.96 * ap.average_total_production)
|
||||
AND ap.average_total_production IS NOT NULL
|
||||
AND ap.average_total_production > 0 -- Avoid division by zero if no production at all
|
||||
)
|
||||
) AS result
|
||||
```
|
||||
|
||||
This will result in a sensor with state e.g.: `SolarEdge 1.1.13 (95.7%), SolarEdge 1.1.14 (95.2%)`
|
||||
|
Loading…
x
Reference in New Issue
Block a user