I’m trying to create an automation to set the watering level for my sprinklers using a soil moisture sensor as the input, and the watering level in Opensprinkler as the output.
The slightly tricky part for me is that I need to calculate the “inverse” percentage as set that as the watering level, using 50% as the break even point. For example
soil moisture: 50%
watering level: 50%
soil moisture 30%
watering level: 70%
soil moisture 70%
watering level 30%
I was thinking about having the trigger run once per day at midnight, and then in actions defining a variable that pulls the soil moisture level, then performs the percentage calculation, then when calling the Action to set the watering level specify the variable.
I actually ended up using the compensation integration as @Sir_Goodenough suggested. The last part I’m stuck on is getting the action to accept the template.