Pyscript - new integration for easy and powerful Python scripting

I reached this integration looking for a way to dynamically create sensors based on a variable attribute… any idea if I could pull this off with pyscript?

I have a sensor that comes with an attribute that is an array of N elements, i.e.

[
{ name: "John Doe", age: 34, height: 177 },
{ name: "Joanne Doe", age: 37, height: 165 }
]

I would like to have one sensor created for each of those N elements, so for the above example, I’d have a sensor named John Doe with state 34 and an attribute height: 177, and equivalently for Joanne Doe, and for any other that may come on the initial attribute…

Any advice or hint?

Thank you!!

Has anyone had luck getting autocomplete working for the Jupyter notebook in PyCharm?

Hi, did you ever manage to get this working? I’m also trying to get autocomplete working in PyCharm, but no luck so far.

I ended up just using this project as I never had any luck

Its not great since you have to have commented out working imports and fake imports but better than nothing

I am hoping to automatically reload an integration that has become ‘unavailable’. It looks like the easiest way to do that is to call

homeassistant.reload_config_entry( config_entry_id( entity_id ) )

However, with in my pyscript, I get:

NameError: name ‘config_entry_id’ is not defined

I tried prefixing config_entry_id with homeassistant, but that just results in:

NameError: name ‘homeassistant.config_entry_id’ is not defined

Any help appreicated!

For reference:

https://community.home-assistant.io/t/how-to-automatically-reload-integration-on-a-schedule/571065/19