Calling sensor filter with button press

Is it possible to enable a filter for a sensor using on_press or on_click? If so how would that be structured? Thanks

you mean a sensor which is not a binary_sensor?

Yes, sensors that allow for filters such as -offset, -multiply, etc. Trying to set up a trigger to apply a filter like one of these.

I would create a template binary sensor. There you set the value from the sensor then apply your required filter. The lambda would be something like temperature > 50

Thanks for the suggestion. I appreciate the help. I’m looking at the template binary sensor component and trying to make sense of it. I’m finding this type of coding a real challenge and often need examples to get the picture. I would like to apply a filter (-multiply) to a rotary encoder sensor when I multi_click a push button.

Could you explain the behavior completely?
May we have an idea to share with you.