Rodpayne created a python_script to do that.
However, be advised that if you change a sensor’s state value using either Developer Tools > States > Set State or python_script.set_state, the change is temporary. The new value is overwritten the next time the sensor’s integration updates it or when you restart Home Assistant.
Developer Tools > States > Set State is useful for testing an automation because you can temporarily force a sensor’s value in order to test an automation’s trigger. For example, instead of waiting for a temperature sensor to increase naturally, to trigger an automation with a Numeric State Trigger, you can manually increase the temperature sensor’s value with Set State.