@Troon
I didn’t get the triggered sensor working. So I tried the automation.
It almost worked, but the trigger.from_state.state is always 0. So I don’t get the diff working, it always adds the complete trigger.to_state.state value.
For testing I tried to also write “trigger.from_state.state” into a log variable. But it stays 0.
“sensor.test_drop” is sensor with a fixed number, I updated manually, which will be later swapped out for a real sensor. What is also weird, if I use number variable as a trigger, then the automation does not triggered at all.
Ok. I got it working now.
I changed the trigger to state trigger.
But also my testing setup was not working. For testing I created template sensor, which returned a hard coded number. And for testing I manually adapted the number, by adapting the sensor configuration. An probably, that somehow reset the sensor, so that it lost its previous value.
When I tried it with a templated sensor, that read it value from an number input and changed the value of that input, the previous value is kept and the automation works as expected.