Untitled

mail@pastecode.io avatar
unknown
yaml
2 years ago
412 B
3
Indexable
Never
trigger:
  - platform: state
    entity_id: sensor.battery
    variables:
      diff: "{{ trigger.to_state.state | float(-1000) - trigger.from_state.state | float(1000) }}"
condition:
  - "{{ diff > 0 }}"
action:
  - service: input_number.set_value
    data:
      value: "{{ states('input_number.total') | float + diff / 100 }}"
    target:
      entity_id: input_number.total
mode: queued
max: 10