pyscript
pyscript copied to clipboard
State.set input_boolean
I am trying to create entities inside home assistant
I am utilizing the following
def create_entity(entity_type,name,new_attributes,value=None): state.set(f"{entity_type}.{name}", value, new_attributes)
It does indeed create the entity but when I try and press the switch to change it's state, it just reverts back to off.
When I try to use the developer tools to run Input boolean: Turn on
I get the error
Unable to find referenced entities input_boolean.<<Name of the boolean>>
I think you need to use state.persist to create a new entity
@d02023287 could you please update or close the issue? Thank you