I’ve been fighting with HA to turn off my EV charger when 10kW have been added to save the PV batteries.
I’ve been using openHAB for years but there isn’t a binding for the WallBox charger so I’ve got HA running in a Pi in the garage. In OH it’s this.
var Number Limit
rule "Set Charge Limit"
when
Item WBSwitch changed to ON
then
Limit = WBAdded.state + 10
postUpdate(WBLimit, Limit)
end
rule "Switch off Charger"
when
Item WBAdded changed
then
Limit = WBLimit.state
if (WBAdded.state > Limit) {
sendCommand(WBSwitch, OFF)
}
end
I’ve tried automations, variables, helpers. Why is it so difficult to do something that’s so easy in OH?
You’re more likely to get prompt assistance if you create a new topic (as opposed to appending to a long dormant topic about variables).
Post whatever automations you have tried (as opposed to OpenHAB code that requires the reader to understand the difference between postUpdate and sendCommand).
If the first automation is converted to a Trigger-based Template Sensor, then the Input Number can be eliminated and the solution is reduced to one automation and one Trigger-based Template Sensor.