Add Functions

Some services or entities have data which would be handy if available through a function providing more context.
For example the sun service provides elevation and azimuth, but when will the sun be above 12 degrees?
To be able to ask the sun for that needs a function call.
Also on entities that provide numeric values a function that would return the projected time an entity might reach a value. i.e. at the existing rate of change this value will reach 20% @ 22:44.
Some of this might be available through a crafty use of templates, of which I am unaware, but a few standard functions and possibly exposing the rate of change on a value could make automation far more powerful.

Thanks for reading this request.

Since service calls can now return values this is already possible. But that does not mean that integrations will implement the ones you hope for. Starting a automation when elevation reaches a certain value is already possible. If you set a helper at what time that was today you’ll have quite a good guess at what time it will be tomorrow too (called a yesterdays weather prediction). And as for rate of change, there already is a derivative sensor you could use.

Thank you, that is very useful to know.
I will look into the derivative sensor.

The Sun2 custom integration provides it. It’s called the Time At Elevation sensor.

Thank you, I will install that. It will fix one of my use cases.