It would be very helpful to be able to create a numeric automation helper whose value (numeric state) could be calculated whenever needed. Basically it would be a template created via the visual editor.
so for example you could have Base Value 0, then click on Operator, select Plus, then Value appears,
here I can put in a constant or a numerical state (e.g temperature), then I can add another operator in the same group or start another group. e.g
Base Value: 0
------------------------
Operator: Plus
Value: numeric_state
Entity: temperature_sensor
Operator: Divide
Value: 10
------------
ADD ANOTHER OPERATOR
-------------
-------------
Operator: Conditional
Condition: after sunset
Operator: Plus
Value: 1.5
------------
ADD ANOTHER OPERATOR
-------------
ADD ANOTHER OPERATOR
which would create a template sensor, something like:
value_template: "{{ (states(‘sensor.temperature_sensor’) | float / 10.) + (%if% after_sunset}(1.5){%endif%}}}
or whatever the syntax is supposed to be. Or maybe what would be better, do it in YAML, like:
Interesting suggestion, but it is not quite what I need, the compensation value cannot be calculated just from the sensor value. It depends on other factors, for example the temperature sensor is not 100% accurate, but the error is somewhat random, then there may be other factors, like whether the door is open and if so how large a gap, as well as the temperature of the connecting space, and further, the fact that the temperature sensor is located on one side of the space whereas I generally remain on the other side. Actually, what I am going to start doing is to note down all the times that I need to make a manual adjustment and then see if there is any pattern, taking into account anything else I consider that might have an effect. Empirically, the sensor error seems to be +/- 3 degrees C, if I can reduce that to +/- 1 degree, then that is enough.
I think one factor is the outside temperature. So it would be really handy to make a “computed value” helper and just put Condition: numerical_state, Entity: sensor.temp_external, Above: 27.0, Action: ADD, value 1, or in the scheme I envisioned above: