Insert input_boolean from python script

I have been trying to make a costum_component in python.
this is a clock alarm, which needs some input_boolean, and some sliders and different stuff.

How can this be implemented? I have been searching for hours with no luck!

From my point of view it seems like there is a lack of documentation for devs!

Did you check here?

https://community.home-assistant.io/search?q=alarm%20clock

Yes I have seen them, but they are all written in YAML which I don’t like.
So I have made one in python as a costum_component, but it requires some input_boolean defined in YAML and I’d really prefer to have them initalized by the python script.

Maybe try the AppDaemon route?

Currently I do not think there is an official way to do this, but here is a hack: https://github.com/Danielhiversen/home-assistant_config/blob/master/custom_components/temp_control.py#L56
(It is not tested with latest version of HA, so I do not no if it still works)

@Danielhiversen neat little hack!

But it turns out that HA has some abstract classes, if you use them, then an input_boolean (or whatever you need) appears.

I’m not that familiar with the python abstract classes, so I have not been able to figure it out 100%, but here is a video where the dev of HA explains it.

Yes, if you inherit ToggleEntity you will get a switch. But I also needed two input_sliders in addition.

I would also like two input_slideres. it seems a bit difficult to both make input_booleans and input_sliders :frowning: