Hello, I’m currently learning programming and I’m learning more and more. Now I want to program a PV surplus for my Tesla. So far I’ve managed to get a meter to increase by one when I draw from the grid (in future the amps should be increased here) and also decrease by one. But now I want to connect everything to the amps of my Tesla. If there is a surplus, increase by 1 or decrease by 1 if there is no surplus. The termination is “number.lenard_charging_amps”. I don’t know what to do next.
alias: Tesla Charging Control
description: Adjust Tesla charging amps based on solar power availability.
trigger:
- platform: time_pattern
seconds: /10
condition:
- condition: and
conditions:
- condition: time
after: "07:00:00"
before: "19:00:00"
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.growatt_sph_3_phase_grid_power
above: -10000
below: -250
sequence:
- service: counter.increment
target:
entity_id:
- counter.zahler_ampere
data: {}
- conditions:
- condition: numeric_state
entity_id: sensor.growatt_sph_3_phase_grid_power
above: 250
below: 10000
sequence:
- service: counter.decrement
metadata: {}
data: {}
target:
entity_id: counter.zahler_ampere