Custom Solar Power Card the Tesla Style (almost)

Dear All,

For anyone trying to setup up this card with the default Solaredge integration https://www.home-assistant.io/integrations/solaredge, I have finally worked out the correct yaml to use.

# This is used for Telsa Solar / Consumption power distribution card  

      # sensor used to show power flow from Panels to Grid, but shows a negative at night   
      solaredge_template_panels_2_grid_day:
        friendly_name: 'Panels 2 Grid during daylight'
        value_template: >-
          {{ (states('sensor.solaredge_solar_power') | float - 
                                states('sensor.solaredge_power_consumption') | float ) | round(2) }}
        unit_of_measurement: 'kW' 
        device_class: "power"

      # shows the current grid power being fed from the grid to the house and doesn't allow it to show a negative number only positive numbers  
      solaredge_template_curent_grid_consumption:
        friendly_name: grid 2 house"
        unit_of_measurement: kW        
        device_class: power
        value_template: >-
          {% if states('sensor.solaredge_grid_power')|float < 0 %}
            0
          {% else %}
            {{ states('sensor.solaredge_grid_power') }}
          {% endif %}

      # sensor used to show power flow from Panels to Grid and doesn't allow it to show a negative number only positive numbers
      solaredge_template_panels_2_grid:
        friendly_name: 'Panels 2 Grid'
        unit_of_measurement: 'kW' 
        device_class: "power"
        value_template: >-
          {% if states('sensor.solaredge_template_panels_2_grid_day') | int > 0 %}
            {{ states('sensor.solaredge_template_panels_2_grid_day') }}
          {% else -%}
            0
          {% endif %}        

      # shows the solar power being fed to the house and doesn't allow it to show a negative number only positive numbers 
      solaredge_template_curent_solar_consumption:
        friendly_name: Solar 2 House"
        unit_of_measurement: kW        
        device_class: power
        value_template: >-
          {% if states('sensor.solaredge_template_panels_2_grid_day') | int > 0 %}
            {{ states('sensor.solaredge_power_consumption') }}
          {% else -%}
            0
          {% endif %} 
  - type: 'custom:tesla-style-solar-power-card'
    house_consumption_entity: sensor.solaredge_power_consumption
    grid_consumption_entity: sensor.solaredge_template_curent_grid_consumption
    grid_feed_in_entity: sensor.solaredge_template_panels_2_grid
    solar_consumption_entity: sensor.solaredge_template_curent_solar_consumption
    solar_yield_entity: sensor.solaredge_solar_power

I hope this helps somebody

2 Likes

Hey you all. Iā€™m about to push the latest beta release 1.1.5 as the new version of the card. This one is NOT backwards compatible. Meaning you have to redefine the configuration. Now the flows are determining everything. Could some of you try to check out the Readme and let me know if this makes sense and you would know how to deal with it? Any feedback is welcome.

I will create a new forum topic for it as soon as I do create a new normal release.

Think you should baptize the new card too :wink:

1 Like

Call it the Volt Card :rofl: or Ampera Card :sweat_smile:

Will keep the name for now :wink: but I get you. Here is the new thread for any questions about the new version.

Thanks, very usefulā€¦

Hi, I have the following yaml:

type: 'custom:tesla-style-solar-power-card'
name: Power Flow
house_consumption_entity: sensor.power_consumption_total
grid_to_house_entity: sensor.power_consumption_w
generation_to_house_entity: sensor.growattmodbus_output_power
generation_to_grid_entity: sensor.power_production_w
show_w_not_kw: 1

sensor.power_consumption_total gives ~1300W (my house consumpotion calculated in home assistant)
sensor.growattmodbus_output_power gives ~4000W (solar panel production)
sensor.power_production_w gives ~2750W (Meter production)
sensor.power_consumption_w gives ~0W (Meter consumption)

Why and where does it count that big value from? And what does the orange pictogram mean? The grid? I assume the solar panel :see_no_evil: :rofl:

image

Thank you for you support

Think I got it by adding an extra entity to deduct the total:

type: 'custom:tesla-style-solar-power-card'
name: Power Flow
generation_to_grid_entity: sensor.power_production_w
grid_to_house_entity: sensor.power_consumption_w
generation_entity: sensor.growattmodbus_output_power
generation_to_house_entity: sensor.power_consumption_solar_new
show_w_not_kw: 1

image

Really hate the icon, always replace it with Material Design Icons - Icon Library - Pictogrammers

Where and how (in this card - I am familiar with icons)

Done:
generation_icon: ā€˜mdi:solar-powerā€™

Plugged into a three phase system yesterday and the figures were out by a factor of three:

Updated template sensors:

- platform: template
  sensors:

    tesla_current_charging:
      friendly_name: Tesla charging rate sensor
      value_template: >-
        {{
        (states.sensor.duka_charging_rate_sensor.attributes.charger_actual_current *
        states.sensor.duka_charging_rate_sensor.attributes.charger_voltage / 1000 *
        states.sensor.duka_charging_rate_sensor.attributes.charger_phases ) *
        | round(2) }}
      unit_of_measurement: kW

When the PV system is producing more power than the home is consuming is it correct how a negative value as indicated in this image?

In a previous version, this was always positive. Thx

image

It should be negative as you are exporting to the grid

How can it be that it works well in the PC browser but not in the mobile app and the mobile browser? all is ā€œ0ā€ there and not showing appliances thenā€¦ ?

The mobile app needs you to refresh the cash. You find it underneath ā€œMenuā€->ā€œApp configurationā€->ā€œreset frontend cacheā€. For your mobile browsers you have to do a cache refresh also. But that will depend on your current browser. This is necessary since browsers on mobile donā€™t ā€œcloseā€.

Thank you. The homeassistant app does not have this option. But going into android settings and clearing cache there did it.

I think I have a Bug in my Setup with this Sensor.

      solar_consumption:
          unique_id: 'solar_verbrauch_2bb67bd5264f4ec39f141f1722fea085'
          value_template: >-
            {% set solar = states('sensor.grid_infeed') | float %}
            {% set house = states('sensor.hausverbrauch') | float %}
            {{ solar if house > solar else house }}
          device_class: "power"
          unit_of_measurement: W

generation_to_house_entity: sensor.solar_consumption

when Iā€™m right, the house state is my curent house consumption - right?
And Solar is my curent Solar generation

And here my card setting:

house_consumption_entity: sensor.hausverbrauch // curent House consumption 
grid_consumption_entity: sensor.netz_bezug // grid consumption 
battery_consumption_entity: sensor.battery_discharging 
generation_yield_entity: sensor.grid_infeed // solar generation
generation_to_grid: sensor.netz_einspeisung // grid feed
generation_to_house_entity: sensor.solar_consumption //?!?!
battery_extra_entity: sensor.batterie_soc
grid_to_battery_entity: sensor.battery_charging
generation_to_battery_entity: sensor.battery_charging
battery_to_house_entity: sensor.battery_discharging
grid_to_house_entity: sensor.netz_bezug // grid consumption 
appliance1_consumption_entity: sensor.ladepunkt
appliance1_extra_entity: sensor.auto_soc
grid_extra_entity: sensor.grid_tages_verbrauch

right now im missing the line - Solar to grid.

NVM :slight_smile: Found my issue. missed entity :

generation_to_grid_entity: sensor.netz_einspeisung // grid feed

btw it was a copy cat mistake from the github page.

After youā€™ve included these sensors then you can configure the card like this:

type: ā€˜custom:tesla-style-solar-power-cardā€™
house_entity: sensor.powerwall_load_now
grid_entity: sensor.tesla_card_grid_consumption
battery_entity: sensor.tesla_card_battery_consumption
generation_entity: sensor.powerwall_solar_now

generation_to_grid: sensor.tesla_card_grid_feed_in
generation_to_house_entity: sensor.tesla_card_solar_consumption
generation_to_battery_entity: sensor.tesla_card_battery_charging
battery_to_house_entity: sensor.tesla_card_battery_consumption
grid_to_house_entity: sensor.tesla_card_grid_consumption

battery_extra_entity: sensor.powerwall_charge

I have a strange issue with this card. I want to use this card with solar panels. Maybe someone can help.
image

The solar panel tile is showing the grid and house usage side by side. Normally i want to see what iā€™m producing. What do i do wrong?

type: 'custom:tesla-style-solar-power-card'
name: Solar Power
generation_entity: sensor.toon_p1_power_solar
grid_to_house_entity: sensor.stroom_verbruik
generation_to_house_entity: sensor.stroom_levering
generation_to_grid_entity: sensor.panelen2grid
show_w_not_kw: 1

Canā€™t find anything to fix

i should think it will do
grid + house consumption = solar production

thanks for the catch, working on the correction, will be online with my next Push