GithubHelp home page GithubHelp logo

gurbyz / power-wheel-card Goto Github PK

View Code? Open in Web Editor NEW
159.0 16.0 22.0 680 KB

An intuitive way to represent the power and energy that your home is consuming or producing. (A custom card for the Lovelace UI of Home Assistant.)

License: Apache License 2.0

JavaScript 100.00%
energy solar-panels lovelace-ui home-assistant custom-card

power-wheel-card's People

Contributors

bramkragten avatar gerard33 avatar gurbyz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

power-wheel-card's Issues

⚠️ Information: Future card configuration changes.

Hi.

A change in how lovelace cards are set up in Home Assistant 0.105 increases performance, but enables cards to accidentally modify their own configuration in the loaded lovelace configuration.

I'm going through the cards in the HACS default repository, and noticed that your card may be susceptible to this. Looking through your code it seems you may modify parts of the config object passed to your card in setConfig.

The result could be that your card does not work well with the GUI editors or that parts of the configuration start showing up multiple times.

At some point in the future, it is likely that the configuration will be frozen before being passed to setConfig. At this point, your card will fail entirely when it tries to modify the configuration object.

There are several ways to fix/protect agains this problem.

The best is to restructure setConfig such that the configuration is never modified.
Other alternatives are to make a copy of the configuration and work on that instead.

setConfig(config) {
  config = { ...config }; // This works for simple configurations not containing arrays or objects
...
import { deepClone } from "deep-clone-simple";
// https://github.com/balloob/deep-clone-simple

setConfig(config) {
  config = deepClone(config); // This is a safe and fast method
...

or

setConfig(config) {
  config = JSON.parse(JSON.stringify(config)); // This uses built-in functions, but may be slower than deepClone
  ...

Please note that I have not tested your card agains Home Assistant 0.105 or later, but just quickly looked through the code. If I'm mistaken in my assessment, I appologize for taking your time.

See thomasloven/hass-config#6 for more info.

Mixing in values

Hello

I want to add the EToday value in the charge, either in the title of in the W text in the middle?

image

This is more of a question as I don't really know if its possible with home assistant and plugins in general?

not loading

I get this error when loading
power-wheel-card.js?v=1:7:27 Uncaught TypeError: Cannot convert undefined or null to object

Calculations incorrect

Hi,
Since the HA 105.2 upgrade the calculation for house consumption seems to be incorrect. I've attached two screen captures (one from solar web and the other from HA Power Wheel, they should be similar. The math seems to be wrong, it is an addition rather than a subtraction.
Screen Shot 2020-02-08 at 4 50 31 pm
Screen Shot 2020-02-08 at 4 50 24 pm

Mapping of sensors

Hi, thanks for sharing this great integration !

I have some difficulties mapping the right sensors.

I have the following sensors through DSMR (working om modbus integration)

sensor.energydel -> This is the TOTAL Kwh consumed
sensor.energyret -> This is the TOTAL Kwh produced
sensor.powerdel -> The current power delivery
sensor.powerret -> The current power produced
sensor.powerretl1 -> Same as powerret ???

If more energy is produced than consumed powerdel = 0
If more energy is consumed than produced powerret = 0

My DSMR values are :

dsmr

For now I did the following :

power card

How would you map this in the card ?

Also I have delivery and return seperate for day/night so actually 4 values.

Many thanks & KInd regards,

Tony

Problem with directions of energy and values display

I have read the wiki about what to try first before creating a bug report.

Which version of HA do you use?
Version 247 | HassOS 4.13

Which version of the card do you use?
v0.1.4

Describe the bug
As visible in the screenshots, the solar panels (left bottom graph) are producing more than the house is consuming (left upper graph) but the power-wheel is not showing that information and is also showing an incorrect value of the actual house consumption.

Configuration of the card

type: 'custom:power-wheel-card'
title: Power wheel
solar_power_entity: sensor.shelly_em_produced_by_solar_panels
grid_power_entity: sensor.shelly_em_consumed_from_grid
debug: false

Expected behavior
When solar panels are producing more than the house consumes:

  • the arrows should point from solar panel to house and grid
  • the consumption value of the house should be the PRODUCED_BY_SP - INJECTED_IN_GRID

When solar panelas are not producing enough power than house consumes:

  • the arrows should point from solar panel and grid to house
  • the consumption values should also match

Screenshots
image

Additional context
I love the idea of this card, is actually more informative that any plot out there since I get a real idea of what's actually going on on my electrical consumptions. Keep up the great work! If you are coming anywhere near Coimbra (Portugal) someday, please mail me so that I can buy you coffee and some local delicious pastries! You deserve it!

Daily Consumption Charge

In relation to the money view, it would be really useful to have the ability to specifify a daily consumption charge (flat rate) e.g. My power company charges me $0.94 per day to have the power connected so being able to include this within the Power Wheel card allows me to work out the total cost of power per day.

Thanks

Solar Money Calculations

In relation to the money view, it would be useful to calculate to be able to subtract the amount of money (through both utilising solar power produced and selling it back to the grid) from the total of cost of power provided by the grid.

This way you will be able to effectively see how much cost:

  1. Through selling power back to the grid
  2. Through utilising solar power
  3. Through purchasing power from the grid

Today the card simply adds the cost of solar power and grid power to provide a total cost. Thanks

Off-Grid: Home shows as powering solar panels when values are equal

I have read the wiki about what to try first before creating a bug report.

I am running as an off-grid setup, with 'grid' actually showing battery (although it would be nice to have real battery with SOC).

Which version of HA do you use?
0.116.4

Which version of the card do you use?
Latest (0.1.5)

Describe the bug
Power sometimes shows as flowing from home to solar panels when consumption matches power put out by panels.

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

type: 'custom:power-wheel-card'
title: Power Flows
solar_power_entity: sensor.classic_power
grid_power_entity: sensor.classic_whizbangbatpower
grid_icon: 'mdi:car-battery'
invert_grid_colors: true
battery_soc_entity: sensor.classic_soc
debug: false

Dev console debug output
I'll need to wait until it's occurring again. Currently running off of batteries.

Expected behavior
Power flows don't show as going either direction when flows are equal.

Screenshots
n/a -- state changed while filing bug report.

Additional context
My suspicion is that it occurred on page load, and that since the value didn't become negative or positive relative to home consumption, it just showed the way it was on page load. ..but that's just a guess.

HA Icons in 0.110 beta

I have read the wiki about what to try first before creating a bug report.

Which version of HA do you use?
0.110.0b0
Which version of the card do you use?
latest
Describe the bug
From a note to another custom-card developer

In Home Assistant 0.110 the way icons are loaded is changed. This means the paper-icon-button that is used in this element will no longer show the correct icon. You can use ha-icon-button that uses mwc-icon-button underneath as a replacement.

The Icons are to small after 0.110 beta
Auswahl_330

HACS install no card type found

Installed the Power wheel card via HACS

getting error No card type found

Resources looks good.
/hacsfiles/power-wheel-card/power-wheel-card.js JavaScript Module

No card type configured

  • type: 'custom:power-wheel-card'
    title: Power wheel
    solar_power_entity: sensor.shellyem_5e209e_channel_1_power_solar12
    grid_power_entity: sensor.p1_net_electricity_point
    debug: true

Hope you can help me.

No Auto Toggle

I have read the wiki about what to try first before creating a bug report.

Which version of HA do you use?
2021.1.4
Which version of the card do you use?
0.1.5
Describe the bug
A clear and concise description of what the bug is. Paste any error messages.
Is it possible to turn off the auto toggle feature and just switch view when clicked?

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

color_icons: true
consuming_color: 'var(--label-badge-yellow, #f4b400)'
debug: false
energy_decimals: 2
grid_energy_consumption_entity: sensor.daily_import
grid_energy_production_entity: sensor.daily_export
grid_power_consumption_entity: sensor.import_power
grid_power_production_entity: sensor.export_power
home_icon: 'mdi:home-assistant'
title_power: Power Now
title_energy: Energy Today
initial_auto_toggle_view: false
initial_view: energy
power_decimals: 0
auto_toggle_view_period: 0
producing_color: 'var(--label-badge-green, #0da035)'
production_is_positive: 1
solar_energy_entity: sensor.daily_solar
solar_icon: 'mdi:solar-power'
solar_power_entity: sensor.sdm120power
type: 'custom:power-wheel-card'

Dev console debug output
Add debug: true to your card parameters. Copy the complete output of the card that is logged to your dev console.
N/A

Expected behavior
A clear and concise description of what you expected to happen.
N/A
Screenshots
If applicable, add screenshots to help explain your problem.
N/A
Additional context
Add any other context about the problem here.
N/A

Problem with the power flow

I have read the wiki about what to try first before creating a bug report.

Which custom card does give you issues?
power-wheel-card

Which version of HA do you use? 0.102.2

Which version of the card do you use? 0.0.15

Describe the bug
The flow of power when the solar panels are consuming electricity (at night) are not rational to me... I would prefer to have the power consumed by the "house" coming from the grid and the power consumed by the panels coming from the grid as well (and not from the house to the panels as of today) - see screenshot under "expected behaviour" below and a screenshot of the existing flow under "screenshots"....Nevertheless, great job and I really love the card !!! Let me know if I need to provide more details.

Configuration of the card

       - type: custom:power-wheel-card
          title: "Bilan Prod/Conso Electricité Courcelles"
          consuming_color: "red"
          producing_color: "lime"
          solar_power_entity: sensor.smappee_solar_c
          grid_power_entity: sensor.smappee_injected

Dev console debug output
Add debug: true to your card parameters. Copy the complete output of the card that is logged to your dev console.

Example: power-wheel-cardVersion: 0.0.10Lovelace resource: power-wheel-card.js?v=0.0.10HA version: 0.87.1Report issues here: ...etc...

Expected behavior
desire_state

Screenshots
power

Additional context
Add any other context about the problem here.

Money view

Hello! thanks for the great card.

I'm having trouble viewing the money view. Its not there...

This is my config, i thought i've done everything stated in the docs.

      - type: custom:power-wheel-card
        title_power: "Power distribution"
        title_energy: "Energy distribution"
        title_money: "Energy costs/savings"
        solar_energy_entity: sensor.victron_pv_energy
        solar_power_entity: sensor.pv_power_production
        grid_power_consumption_entity: sensor.grid_power_consumption
        grid_power_production_entity: sensor.grid_power_production
        grid_energy_consumption_entity: sensor.daily_energy_consumption
        grid_energy_production_entity: sensor.daily_energy_production
        energy_consumption_rate: 0.22
        energy_production_rate: 0.20
        money_unit: "€"
        solar_icon: "mdi:white-balance-sunny"
        grid_icon: "mdi:transmission-tower"
        home_icon: "mdi:home-assistant"
        power_decimals: 3
        energy_decimals: 3
        money_decimals: 2
        color_icons: true
        consuming_color: "#dd5500"
        producing_color: "#33ff33"
        initial_auto_toggle_view: false

Card does not render in 0.116b1

Which version of HA do you use?
0.116b1

Which version of the card do you use?
3.1.7

Describe the bug
The card does not render in 0.116b1

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

  - auto_toggle_view_period: 10
    color_icons: true
    consuming_color: '#d41b1b'
    debug: false
    energy_consumption_rate: 0.25
    energy_decimals: 3
    energy_production_rate: 0.25
    grid_energy_consumption_entity: sensor.grid_energy_consumption
    grid_energy_production_entity: sensor.grid_energy_production
    grid_power_consumption_entity: sensor.grid_power_consumption
    grid_power_production_entity: sensor.grid_power_production
    initial_auto_toggle_view: false
    initial_view: power
    money_decimals: 2
    money_unit: $
    power_decimals: 2
    producing_color: '#53a122'
    production_is_positive: 1
    solar_energy_entity: sensor.solar_energy_production
    solar_power_entity: sensor.solar_power_production
    solar_power_icon: 'mdi:solar-power'
    title: Power Distribution
    title_energy: Power Distribution
    title_money: Power Distribution
    title_power: Power Distribution
    type: 'custom:power-wheel-card'
    view: power

Dev console debug output

power-wheel-cardVersion: 0.1.2Lovelace resource: power-wheel-card.jsHA version: 0.116.0b1Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36Report issues here: https://github.com/gurbyz/power-wheel-card/issuesProcessed config: { "auto_toggle_view_period": 10, "color_icons": true, "consuming_color": "#d41b1b", "debug": "fals", "energy_consumption_rate": 0.25, "energy_decimals": 3, "energy_production_rate": 0.25, "grid_energy_consumption_entity": "sensor.grid_energy_consumption", "grid_energy_production_entity": "sensor.grid_energy_production", "grid_power_consumption_entity": "sensor.grid_power_consumption", "grid_power_production_entity": "sensor.grid_power_production", "initial_auto_toggle_view": false, "initial_view": "power", "money_decimals": 2, "money_unit": "$", "power_decimals": 2, "producing_color": "#53a122", "production_is_positive": 1, "solar_energy_entity": "sensor.solar_energy_production", "solar_power_entity": "sensor.solar_power_production", "solar_power_icon": "mdi:solar-power", "title": "Power Distribution", "title_energy": "Power Distribution", "title_money": "Power Distribution", "title_power": "Power Distribution", "type": "custom:power-wheel-card", "view": "power", "charging_is_positive": 1, "invert_grid_colors": false, "active_arrow_color": "var(--paper-item-icon-active-color, #fdd835)"}Registered sensors: [ "sensor.solar_power_production", "sensor.grid_power_consumption", "sensor.grid_power_production", "sensor.solar_energy_production", "sensor.grid_energy_consumption", "sensor.grid_energy_production"]Views object: { "power": {  "title": "Power Distribution",  "oneGridSensor": false,  "twoGridSensors": true,  "batteryCapable": false,  "capable": true }, "energy": {  "title": "Power Distribution",  "oneGridSensor": false,  "twoGridSensors": true,  "capable": true }, "money": {  "title": "Power Distribution",  "oneGridSensor": false,  "twoGridSensors": true,  "capable": true }}

Expected behavior
I expect the card to display.

Screenshots
n/a

Additional context
n/a

Feature Request: Money view show if money is being spend or made with + and - symbols and colors

The money view is a bit hard to read. It's especially difficult to understand where you are spending or saving/making money.

How about showing all money numbers with a + or - in front of them and coloring them green and red? You'd instantly know what the situation is for each number.
Perhaps it should be optional because I could understand people not wanting to have too many colors on their dashboards.

Anyway, love the card!

Which version of HA do you use?
2021.1.4

Which version of the card do you use?
0.1.5

Using home power sensor (feature request)

Hi!
I want to use your power-wheel-card, but my installation is incompatible.
I need to use the value of my home power sensor for calculating the powerwheel.

image

On this picture the value 252W is my home power sensor. Is it possible to add it as an optional feature like grid_power_entity (C)? Otherwise i can only use Energy card..

Best regards.
Dennis

Icons too small in iOS app

I have read the wiki about what to try first before creating a bug report.

Which version of HA do you use?
0.110.2
iOS app 2.0.0(69)

Which version of the card do you use?
0.1.1

Describe the bug
On a desktop browser icon size is correct.
On a mobile browser icon size is correct.
In the iOS app icon size of the home/solar/grid icons is too small.

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

  - type: "custom:power-wheel-card"
    solar_power_entity: sensor.solar_power
    grid_power_consumption_entity: sensor.grid_power_consumption
    grid_power_production_entity: sensor.grid_power_production
    solar_energy_entity: sensor.solar_energy_today
    grid_energy_consumption_entity: sensor.grid_energy_consumption_today
    grid_energy_production_entity: sensor.grid_energy_production_today
    energy_consumption_rate: 0.1883

Expected behavior
Bigger size icons in iOS app.

The power-wheel-card isn't visible in the iOS Companion App

I have read the wiki about what to try first before creating a bug report.

Which version of HA do you use?
0.116.x

Which version of the card do you use?
0.1.4

Describe the bug
The power-wheel-card isn't visible at all in my iOS Companion App.

Using HACS cannot add to Lovelace

I have read the wiki about what to try first before creating a bug report.

Which custom card does give you issues?
power-wheel-card

Which version of HA do you use?
System: HassOS 3.12 (armv7 / raspberrypi4)
Home Assistant Core: 0.106.6
Home Assistant Supervisor: 209

Which version of the card do you use?
v0.0.16

Describe the bug
After installation via HACS I have status "Not loaded" and if I click on "ADD TO LOVELACE" link nothing changes.
On the lovelace card I am getting the message: Custom element doesn't exist: power-wheel-card.

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

grid_power_consumption_entity: sensor.fronius_house_load
grid_power_production_entity: sensor.fronius_grid_usage
solar_power_entity: sensor.fronius_ac_power
type: 'custom:power-wheel-card'

Dev console debug output
Add debug: true to your card parameters. Copy the complete output of the card that is logged to your dev console.

There seem to be no logs

Expected behavior
Power wheel available in lovelace configuration

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

feature request ... change grid icon when running on generator

I have read the wiki about what to try first before creating a bug report.

Which version of HA do you use?
0.118.4
Which version of the card do you use?
0.1.5
Describe the bug
feature request or help with work around if possible

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

  - type: "custom:power-wheel-card"
    solar_power_entity: sensor.solar_power
    ...etc...

Dev console debug output
Add debug: true to your card parameters. Copy the complete output of the card that is logged to your dev console.

Example: power-wheel-cardVersion: 0.0.10Lovelace resource: power-wheel-card.js?v=0.0.10HA version: 0.87.1Report issues here: ...etc...

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Feature request - ability to set card title: none or false or null

I have read the wiki about what to try first before creating a bug report.

**Which version of HA do you use? **

  • HaasV111.0

**Which version of the card do you use? **
0.1.1

Describe the bug
Feature request - ability to set title: none, or title: null or title: false
so that there is no title in the power wheel card, only displayed icons.
attempting to use any of the above values, shows default "Power Wheel" title

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

          - type: custom:power-wheel-card
            title: PV Batt Grid
            title_power: PV Batt Grid
            debug: false
            solar_icon: mdi:solar-power
            home_icon: mdi:home-city-outline
            solar_power_entity: sensor.modbus_sb_pv_production
            grid_power_consumption_entity: sensor.mqtt_sm_purchased_electricity
            grid_power_production_entity: sensor.mqtt_sm_grid_feed_in
            battery_power_entity: sensor.modbus_ss_supply_load_inverted
            battery_soc_entity: sensor.modbus_ss_charge_level

Dev console debug output
Add debug: true to your card parameters. Copy the complete output of the card that is logged to your dev console.
{ "type": "custom:power-wheel-card"
"title": "PV Batt Grid"
"title_power": "PV Batt Grid"
"debug": true
"solar_icon": "mdi:solar-power"
"home_icon": "mdi:home-city-outline"
"solar_power_entity": "sensor.modbus_sb_pv_production"
"grid_power_consumption_entity": "sensor.mqtt_sm_purchased_electricity"
"grid_power_production_entity": "sensor.mqtt_sm_grid_feed_in"
"battery_power_entity": "sensor.modbus_ss_supply_load_inverted"
"battery_soc_entity": "sensor.modbus_ss_charge_level"
"production_is_positive": 1
"title_energy": "PV Batt Grid"
"title_money": "PV Batt Grid"
"power_decimals": 0
"energy_decimals": 3
"money_decimals": 2
"money_unit": "€"
"color_icons": true
"consuming_color": "var(--label-badge-yellow, #f4b400)"
"producing_color": "var(--label-badge-green, #0da035)"
"invert_grid_colors": false
"active_arrow_color": "var(--paper-item-icon-active-color, #fdd835)"
"initial_view": "power"
"initial_auto_toggle_view": false
"auto_toggle_view_period": 10}Registered sensors: [ "sensor.modbus_sb_pv_production"
"sensor.mqtt_sm_purchased_electricity"
"sensor.mqtt_sm_grid_feed_in"
"sensor.modbus_ss_supply_load_inverted"
"sensor.modbus_ss_charge_level"]Views object: { "power": { "title": "PV Batt Grid"
"oneGridSensor": false
"twoGridSensors": true
"batteryCapable": true
"capable": true
"unit": "w" }
"energy": { "title": "PV Batt Grid"
"oneGridSensor": false
"twoGridSensors": false
"capable": false }
"money": { "title": "PV Batt Grid"
"oneGridSensor": false
"twoGridSensors": false
"capable": false
"unit": "€" }}

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Dynamic SoC threshold for battery charging behavior

Originally posted by @schwarzenbergf in #23 (comment)

On version 0.1.0b-dev.

OK, there's a little bit more than the first rule set. If you want to dig into more details, see here:
https://www.victronenergy.com/live/ess:design-installation-manual#batterylife
But in short, if you have a house battery you also want to be able to drive the house in case of grid outage (UPS functionality). For this you want to maintain a lower limit for the SoC to have enough battery capacity in case of grid outage. But that's not all. Especially in Winter time you also want to make sure that (at least from time to time) the battery get's fully charged. For this the 'Battery Life' algorithm is used (see URL above). And this algorithm shifts the SoC threshold, so it is dynamic (BL-SoC).
The 50% from my last post are now 55%.
So, in case SoC falls under BL-SoC the system switches to the mode which I described in the last post (Grid --> House, PV --> Bat).

At the moment I have SoC 61%, so I'm above the threshold (normal mode = first rule set):
powerwheel_pv2house bat1
This looks normal for me, but sometimes I see this (a few seconds later):
powerwheel_pv2house bat2
Actually there is no power flow from Battery to Grid (not in both modes).

For the mode SoC < BL-SoC (dynamic threshold):

  1. Grid delivers to House
  2. PV delivers to Battery

This is true as long as SoC < BL-SoC.
If (while charging the Battery) SoC goes above BL-SoC, the first rule set comes into play.

Originally posted by @schwarzenbergf in #23 (comment)

Feature request - coloring the arrows using the same colors the icons have

I'd like to suggest that the color of the arrows should match the icon of the icon they are coming from. This isn’t how it currently works, the arrows are either the color specified (or yellow by default) or gray if not used. As an example, if my icons are GREEN when “Exporting” and RED if they are “Importing” - (Import and Export from the viewpoint of the house), I'd like the arrows to be green when exporting or red when importing. Thanks

Displaying NaN while no produced power (solar_power_entity is unknown).

I have read the wiki about what to try first before creating a bug report.

Which version of HA do you use?
0.109.2

Which version of the card do you use?
v0.1.0

Describe the bug
Displaying NaN while no produced power (solar_power_entity is unknown).
nan

Configuration of the card

  - type: "custom:power-wheel-card"
	title_power: Power
	title_energy: Daily energy
	solar_icon: mdi:white-balance-sunny
	production_is_positive: true
	home_icon: mdi:home-assistant
	solar_power_entity: sensor.fronius_ac_power
	solar_energy_entity: sensor.fronius_day_energy
	grid_energy_consumption_entity: sensor.grid_energy_consumption_daily
	grid_energy_production_entity: sensor.grid_energy_production_daily
	grid_power_consumption_entity: sensor.grid_power_consumption
	grid_power_production_entity: sensor.grid_power_production

Dev console debug output
Add debug: true to your card parameters. Copy the complete output of the card that is logged to your dev console.

Version: 0.1.0
Lovelace resource: power-wheel-card.js
HA version: 0.109.2
Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36
Report issues here: https://github.com/gurbyz/power-wheel-card/issues
Processed config: {
 "type": "custom:power-wheel-card",
 "title_power": "Power",
 "title_energy": "Daily energy",
 "solar_icon": "mdi:white-balance-sunny",
 "production_is_positive": 1,
 "home_icon": "mdi:home-assistant",
 "debug": true,
 "solar_power_entity": "sensor.fronius_ac_power",
 "solar_energy_entity": "sensor.fronius_day_energy",
 "grid_energy_consumption_entity": "sensor.grid_energy_consumption_daily",
 "grid_energy_production_entity": "sensor.grid_energy_production_daily",
 "grid_power_consumption_entity": "sensor.grid_power_consumption",
 "grid_power_production_entity": "sensor.grid_power_production",
 "title": "Power wheel",
 "title_money": "Power wheel",
 "power_decimals": 0,
 "energy_decimals": 3,
 "money_decimals": 2,
 "money_unit": "€",
 "color_icons": true,
 "consuming_color": "var(--label-badge-yellow, #f4b400)",
 "producing_color": "var(--label-badge-green, #0da035)",
 "initial_view": "power",
 "initial_auto_toggle_view": false,
 "auto_toggle_view_period": 10
}
Registered sensors: [
 "sensor.fronius_ac_power",
 "sensor.grid_power_consumption",
 "sensor.grid_power_production",
 "sensor.fronius_day_energy",
 "sensor.grid_energy_consumption_daily",
 "sensor.grid_energy_production_daily"
]
Views object: {
 "power": {
  "title": "Power",
  "oneGridSensor": false,
  "twoGridSensors": true,
  "batteryCapable": false,
  "capable": true,
  "unit": "W"
 },
 "energy": {
  "title": "Daily energy",
  "oneGridSensor": false,
  "twoGridSensors": true,
  "capable": true,
  "unit": "kWh"
 },
 "money": {
  "title": "Power wheel",
  "oneGridSensor": false,
  "twoGridSensors": true,
  "capable": false,
  "unit": "€"
 }
}

Expected behavior
Can you handle unknown input value as 0 (zero)?

Screenshots
nan
fronius
templates_values

Would we able to have home_power_entity please

The calculations of home power usage is floored when a battery is installed.

Could we please have a home_power_entity?

The Tesla Powerwall as an example has a load usage which represents the power the house is using.

Power is drawn from the solar panels first, then the battery to make up a deficit and then if necessary the grid to make up the current house load.

The current calculation does not account for the battery power being supplied.

The following might help:

  1. This is what the powerwheel is showing
    image

  2. This is what the power system is actually doing.
    image

Power Wheels disappears randomly in 0.116.1

0.116.1 of HA
0.1.4 of Power Wheel

The Power Wheel will often no appear until I refresh the screen numerous times. This started immediately after install of 0.116.1 (from 0.115.6).

No debug info shows up in log.

BETA: No battery in energy view -> calculation for home energy wrong

Hi there,

I have set up the power wheel card with the beta battery function.
In power view everything is fine.
In energy view, a value for battery "movement" (prod/cons) is not used in calculation. Therefore the value for home energy is wrong.
It has to be: "calculated value" - "battery movement"

Thanks a lot.
Yours, Michael

Demand Tariff Support (Time of use)

I understand that the money view currently doesn't support having variable tariffs based on time of use, but would like to propose a design solution for allowing it to do so.

I don't have that much programming experience, but here's how I'd envisage it in my head. The logic should check if energy_consumption_rate or energy_production_rate are List/Dict types. If they are, it should look for the rate and entity variables under each, then run calculations based off those.

An example of the adapted configuration would be:

energy_consumption_rate:
  - rate: 0.2233
    entity: 'sensor.consumption_shoulder'
  - rate: 0.3625
    entity: 'sensor.consumption_peak'
  - rate: 0.2013
    entity: 'sensor.consumption_offpeak'

So this would equate to:

  • 22.33c/kWh for the consumption_shoulder sensor
  • 36.25c/kWh for the consumption_peak sensor
  • 20.13c/kWh for the consumption_offpeak sensor

Generating these sensors with templates shouldn't be particularly difficult, and can easily have a combined sensor too. Correct me if I'm wrong, but I believe this is likely the most elegant solution for this problem.

battery_power_entity Reverse

Could you add a switch for reversing this reading please?

Our SMA thingy (connected to a Tesla Powerwall 1) reports a - as flow into the battery and a + as flow out of the battery.

Cheers

I can not get it to work -> units are not equal

Which card does give you issues?
E.g. power-wheel-card

Which version of HA do you use?
E.g. 0.87.0

Which version of the card do you use?
E.g. 0.0.9

Describe the bug
I can not get it to work -> units are not equal

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

type: 'custom:power-wheel-card'
title_power: Vermogen verdeling
solar_power_entity: sensor.solar_power
grid_power_consumption_entity: sensor.grid_consumption
grid_power_production_entity: sensor.grid_production

Screenshots
schermafbeelding 2019-02-08 om 17 07 15

schermafbeelding 2019-02-08 om 16 55 28

Additional context
I use this sensors

  - platform: template
    sensors:
      solar_power:
        friendly_name: 'Solar power production'
        unit_of_measurement: 'W'
        value_template: >-
          {{ states("sensor.huidige_opbrengst") | float }}
      grid_consumpsion:
        friendly_name: Net afname
        unit_of_measurement: 'W'
        value_template: >-
              {%- if states("sensor.huidige_opbrengst") | float < states("sensor.huidig_verbruik") | float %}
                  {{ states("sensor.huidig_verbruik") | float - states("sensor.huidige_opbrengst") | float }}
              {%- elif states("sensor.huidige_opbrengst") | float > states("sensor.huidig_verbruik") | float %}
                  {{ 0 | float }}
              {% endif %}
      grid_production:
        friendly_name: Net terugsturen
        unit_of_measurement: 'W'
        value_template: >-
              {%- if states("sensor.huidige_opbrengst") | float < states("sensor.huidig_verbruik") | float %}
                  {{ 0 | float }}
              {%- elif states("sensor.huidige_opbrengst") | float > states("sensor.huidig_verbruik") | float %}
                  {{ states("sensor.huidige_opbrengst") | float - states("sensor.huidig_verbruik") | float }}
              {% endif %}
      
      solar_enery:
        friendly_name: 'Solar enery production'
        unit_of_measurement: 'kWh'
        value_template: >-
          {{ states("sensor.smappee_thuis_solar_today") | float }}
      grid_energy_consumpsion:
        friendly_name: Net afname
        unit_of_measurement: 'kWh'
        value_template: >-
              {%- if states("sensor.smappee_thuis_solar_today") | float < states("sensor.smappee_thuis_power_today") | float %}
                  {{ states("sensor.smappee_thuis_power_today") | float - states("sensor.smappee_thuis_solar_today") | float }}
              {%- elif states("sensor.smappee_thuis_solar_today") | float > states("sensor.smappee_thuis_power_today") | float %}
                  {{ 0 | float }}
              {% endif %}
      grid_energy_production:
        friendly_name: Net terugsturen
        unit_of_measurement: 'kWh'
        value_template: >-
              {%- if states("sensor.smappee_thuis_solar_today") | float < states("sensor.smappee_thuis_power_today") | float %}
                  {{ 0 | float }}
              {%- elif states("sensor.smappee_thuis_solar_today") | float > states("sensor.smappee_thuis_power_today") | float %}
                  {{ states("sensor.smappee_thuis_solar_today") | float - states("sensor.smappee_thuis_power_today") | float }}
              {% endif %}

Animated arrows

Anyone have any idea how to use animated arrows in the card? That would make the card much more pleasing, aesthetically.

Thanks!

3 decimals on Power

I have read the wiki about what to try first before creating a bug report.

Which custom card does give you issues?
power-wheel-card

Which version of HA do you use?
0.107.5

Which version of the card do you use?
0.0.16

Describe the bug
Energy display shows 3 decimals for Whr even when energy_decimals is set to 0. If set to 1, it correctly shows 1. Same with 2, 3,4,5, etc. But no way to get 0 decimals.

Power display works fine with 0 decimals.

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

type: 'custom:power-wheel-card'
title_power: Solar Power
title_energy: Solar Energy Today
grid_power_entity: sensor.power_now_meter_w
home_power_entity: sensor.power_now_usage_w
solar_power_entity: sensor.power_now_solar_w
solar_energy_entity: sensor.power_produced_today
grid_energy_consumption_entity: sensor.power_imported_today
grid_energy_production_entity: sensor.power_exported_today
initial_auto_toggle_view: false
power_decimals: 0
energy_decimals: 0
production_is_positive: false

Screenshots
If applicable, add screenshots to help explain your problem.

Capture

Incorrect calculations

I have read the wiki about what to try first before creating a bug report.

Which custom card does give you issues?
power-wheel-card

Which version of HA do you use?
100.2
Which version of the card do you use?
0.0.15
Describe the bug
the calculation seems skewed: at the moment I'm not producing any energy as the sun is down.
Power flow to grid value from my inverter: 556w (energy drawn from the grid)
Power flow load value from my inverter: -556w (energy consumed)

Configuration of the card

- platform: template
  sensors:
    solar_power:
      friendly_name: 'Solar power production'
      unit_of_measurement: 'W'
      value_template: >-
        {% if is_state('sensor.power_photovoltaics_fronius_power_flow_0_http_10_20_20_58', 'unknown') %}
        0
        {% else %}
        {{ states("sensor.power_photovoltaics_fronius_power_flow_0_http_10_20_20_58" | float) | int }}
        {% endif %}
    power_consumption:
      friendly_name: 'Power Consumption'
      unit_of_measurement: 'W'
      value_template: >-
        {{  states("sensor.power_load_fronius_power_flow_0_http_10_20_20_58")  }}

    power_exported:
      friendly_name: 'Power Exported'
      unit_of_measurement: 'W'
      value_template: >-
        {{ states("sensor.power_grid_fronius_power_flow_0_http_10_20_20_58") }}

Expected behaviour
the arrow should point in the direction of energy flow and fix the calculations

Screenshots
image

Meaningless values?

Where I live, I pay for import from the grid (consumption - €0.13) and get paid for export to the grid (production - €0.075).
These 2 rates have been added to the card config.

In the screenshot I have exported €0.31 and imported €0.43 and I have to pay €0.12. That's fine.

The values circled in red, however, seem meaningless to me. I do not think that they actually exist.
What does €1.11 on top mean, for example.? This is the total solar energy generated (export to grid + used by house) at the rate of 0.075.

90890055-88b15780-e3b9-11ea-92dc-cac5dfc1f35d

Power should no flow from Battery to Grid

Originally posted by @MimbaMonkeyHouse in #23 (comment)
(Only copied issue related content. Not the UX related content. UX related things can be added to the Collection topic about the battery layout.)

On version 0.1.0c-dev.

(...)
I'm not sure we need to over complicate things with manufacturer specific implementations and algorithm. Generally power flows from PV to Battery, Grid to Battery and Battery to House. It should not flow from Battery to Grid, really.

I've been using the dev branch for a couple of days and it generally works well. Thanks @gurbyz!
One issue I've noticed is battery feeding the grid. (...)

Originally posted by @MimbaMonkeyHouse in #23 (comment)

Card doesn't load in 0.106 beta

I have read the wiki about what to try first before creating a bug report.

Which custom card does give you issues?
power-wheel-card

Which version of HA do you use?
0.106.0b0

Which version of the card do you use?
Latest, fresh install 1 minute ago

Describe the bug
A clear and concise description of what the bug is. Paste any error messages.
Auswahl_276
I think related to:
https://developers.home-assistant.io/blog/2020/02/18/106-custom-card-changes/

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

                type: "custom:power-wheel-card"
                title: Leistungsverteilung
                solar_power_entity: sensor.e3dc_battery_power_neg2pos
                grid_power_production_entity: sensor.e3dc_net_power_neg2pos_only
                grid_power_consumption_entity: sensor.e3dc_net_power_pos_only
                home_icon: mdi:home-outline
                solar_icon: mdi:car-battery
                grid_icon: mdi:transmission-tower
                color_icons: true
                consuming_color: var(--my-green)
                producing_color: var(--my-yellow)

Dev console debug output
Add debug: true to your card parameters. Copy the complete output of the card that is logged to your dev console.

Example: power-wheel-cardVersion: 0.0.10Lovelace resource: power-wheel-card.js?v=0.0.10HA version: 0.87.1Report issues here: ...etc...

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

How to use negative values

I have an energy monitor set up and configured, the part that I am unsure of, is when the PV panels are producing at peak, and the power use is not matching it, there is a negative grid value as the house is feeding back to the grid...... example snapshot of power management

Mains: -748 Watts, pf: 0.86
AC: 988 Watts, pf: 0.96
Lights: 20 Watts
Power: 774 Watts, pf: 0.84
Laundry: 2 Watts
Solar Production: 2170 Watts, pf: 0.99

The card I have configured as:
type: 'custom:power-wheel-card'
title_power: HOUSE POWER
energy_decimals: 2
energy_price: 0.00026
grid_power_entity: sensor.iotawatt_channel_1
money_decimals: 0
money_unit: $
power_decimals: 2
solar_power_entity: sensor.iotawatt_channel_6

The card is displaying that I am drawing the grid amount though, not putting it back into the grid.
exmaple card

Can someone steer me in the right direction please?

Add in battery

If we have battery in/out figures could this component be updated to include battery too?

Like the tesla one

Screen Shot 2019-06-27 at 17 29 06

Card no longer rendering on HA 106

I have read the wiki about what to try first before creating a bug report.

Which custom card does give you issues?
power-wheel-card

Which version of HA do you use?
0.106

Which version of the card do you use?
0.0.16 (from HACS)

Describe the bug
A clear and concise description of what the bug is. Paste any error messages.
image

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

auto_toggle_view_period: 10
color_icons: true
consuming_color: 'var(--label-badge-yellow, #f4b400)'
debug: false
energy_decimals: 3
grid_power_consumption_entity: sensor.power_consumption
grid_power_production_entity: sensor.power_production
initial_auto_toggle_view: false
initial_view: power
money_decimals: 2
money_unit: €
power_decimals: 3
producing_color: 'var(--label-badge-green, #0da035)'
production_is_positive: 1
solar_power_entity: sensor.solar_now_kw
title: Power wheel
title_energy: Power wheel
title_money: Power wheel
title_power: Power wheel
type: 'custom:power-wheel-card'

Dev console debug output
Add debug: true to your card parameters. Copy the complete output of the card that is logged to your dev console.
image

Example: power-wheel-cardVersion: 0.0.10Lovelace resource: power-wheel-card.js?v=0.0.10HA version: 0.87.1Report issues here: ...etc...

Expected behavior
Normal powerwheel behavior as on 0.105 and lower

Screenshots
If applicable, add screenshots to help explain your problem. see error

Additional context
Add any other context about the problem here.

Error after updating HA to 0.106

I have read the wiki about what to try first before creating a bug report.

Which custom card does give you issues?
power-wheel-card

Which version of HA do you use? Home Assistant 0.106.0

Which version of the card do you use? const __VERSION = "0.0.16";

Describe the bug
A clear and concise description of what the bug is. Paste any error messages.
Like the bug opened by VDRainer. Initially I had v.0.0.15 installed. I understood that installing version 0.0.16 all would have worked nicely.

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

- type: custom:power-wheel-card
      solar_power_entity: sensor.inverter_current_power
      grid_power_consumption_entity: sensor.inverter_current_export_power
      grid_power_production_entity: sensor.inverter_current_import_power 

Dev console debug output
Add debug: true to your card parameters. Copy the complete output of the card that is logged to your dev console.
Sorry, I don't know what the dev console is.

Expected behavior
A clear and concise description of what you expected to happen.
All worked well since end of november, when my FV panels have been activated. This card is fantastic.

Screenshots
If applicable, add screenshots to help explain your problem.
power-wheel-Home Assistant

Additional context
no additional info

The arrow is always "on" even though I don't buy electricity

Which version of HA do you use?
2021.3.1

Which version of the card do you use?
0.1.5

Describe the bug
Even though I'm producing enough electricity, the card show me, that I buy extra electricity (see attachment)

Configuration of the card
Copy the complete configuration of the card, even if you think it isn't relevant.

type: 'custom:power-wheel-card'
title: Photovoltaik
solar_power_entity: sensor.solarlog_power_ac
grid_power_consumption_entity: sensor.solarlog_consumption_ac
grid_power_production_entity: sensor.solarlog_power_ac

IMG_5253

Issues with HA 0.106.x?

Please see closed issues #34, #35 and #36 for hints. You probably are impacted by caching or a HACS issue, not by an issue in power-wheel-card.

Error on loading

Which card does give you issues?
power-wheel-card

Which version of HA do you use?
Example: 0.88.2

Which version of the card do you use?
Example: 0.0.10

Describe the bug
http://xxx.xxx.xxx.xxx:8123/local/power-wheel-card.js?v=1:7:27 Uncaught TypeError: Cannot convert undefined or null to object

Configuration of the card

      - color_icons: true
        grid_power_consumption_entity: sensor.fv_import
        grid_power_production_entity: sensor.fv_export
        power_decimals: 2
        solar_power_entity: sensor.fv_produzione
        title: Fotovoltaico
        type: 'custom:power-wheel-card'

Developer console debug output
Uncaught TypeError: Cannot convert undefined or null to object
at Function.getPrototypeOf ()
at power-wheel-card.js?v=1:7

Expected behavior
For the custom card to work :)

Additional context
I had it briefly working then tried to add energy view. After broking functionality i tried to come back but was not working anymore

iOS 10

Which card does give you issues?
power-wheel-card

Which version of HA do you use?
0.87.1

Which version of the card do you use?
0.0.9

Describe the bug
The card gives 'Custom element doesn't exist: power-wheel card' on iPad 4 IOS 10.3. Works on iOS 11 and macOS.

Configuration of the card

color_icons: true
grid_power_consumption_entity: sensor.import_power
grid_power_production_entity: sensor.export_power
home_icon: 'mdi:home-assistant'
power_decimals: 0
power_icon: 'mdi:transmission-tower'
solar_icon: 'mdi:solar-power'
solar_power_entity: sensor.sdm120power
title: Power Now
type: 'custom:power-wheel-card'

Expected behavior
To work on older iOS devices.

Screenshots
img_2006

Additional context
This is the card in Safari:
screen shot 2019-02-18 at 12 50 30

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.