A python_script (such as rodpayne’s set_state.py) can be used to set an entity’s (existing) attribute value. However, the value will not survive a restart.
According to logs the script works fine when tested from dev tools. Attributes are however not updated. Their values remain set to initials, from customize.yaml, although new values are passed to script. Is this the correct way to add custom attributes:
However, if your intention is to set the values with a python_script, the values will (as per my explanation) disappear after a restart. They will be reset to whatever values you specified in customize.yaml. According to your example, their values will be empty strings on startup.