I’m currently migration some of my node-red automations. In this case there’s one that I don’t know how to replicate in HA.
It’s a slow coast for a stop EV charging action.
There’s a button that says “Stop charge”
When you push it:
The value for the charge power limiter is stored.
From there, every 1s, 230w are substracted to that value, and published to mqtt.
When this setting arrives to 500w, the subtraction is stopped.
Waits for a minute.
And then restores the original value of the setting (and publishes)
The effect is that the charge stops without feeding back in excess my home battery system, and as a side effect, the car ejects the hose-plug. Then after a minute all is restored and you can plug and charge again, so golden!
Passing the current value as a parameter could had simplified the while thing, but it’s not possible.
(I am building all of this in packages, so I have a nice SoC an can share it.)
I had to convert the script to an automation, creating dummy entities…
So I finally done like you suggested:
I’ve also tried to give the charge power limit entity a custom attribute, but I couldn’t set it from a script.
I suppose HA still has a long path to go.
PD: So many thanks for your help. Also I converted the entity to a mqtt-number entity so mqtt publishing is automatically managed.