123
(Taras)
September 16, 2020, 3:37pm
7
Home Assistant doesn’t have a service to set a sensor’s state. To circumvent this limitation, someone create a python_script called set_state.py that allows you to set a state (or an attribute).
For what it’s worth, I have been hunting for a solution to this problem and I finally decided to make a small script:
# python_scripts/set_state.py
#--------------------------------------------------------------------------------------------------
# Set the state or other attributes for the entity specified in the Automation Action
#--------------------------------------------------------------------------------------------------
inputEntity = data.get('entity_id')
inputStateObject = hass.st…
To use it, you will first have to install the python_script integration .