Custom Solar Power Card the Tesla Style (almost)

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

Is directly responsible for what is shown there. Could it be that you are concatenating instead of summing there? Could you check on what is in that sensor. I would guess that your sensor is the culprit.

Anyone here that has gotten it to work with Ferroamp?

I have been playing around and creating several template sensors but it goes bananas.

And for some reason the template goes bananas aswell when I do some changes it looks like this
image

So I need to press save and to go normal view to see if it works.,
And back again to changeā€¦

thnx, that one is the solar production only. Itā€™s a seperate meter. I find out that this problem occurs only when grid is -
When grid is not - , the card is showing everything great. Any idea why this problem occurs only when grid is - ?

image

@itguy All sensors should be positive otherwise the math doesnā€™t work. Use one of the templates to make is positive all the time:

battery_consumption:
        value_template: '{% set batter_cons = sensor.powerwall_battery_now | int %}
                        {% if batter_cons > 0 %}
                            {{ batter_cons | int }}
                        {% else %}
                            0
                        {% endif %}'
        device_class: power
        unit_of_measurement: W

Is there an easy-ish way to change the rate at which the circles move? (for standard rate, not necessarily based on power draw)

Currently you can only change the speed rate by changing this line in the code. It will still be a factor of power though. What did you have in mind?

Was just hoping for it to move at a standard rate, not necessarily depending on power.

The majorly slow rate of the 0.01 kW draws are funny :stuck_out_tongue_winking_eye: