Charging amps as a numeric value of another entity #598
Replies: 2 comments
-
I use an "input_number" helper (not sensor) for things I want to calculate and store, and maybe set on the car later (depending on other bits of logic). So, my suggestion is to create an input_helper called something like "solar_amps_avail". Set up an automation to calculate solar amps avail, which would be triggered either by time interval or when your solar equipment sensors update, and assign the result to input_number.solar_amps_avail. Then, in the same or a separate automation, set number.charging_amps (the one that gets pushed to the car) equal to input_number.solar_amps_avail. The YAML for the assignment automation action might look something like:
The |max and |min are just to trap the value between a sane lowest and highest value (between 1 and 16 in the above example), and the |round(0) forces the result/assignment to the car to be the nearest whole integer. If you always wanted to round down, you could use |int instead of |round(0). |
Beta Was this translation helpful? Give feedback.
-
You can provide a template value via a script: alias: Tesla Solar
sequence:
- service: tesla_custom.api
data:
command: CHARGING_AMPS
parameters:
path_vars:
vehicle_id: "{{ state_attr('binary_sensor.online', 'id') }}"
charging_amps: >-
{{
(states('sensor.excess_solar_charging_amps')|float(0))|int(0)
}}
mode: single and call this script via an automation: |
Beta Was this translation helpful? Give feedback.
-
First and foremost I'm still a newbie on Home Assistant
I'm trying to set an automation where the charging_amps (A) = "Excess solar power"(W) / Current (V)
I can create a sensor.optimum_charging_amps but the problem is that when setting an automation I am not allowed to use a numeric value of another entity and I have to use a fixed value for the Amps instead
How can I get around this?
Beta Was this translation helpful? Give feedback.
All reactions