I wanted to add that I “borrowed” @rodpayne s script and modified it to support creating a sensor as well as putting it in a HACS friendly repository. If anybody is interested it is available at https://github.com/xannor/hass_py_set_state
2 Likes