The process you follow to design and write a new automation/script

Hi Everyone,

This is my first post. I found HA after recently buying some hue lights and writing a simple python script to check the weather and turn on my lights different colours depending on the weather.

To start with I would like to recreate the same functionality as my Python script in HA.

I would like to know the process you follow to design/create a new automation/script. I am particularly interested in understanding an easy way to find out what properties entities have/can have.

I am really excited with all the possibilities especially with all the talented people that seem to be involved with HA.

Adam

For me it is usually one of the three scenarios:

Scenario 1

  • See something cool in a blogpost / forum entry
  • Copy & Paste -> Customize

Scenario 2

  • I come up with an idea which would be awesome to have
  • Lots of google and try & error with scripts / HA

Scenario 3

  • Wife complains about something not working the way she thought it would
  • Edit to please wife :wink:

~Cheers

6 Likes

Thanks for your feedback PhyberApex. Did you find any helpful information to speed up the trial and error in Scenario 2? :slight_smile:

I would suggest 3 resources if it comes to HA

  1. Components list available here: https://home-assistant.io/components/
  2. Dev Tools available here: http://yourhomeassistant/ on the navigation bar to the left the first four icons at the bottom
  3. Source code available here: https://github.com/home-assistant/home-assistant

For third party API it’s pretty much the same but instead of dev tools I have to use google most of the time (due to the lack of dev tools in software besides HA) :slight_smile:

~Cheers

Some tips:

3 Likes

Thanks for both your replies. I have a few things to start investigating!

What seems to be missing is somthing in between development documentation and examples. There seem to be lots of examples but I dont seem to find any detailed explainations of what each part of the example means. I may not have searched enough :slight_smile:

For example:

I dont see any reference to any entity (such as a tracker) that I would have thought could have the state: ‘home’ and no explaination as to why its there.

 condition:
    condition: state
    entity_id: group.all_devices
    state: 'home'

If you are already writing scripts in Python, I suggest you use AppDaemon and not bother with yaml at all.

1 Like

Thanks for the info. That sounds interesting, I might investigate to see which is the the least frustrating to get going! I don’t have much experience with Python.

This looks like it could be interesting also: