Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f19730ff1d | |||
|
|
1031af5b3d | ||
|
|
97fd58f671 | ||
|
|
2dc24eca1b |
5 changed files with 14 additions and 25 deletions
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
|
|
@ -1,2 +1,3 @@
|
||||||
---
|
---
|
||||||
|
ko_fi: jayjojayson
|
||||||
custom: ["https://www.paypal.me/quadFlyerFW"]
|
custom: ["https://www.paypal.me/quadFlyerFW"]
|
||||||
|
|
|
||||||
12
README.md
12
README.md
|
|
@ -7,7 +7,7 @@
|
||||||
[](https://github.com/jayjojayson/power-flux-card/stargazers)
|
[](https://github.com/jayjojayson/power-flux-card/stargazers)
|
||||||
|
|
||||||
|
|
||||||
# Power Flux Card
|
# Power Flux Card
|
||||||
|
|
||||||
The ⚡ Power Flux Card is an advanced, animated energy flow card for Home Assistant. It visualizes the power distribution between Solar, Grid, Battery, and Consumers with beautiful neon effects and diffrent animations.
|
The ⚡ Power Flux Card is an advanced, animated energy flow card for Home Assistant. It visualizes the power distribution between Solar, Grid, Battery, and Consumers with beautiful neon effects and diffrent animations.
|
||||||
|
|
||||||
|
|
@ -133,7 +133,7 @@ entities:
|
||||||
battery_soc: sensor.battery_soc
|
battery_soc: sensor.battery_soc
|
||||||
card_mod:
|
card_mod:
|
||||||
style: |
|
style: |
|
||||||
power-flux-card {
|
:host {
|
||||||
{% if states('sensor.solar_power') | float > 0 %}
|
{% if states('sensor.solar_power') | float > 0 %}
|
||||||
--icon-solar-color: #00ff88;
|
--icon-solar-color: #00ff88;
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
@ -153,7 +153,7 @@ entities:
|
||||||
battery_soc: sensor.battery_soc
|
battery_soc: sensor.battery_soc
|
||||||
card_mod:
|
card_mod:
|
||||||
style: |
|
style: |
|
||||||
power-flux-card {
|
:host {
|
||||||
{% if states('sensor.grid_power_combined') | float < 0 %}
|
{% if states('sensor.grid_power_combined') | float < 0 %}
|
||||||
--text-grid-color: #ff3333;
|
--text-grid-color: #ff3333;
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
@ -173,7 +173,7 @@ entities:
|
||||||
battery_soc: sensor.battery_soc
|
battery_soc: sensor.battery_soc
|
||||||
card_mod:
|
card_mod:
|
||||||
style: |
|
style: |
|
||||||
power-flux-card {
|
:host {
|
||||||
{% set soc = states('sensor.battery_soc') | float %}
|
{% set soc = states('sensor.battery_soc') | float %}
|
||||||
{% if soc > 80 %}
|
{% if soc > 80 %}
|
||||||
--neon-green: #00ff88;
|
--neon-green: #00ff88;
|
||||||
|
|
@ -197,7 +197,7 @@ entities:
|
||||||
consumer_1: sensor.wallbox_power
|
consumer_1: sensor.wallbox_power
|
||||||
card_mod:
|
card_mod:
|
||||||
style: |
|
style: |
|
||||||
power-flux-card {
|
:host {
|
||||||
{% if states('sensor.wallbox_power') | float > 500 %}
|
{% if states('sensor.wallbox_power') | float > 500 %}
|
||||||
--pipe-consumer-1-color: #a855f7;
|
--pipe-consumer-1-color: #a855f7;
|
||||||
--icon-consumer-1-color: #a855f7;
|
--icon-consumer-1-color: #a855f7;
|
||||||
|
|
@ -220,7 +220,7 @@ entities:
|
||||||
consumer_1: sensor.wallbox_power
|
consumer_1: sensor.wallbox_power
|
||||||
card_mod:
|
card_mod:
|
||||||
style: |
|
style: |
|
||||||
power-flux-card {
|
:host {
|
||||||
{% if states('sensor.solar_power') | float == 0 %}
|
{% if states('sensor.solar_power') | float == 0 %}
|
||||||
--icon-solar-color: #555555;
|
--icon-solar-color: #555555;
|
||||||
--text-solar-color: #777777;
|
--text-solar-color: #777777;
|
||||||
|
|
|
||||||
8
dist/power-flux-card.js
vendored
8
dist/power-flux-card.js
vendored
|
|
@ -1820,13 +1820,7 @@ console.log(
|
||||||
const val = parseFloat(state.state);
|
const val = parseFloat(state.state);
|
||||||
if (isNaN(val)) return state.state + (state.attributes.unit_of_measurement ? ' ' + state.attributes.unit_of_measurement : '');
|
if (isNaN(val)) return state.state + (state.attributes.unit_of_measurement ? ' ' + state.attributes.unit_of_measurement : '');
|
||||||
const unit = state.attributes.unit_of_measurement || '';
|
const unit = state.attributes.unit_of_measurement || '';
|
||||||
if (unit === 'W' || unit === 'Wh') {
|
if (unit === 'W') { return this._formatPower(val); } if (unit === 'Wh') { if (Math.abs(val) >= 1000) return (val / 1000).toFixed(2) + ' kWh'; return Math.round(val) + ' Wh'; } if (unit === 'kWh' || unit === 'kW') { return val.toFixed(1) + ' ' + unit; } if (unit.includes('EUR') || unit.includes('ct') || unit.includes('€')) { return val.toFixed(2) + ' ' + unit; } return val.toFixed(1) + (unit ? ' ' + unit : '');
|
||||||
return this._formatPower(val);
|
|
||||||
}
|
|
||||||
if (unit === 'kWh' || unit === 'kW') {
|
|
||||||
return val.toFixed(1) + ' ' + unit;
|
|
||||||
}
|
|
||||||
return val.toFixed(1) + (unit ? ' ' + unit : '');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Determine existence of main entities
|
// Determine existence of main entities
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ entities:
|
||||||
battery_soc: sensor.battery_soc
|
battery_soc: sensor.battery_soc
|
||||||
card_mod:
|
card_mod:
|
||||||
style: |
|
style: |
|
||||||
power-flux-card {
|
:host {
|
||||||
{% if states('sensor.solar_power') | float > 0 %}
|
{% if states('sensor.solar_power') | float > 0 %}
|
||||||
--icon-solar-color: #00ff88;
|
--icon-solar-color: #00ff88;
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
@ -155,7 +155,7 @@ entities:
|
||||||
battery_soc: sensor.battery_soc
|
battery_soc: sensor.battery_soc
|
||||||
card_mod:
|
card_mod:
|
||||||
style: |
|
style: |
|
||||||
power-flux-card {
|
:host {
|
||||||
{% if states('sensor.grid_power_combined') | float < 0 %}
|
{% if states('sensor.grid_power_combined') | float < 0 %}
|
||||||
--text-grid-color: #ff3333;
|
--text-grid-color: #ff3333;
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
@ -175,7 +175,7 @@ entities:
|
||||||
battery_soc: sensor.battery_soc
|
battery_soc: sensor.battery_soc
|
||||||
card_mod:
|
card_mod:
|
||||||
style: |
|
style: |
|
||||||
power-flux-card {
|
:host {
|
||||||
{% set soc = states('sensor.battery_soc') | float %}
|
{% set soc = states('sensor.battery_soc') | float %}
|
||||||
{% if soc > 80 %}
|
{% if soc > 80 %}
|
||||||
--neon-green: #00ff88;
|
--neon-green: #00ff88;
|
||||||
|
|
@ -199,7 +199,7 @@ entities:
|
||||||
consumer_1: sensor.wallbox_power
|
consumer_1: sensor.wallbox_power
|
||||||
card_mod:
|
card_mod:
|
||||||
style: |
|
style: |
|
||||||
power-flux-card {
|
:host {
|
||||||
{% if states('sensor.wallbox_power') | float > 500 %}
|
{% if states('sensor.wallbox_power') | float > 500 %}
|
||||||
--pipe-consumer-1-color: #a855f7;
|
--pipe-consumer-1-color: #a855f7;
|
||||||
--icon-consumer-1-color: #a855f7;
|
--icon-consumer-1-color: #a855f7;
|
||||||
|
|
@ -222,7 +222,7 @@ entities:
|
||||||
consumer_1: sensor.wallbox_power
|
consumer_1: sensor.wallbox_power
|
||||||
card_mod:
|
card_mod:
|
||||||
style: |
|
style: |
|
||||||
power-flux-card {
|
:host {
|
||||||
{% if states('sensor.solar_power') | float == 0 %}
|
{% if states('sensor.solar_power') | float == 0 %}
|
||||||
--icon-solar-color: #555555;
|
--icon-solar-color: #555555;
|
||||||
--text-solar-color: #777777;
|
--text-solar-color: #777777;
|
||||||
|
|
|
||||||
|
|
@ -820,13 +820,7 @@ console.log(
|
||||||
const val = parseFloat(state.state);
|
const val = parseFloat(state.state);
|
||||||
if (isNaN(val)) return state.state + (state.attributes.unit_of_measurement ? ' ' + state.attributes.unit_of_measurement : '');
|
if (isNaN(val)) return state.state + (state.attributes.unit_of_measurement ? ' ' + state.attributes.unit_of_measurement : '');
|
||||||
const unit = state.attributes.unit_of_measurement || '';
|
const unit = state.attributes.unit_of_measurement || '';
|
||||||
if (unit === 'W' || unit === 'Wh') {
|
if (unit === 'W') { return this._formatPower(val); } if (unit === 'Wh') { if (Math.abs(val) >= 1000) return (val / 1000).toFixed(2) + ' kWh'; return Math.round(val) + ' Wh'; } if (unit === 'kWh' || unit === 'kW') { return val.toFixed(1) + ' ' + unit; } if (unit.includes('EUR') || unit.includes('ct') || unit.includes('€')) { return val.toFixed(2) + ' ' + unit; } return val.toFixed(1) + (unit ? ' ' + unit : '');
|
||||||
return this._formatPower(val);
|
|
||||||
}
|
|
||||||
if (unit === 'kWh' || unit === 'kW') {
|
|
||||||
return val.toFixed(1) + ' ' + unit;
|
|
||||||
}
|
|
||||||
return val.toFixed(1) + (unit ? ' ' + unit : '');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Determine existence of main entities
|
// Determine existence of main entities
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue