Looking for some help with performing math on an a blueprint input.
I want to check if the value of the entity ‘tesla_charging_amps_number_entity’ is equal to or greater than a number value set in the template ‘tesla_charging_amps_upper_value’
I am trying to use a condition: numeric_state at the moment and then subtract -1 from the number provided and then check if the value is above. Not sure if this is the best way.
So say the value provided is 16 then I want to subtract 1 from that, then check if the current value of the entity above 15 using the numeric_state condition.
Not sure if there is a better way, maybe using a template but been struggling to get the correct syntax.
input:
tesla_charging_amps_number_entity:
name: Select the entity which represents the Tesla charging amps (e.g. number.tesla_charging_amps)
selector:
entity:
filter:
- domain: number
integration: tesla_custom
tesla_charging_amps_upper_value:
name: Select the number of amps that charging should not increase past
default: 10
selector:
number:
min: 0
max: 32
step: 1
mode: slider
variables:
var_tesla_charging_amps_upper_value: !input tesla_charging_amps_upper_value
var_tesla_charging_amps_number_entity: !input tesla_charging_amps_number_entity
action:
- if:
then:
else:
- condition: not
conditions:
- condition: numeric_state
entity_id: !input var_tesla_charging_amps_number_entity
above: {{ state_attr(var_tesla_charging_amps_upper_value) | int -1 }}