Thanks for sharing cause it had helped me to.
I have needed more or less exactly that showing an individual state instead of the sensors value.
I have an entity which can have 4 states called internationally
âoff, now, minpv, pvâ which describe the way how solar surplus power can be used to charge a car or whatever auxiliary device like a heatpump or immersive heater (iron bar in water cylinder).
now stands for the fastet way
pv stands for pure surplus electric from your roof alon
pvmin for the idea to add the smalles amount of grid power to be able to charge the car
Makes a huge difference if I can use 3000 W to charge a car from surplus cause that price is 7 cent while the price from the grid will vary over the day from rarely 20 cents to 55 cent in the morning and evening hours, which will be explained at the end.
SOLUTION
expanding your code to 4 states with 4 messages
state_display: |
[[[
if (entity.state === 'pv')
return 'PV pur';
else
if (entity.state === 'pvmin')
return 'PV + min. Netz';
else
if (entity.state === 'now')
return 'VOLLGAS';
else
return 'KEIN LADEPROGRAMM';
]]]
At the end only the last line below the icon has changed but that is the important one for the users who wanna charge the car as cheap as possible
It says: âPV purâ aka âcharging by pure surplus power onlyâ
Difference: driving a car for 25% of the usual electricity prices within its range
Technical explanation
Therefore pvmin can be very usefull if your surplus is just 2500 Watt. The charger would not charger unless you allow to add 500 W from the grid. Assuming that would prolong your charges 1hour in the morning and 1 hour in the evening the difference would be astonishing if we take 6 kWh to charge
2 h x 2500 W = 5000 Wh = 5 kWh fed into the grid for 35 cents
but charging the car during cheapest night tarif at 25 cents x 6 kWh = 150 cents
115 cents or 400% more expensive this way to feed in and charge
In case of pv min mode it would be a 6 kWh charge again 2 hours
5000 Wh from the roof and 1000 Wh from the grid = 35 cents + depending on the tarif 30 - 50 cents or in total 65 cents to 85 cents
which is lot less than 150 cents.
âFinancial orientationâ
Even the most efficient Diesel are using 5 Liter Diesel per hkm which means burning the equivalent of 5 L x 9,8 kWh / L = 49 kWh for 100 km
Price is 160 Cent per Liter so 800 Cent or 8⏠per 100 km
The EV will need 15 kWh per 100 km but the price will depend if you can surplus charge at home. Pure surplus charge would mean 15 x 7 = 105 cent per 100 km
fully charged during night from grid 15x 25 Cent = 375 cent per 100 km
That means you can drive for 1 / 8th of the price for Diesel up to 50%
And that is a lot to save - not to mention the lower emissions and close to no brakepad wear and tear which leads to particles in the city streets aka the dust and dirt cause the EV is slowing down by activating the engine as generator to recuperate energy from the moving mass into electricity which is stored in the battery for later use. The more you hit the brake the stronger the generator will act until you reach its limits and beyond that the genuine brakes will start their action at a very cold stage so you have a lot more reserves.
Thanks a lot - has helped me cause our elderly parents in their 80s are not so good in understanding acronyms like pv, pvmin, now and off
Now they can make the right choice to charge pure from the sun or if they are in a hurry ânowâ with full speed no matter what ( takes up to 5 hours to be fully charged from 0, but who drives his ICE to 0 km and miss the gas station ).