asosnovsky / Shortumation

[Not Maintained] A better way to write automations in home-assistant without having to install and run a seperate automation engine!
MIT License
298 stars 6 forks source link

Integrate with HA API for automation retrieval and updates (this way we can support split configs better) #115

Closed asosnovsky closed 2 years ago

asosnovsky commented 2 years ago

Currently we are mounting HA's /config folder and manually reading and validating the automation files. A better implementation of this would be to load the automations from the websocket (which we already do) and then utilize these endpoints to update/manage the autos.

GET/POST https://homeassistant.sosnovsky.ca/api/config/automation/config/<automation-id>

Notes

martkopecky commented 2 years ago

If possible, please, also try to find a way how to support automations stored within individual files and also in packages, such as some of these configs: https://github.com/klaasnicolaas/Student-homeassistant-config https://github.com/frenck/home-assistant-config https://github.com/SeLLeRoNe/HA-Config

asosnovsky commented 2 years ago

@martkopecky split config support is now in v0.6+

martkopecky commented 2 years ago

Unfortunately, even the new version does not work for me...

image

The automation is stored in config\packages\automations\cover.yaml

package_automations_cover:
  automation:
    - id: "cover_auto_calibrate"
      alias: Auto calibrate covers first Wednesday each month at noon
      (...)

My configuration.yaml looks like this

homeassistant:
  packages: !include_dir_merge_named packages
asosnovsky commented 2 years ago

Unfortunately, even the new version does not work for me...

image

The automation is stored in config\packages\automations\cover.yaml


package_automations_cover:

  automation:

    - id: "cover_auto_calibrate"

      alias: Auto calibrate covers first Wednesday each month at noon

      (...)

My configuration.yaml looks like this


homeassistant:

  packages: !include_dir_merge_named packages

I see you are using packages. This I haven't implemented yet.

I know this is a very particular pattern for split config. I've implemented the pattern which uses the "automation" config key only so far. Though this shouldn't be too bad to implement with the current state of the refactor. I'll create another todo for me on this.

asosnovsky commented 2 years ago

@martkopecky packages support is now up to date with v0.6.3! :)