Skip to content

Commit

Permalink
feat: set a maximum threshold for each of your essential loads
Browse files Browse the repository at this point in the history
  • Loading branch information
slipx06 committed Jan 23, 2025
1 parent 94acd61 commit 08c4469
Show file tree
Hide file tree
Showing 20 changed files with 201 additions and 25 deletions.
7 changes: 7 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ These attributes are only needed if `show_solar` is set to `true`.
|--------------------|-------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| colour: | Optional | `'#5fb6ad'` | Sets the colour of all the load card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). |
| off_colour: | Optional | `grey` | Sets the off colour for the additional essential loads. Set this to `transparent` to hide the load when power is below the `off_threshold` |
| max_colour: | Optional | | Sets the upper threshold colour for the additional essential loads. |
| dynamic_colour: | Optional | `true` | The essential icon colour will change based on the % contribution of the power source (battery, grid, solar) supplying the load. Set to `false` to disable. |
| dynamic_icon: | Optional | `true` | The essential icon will change when there is 100% contribution from a single power source (battery, grid, solar). Set to `false` to disable. |
| invert_load: | Optional | `false` | Set to `true` if your sensor provides a negative number when the load is drawing power. |
Expand All @@ -165,21 +166,27 @@ These attributes are only needed if `show_solar` is set to `true`.
| load1_name: | Optional | | Set the display name for the essential load 1.
| load1_icon: | Optional | none | Set the essential load 1 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. |
| load1_switch: | Optional | | Provide an entity that can be toggled when clicking on the essential load 1 icon.
| load1_max_threshold: | Optional | | Set the threshold for the essential load 1 that will activate the `max_colour`.
| load2_name: | Optional | | Set the display name for the essential load 2.
| load2_icon: | Optional | none | Set the essential load 2 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. |
| load2_switch: | Optional | | Provide an entity that can be toggled when clicking on the essential load 2 icon.
| load2_max_threshold: | Optional | | Set the threshold for the essential load 2 that will activate the `max_colour`.
| load3_name: | Optional | | Set the display name for the essential load 3 (Lite/compact card only).
| load3_icon: | Optional | none | Set the essential load 3 image using any mdi icon e.g. `mdi:ev-station` Presets are not available when showing 4 or more essential loads. You can also provide a sensor that returns the mdi icon. |
| load3_switch: | Optional | | Provide an entity that can be toggled when clicking on the essential load 3 icon.
| load3_max_threshold: | Optional | | Set the threshold for the essential load 3 that will activate the `max_colour`.
| load4_name: | Optional | | Set the display name for the essential load 4.
| load4_icon: | Optional | none | Set the essential load 4 image using any mdi icon e.g. `mdi:ev-station` Presets are not available when showing 4 or more essential loads. You can also provide a sensor that returns the mdi icon. |
| load4_switch: | Optional | | Provide an entity that can be toggled when clicking on the essential load 4 icon.
| load4_max_threshold: | Optional | | Set the threshold for the essential load 4 that will activate the `max_colour`.
| load5_name: | Optional | | Set the display name for the essential load 5.
| load5_icon: | Optional | none | Set the essential load 5 image using any mdi icon e.g. `mdi:ev-station` Presets are not available when showing 4 or more essential loads. You can also provide a sensor that returns the mdi icon. |
| load5_switch: | Optional | | Provide an entity that can be toggled when clicking on the essential load 5 icon.
| load5_max_threshold: | Optional | | Set the threshold for the essential load 5 that will activate the `max_colour`.
| load6_name: | Optional | | Set the display name for the essential load 6.
| load6_icon: | Optional | none | Set the essential load 6 image using any mdi icon e.g. `mdi:ev-station` Presets are not available when showing 4 or more essential loads. You can also provide a sensor that returns the mdi icon. |
| load6_switch: | Optional | | Provide an entity that can be toggled when clicking on the essential load 6 icon.
| load6_max_threshold: | Optional | | Set the threshold for the essential load 6 that will activate the `max_colour`.
| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute. |
| off_threshold: | Optional | `0` | When power falls below this value the load will be considered off and colour will change to grey. Requires `dynamic_colour` to be enabled. Can also be set to `-1` to disable. |
| path_threshold: | Optional | `100` | Specify threshold to apply dynamic colour to the load path element. The colour of the path will change to the source colour if the percentage supply by a single source equals or exceeds this value.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sunsynk-power-flow-card",
"version": "6.4.3",
"version": "6.5.0",
"description": "A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.",
"main": "sunsynk-power-flow-card.js",
"scripts": {
Expand Down
9 changes: 8 additions & 1 deletion src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export class SunSynkCardEditor extends LitElement implements LovelaceCardEditor
{name: 'auto_scale', selector: {boolean: {}}},
{name: 'colour', selector: {color_rgb: {}}},
{name: 'off_colour', selector: {color_rgb: {}}},
{name: 'max_colour', selector: {color_rgb: {}}},
{name: 'dynamic_colour', selector: {boolean: {}}},
{name: 'dynamic_icon', selector: {boolean: {}}},
{name: 'invert_load', selector: {boolean: {}}},
Expand All @@ -315,28 +316,34 @@ export class SunSynkCardEditor extends LitElement implements LovelaceCardEditor
{name: 'load1_name', selector: {text: {}}},
{name: 'load1_icon', selector: {icon: {}}},
{name: 'load1_switch', selector: {entity: {}}},
{name: 'load1_max_threshold', selector: {number: {}}},
{name: 'load2_name', selector: {text: {}}},
{name: 'load2_icon', selector: {icon: {}}},
{name: 'load2_switch', selector: {entity: {}}},
{name: 'load2_max_threshold', selector: {number: {}}},
{name: 'load3_name', selector: {text: {}}},
{name: 'load3_icon', selector: {icon: {}}},
{name: 'load3_switch', selector: {entity: {}}},
{name: 'load3_max_threshold', selector: {number: {}}},
{name: 'load4_name', selector: {text: {}}},
{name: 'load4_icon', selector: {icon: {}}},
{name: 'load4_switch', selector: {entity: {}}},
{name: 'load4_max_threshold', selector: {number: {}}},
{name: 'load5_name', selector: {text: {}}},
{name: 'load5_icon', selector: {icon: {}}},
{name: 'load5_switch', selector: {entity: {}}},
{name: 'load5_max_threshold', selector: {number: {}}},
{name: 'load6_name', selector: {text: {}}},
{name: 'load6_icon', selector: {icon: {}}},
{name: 'load6_switch', selector: {entity: {}}},
{name: 'load6_max_threshold', selector: {number: {}}},
{name: 'animation_speed', selector: {number: {}}},
{name: 'max_power', selector: {number: {}}},
{name: 'off_threshold', selector: {number: {}}},
{name: 'path_threshold', selector: {number: {}}},
{name: 'navigate', selector: {text: {}}},
{name: 'invert_flow', selector: {boolean: {}}},
{name: 'label_daily_load', selector: {text: {}}},
{name: 'invert_flow', selector: {boolean: {}}},
],
},
{
Expand Down
Loading

0 comments on commit 08c4469

Please sign in to comment.