mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-31 05:06:57 +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.
|
An example of a Statistics graph that shows hourly production per module for the past 7 days.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
{% note %}
|
{% 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 %}
|
{% endnote %}
|
||||||
|
|
||||||
```yaml
|
```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.
|
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.
|
It's easier here to identify any problematic modules.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
chart_type: line
|
chart_type: line
|
||||||
@ -123,17 +123,21 @@ AverageProduction AS (
|
|||||||
WHERE total_production > 0
|
WHERE total_production > 0
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
GROUP_CONCAT(
|
IFNULL(
|
||||||
mp.name || ' (' || printf("%.1f", (mp.total_production * 100.0 / ap.average_total_production)) || '%)',
|
GROUP_CONCAT(
|
||||||
', '
|
mp.name || ' (' || printf("%.1f", (mp.total_production * 100.0 / ap.average_total_production)) || '%)',
|
||||||
|
', '
|
||||||
|
),
|
||||||
|
''
|
||||||
) AS problematic_modules
|
) AS problematic_modules
|
||||||
FROM
|
FROM
|
||||||
ModuleProduction mp, AverageProduction ap -- Implicit cross join, AP will have 1 row
|
ModuleProduction mp, AverageProduction ap -- Implicit cross join, AP will have 1 row
|
||||||
WHERE
|
WHERE
|
||||||
-- TODO: Adjust the 96% threshold if needed
|
-- TODO: Adjust the 96% threshold if needed
|
||||||
mp.total_production < (0.96 * ap.average_total_production)
|
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
|
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%)`
|
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