Countdown sensor

That looks cool however since Iā€™m a complete noobā€¦ can you please show how you:
a) set the date that it is counting down to,
b) update it via your automation (Iā€™m guessing that will become clearer once I understand ā€˜aā€™)

I guess I need to further understand the python_script component a bit more.

Hi Dave, set the variables YEAR etc, and us the Automations Editor on the front end to create the automation, triggering on a time.
Cheers!

How do you write/edit this in the front end editor?

Only the automation is edited via front end

I also have a script editor :neutral_face:

https://home-assistant.io/docs/scripts/editor/

Unfortunately that only handles yaml scripts, not python scripts. You may be interested in this thread in the future.
Cheers

Man great workā€¦ Is there a way to have the script runn multiple timers without have to create mulitple py scripts

To do that, just create a list of dicts (1 dict per timer) then just iterate the list :+1:

You could also use the HASS Configurator.

1 Like

Looks very exciting. But Iā€™m having some trouble getting it to work :disappointed_relieved:

Copied the configurator.py and settings.conf to my config folder. Made configurator.py executable, adding the component in my yaml file. I got the menu item now but nothing shows when I click it.

Guess it has to be some parameters that needs to be changed. But it doesnā€™t seem obvious to me what needs a change.

/Kaspar

You donā€™t necessarily need to access it via the HASS UI while getting it to work. Initially you can also just use the IP address of the machine the configurator is running on, together with the port. So http://192.168.1.23:3218 for example. Or https of course if you have set a certificate and key. And of course it also has to be started (sudo ./configurator.py or have a look at the daemonizing section of the documentation).

Wellā€¦ bummer. I get this error when trying to run the py script:

pi@hassbian:/home/homeassistant/.homeassistant $ sudo ./configurator.py
./configurator.py: 8: ./configurator.py: Syntax error: newline unexpected

So I guess Iā€™m not that lucky today :slight_smile:

Try this command to fetch the configurator.py again:
curl -O https://raw.githubusercontent.com/danielperna84/hass-configurator/master/configurator.py
Then set the permissions again. The error you have described usually is a result of the content of the URL not being loaded properly.

Now it worksā€¦ Can you tell me what the difference was from the file Iā€™ve downloaded to the curl-thing from your link?

If you still have it compare the content. I canā€™t look on your computer. :wink:

Fair enough :smile:

Is there some security build into this configurator or is my connection wide open now Iā€™ve opened the 3218 port in my router?

As mentioned in the documentation, you can set CREDENTIALS, ALLOWED_NETWORKS, BANNED_IPS and BANLIMIT.

Is it possible to have an annual date.
eg. every occurring 24/12 regardless of year :slight_smile:

Is it possible to add a list of dates? once one date is ā€œhitā€, it counts down to the next date in the list?

Hello there. I was able to create one event using your code above. I wish to add more events. Can you show us a sample code on how to iterate the list? Thanks a bunch.