enkama / hass-variables

Home Assistant variables component
90 stars 12 forks source link

I need Increment and Decrement service for values #75

Closed Bibyte closed 1 year ago

Bibyte commented 1 year ago

I need Increment and Decrement service for float (integer) values

for example: if it 4 -call Increment service with step parametr = 1 will change value to 5. With step value 0.1 - change value to 4.1

Snuffy2 commented 1 year ago

This is probably best done through an automation, script, or template using the variable.update_sensor service.

seanmccabe commented 1 year ago

I do this for incrementing

plays: "{{ 1 + state_attr(variable, 'plays')|int(1) }}"