slipx06 / sunsynk-power-flow-card

⚡A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.
MIT License
161 stars 48 forks source link

color the flow #449

Closed jolly12f closed 1 month ago

jolly12f commented 1 month ago

Is there an existing issue for this?

Current Behavior

at this moment the flow that goes from the inverter towards the house remains blue

Expected behaviour

I would like to color the stream based on the source it is using

Possible Solutions

It should take the color of the battery, the sun or the grid, so it would be nice to see the flow of the same color going towards the load. the house icon is already colored that way, I don't think there are any problems coloring the flow too

Mode

Both

Context / Reason

it would be more beautiful to look at

jolly12f commented 1 month ago

IMG_3905

slipx06 commented 1 month ago

Hi. Something like this?

image

Roving-Ronin commented 1 month ago

@slipx06 dumb question... whats the 'Limit: 8.00 kW' map to ? I'm assuming it shows if there's a limit on the 'maximum export = xxxx W'? Is this able to be linked to a sensor, as Huawei/iStore with WLCRS integration v1.4.0 (Alpha atm) adds:

IIRC this is then sent to the inverters (or primary only that controls all of them?) at: number.inverter_1_power_derating or number.inverter_1_power_derating_by_percentage

slipx06 commented 1 month ago

Yes maximum export to grid based on Watts. You can provide a sensor e.g. max_sell_power: huawei_solar.set_maximum_feed_grid_power

jolly12f commented 1 month ago

CIAO. Qualcosa come questo?

Immagine

yes exactly, I would also color the tables with numbers!!

slipx06 commented 1 month ago

I've only applied this to the path element for now and also implemented for the battery

Roving-Ronin commented 1 month ago

@slipx06 thanks for this update. Could you please check your HA and see if you get this error also? I have the following sensors, like this (my own HA has a more complex tariff plan, but same format and issue):

    - name: "Electricity - Price" 
      unique_id: electricity_price
      unit_of_measurement: "$/kWh"
      device_class: monetary
      state: >
        {## Enter cost per kWh rates below. Rate 1 ##}
        {% set rate1 = 0.30812 %}
        {% set rate2 = 0.0 %}
        {% set power_meter_active_power = states('sensor.power_meter_active_power') | float %}
        {% if power_meter_active_power <= 0 %} {{rate1}}
        {% else %} {{rate2}}
        {% endif %}

#  Current FIT rate, rate 1 & 2 allows setting a second rate if variable FIT rates (i.e. $0.15 for first 10kWh, then $0.07 thereafter)

    - name: "Electricity - FIT"
      unique_id: electricity_fit
      unit_of_measurement: "$/kWh"
      device_class: monetary
      icon: mdi:cash-plus
      state: >
        {## Enter compensation per kWh rates below ##}
        {% set rate1 = 0.07 %}
        {% set rate2 = 0.07 %}
        {% set fit_exported_today = states('sensor.hs_grid_exported_daily') | float %}
        {% if fit_exported_today <= 10 %} {{rate1}}
        {% else %} {{rate2}}
        {% endif %}

These sensors output a Grid Export price (FIT) that when over 10kWh exported for the day reads as 0.07 (device_class: monetary so in the dash shows with the $), conversely the above it setup to say if the Power Meter is reading as <=0 Watts i.e. exporting, then report 0.30812

Given this when exporting the price showing next to the grid should be $0.07 $/kWh, however its showing as 0.07} $/kWh.

...change of plans, I think I managed to find the typo myself. I've lodged PULL request if you want to check it please ?

https://github.com/slipx06/sunsynk-power-flow-card/pull/457

Roving-Ronin commented 1 month ago

@slipx06 just noticed this, now that I'm importing at night. Bit of overlap on the 'h' from kWh and the transmission tower.

image

slipx06 commented 1 month ago

@slipx06 just noticed this, now that I'm importing at night. Bit of overlap on the 'h' from kWh and the transmission tower.

image

Thanks I've corrected this

github-daniel-stoian commented 1 month ago

@slipx06 It's not working on my side. The load line is still blue.

slipx06 commented 1 month ago

@github-daniel-stoian I think I found the issue. Can you enable dynamic Icon under load options and see if it enables this?

github-daniel-stoian commented 1 month ago

@slipx06 No, it does not work. I've played extensivelly with dynamic_icon and dynamic_colour under Load, setting them true or false in any possible combination.

image image
slipx06 commented 1 month ago

No that's expected behavior. The colour of the line will only change when a single source is able to supply 100% of the load. Wait until you have enough PV and it will change. You have to have dynamic_icon: true but I'll fix that

github-daniel-stoian commented 1 month ago

It does not work when PV is able to supply 100% of the load with dynamic_icon: true

But somehow it does work when Grid is providing 100% of the load with dynamic_icon: true

image Screenshot 2024-05-28 at 13 51 19
slipx06 commented 1 month ago

Are you sure you have dynamic_icon is set to true in your first screenshot. The icon should show the picture of the house with solar panles and sun when the PV supply exceeds the load? In any case I need to update the code to remove the dependency on this setting. So wait for the next release to test.

jolly12f commented 1 month ago

in my case it doesn't color when 100% comes from the grid

github-daniel-stoian commented 1 month ago

Are you sure you have dynamic_icon is set to true in your first screenshot: Yes, I'm sure. The icon should show the picture of the house with solar panles and sun when the PV supply exceeds the load? : No

Screenshot 2024-05-28 at 16 22 04
slipx06 commented 1 month ago

Can you share your card config. Do you have a sensor defined for non essential power and aux power?

github-daniel-stoian commented 1 month ago

No sensors for non-essential and aux power.

github-daniel-stoian commented 1 month ago

Seems to work now after I've updated to v4.40.1 and changed the followings settings:

    solar:
      off_threshold: 1

   load:
      off_threshold: 1
      path_threshold: 90

    grid:
      no_grid_colour: grey
      off_threshold: 1

     entities:
      grid_power_169 replaces with essential_power
image