leofabri / hassio_appliance-status-monitor

🔌 Detect the state of your appliances based on their power consumption ✨
245 stars 18 forks source link

[Improvement] Helpers in a package #8

Closed HollyFredD closed 2 years ago

HollyFredD commented 2 years ago

Hi ! Great job here, thanks for the time spent to create and (well) document your blueprint !

In the wiki, I would suggest to make things a bit cleaner (ie. not overloading the configuration.yaml file) suggesting to create packages.

In the configuration.yamlfile :

## Packages
homeassistant:
  packages: !include_dir_named packages/

And then add the "devices" in the folder /packages For example washing_machine.yaml based on the template you provided :

timer:
  washing_machine_delayed_job_completion_timer:
    name: Washing Machine - Delayed Job Completion Timer
    duration: "00:15:00" # <- Note that the time here. Leave as it is (15 min)
    restore: true
    icon: mdi:washing-machine

  # ...

input_boolean:
  washing_machine_job_cycle:
    name: Washing Machine - Job Cycle
    icon: mdi:washing-machine

  washing_machine_automation_self_trigger:
    name: Washing Machine - Automation Self-trigger
    icon: mdi:washing-machine

  # ...

input_select:
  washing_machine_state_machine:
    name: Washing Machine - State Machine
    options:
      - unplugged
      - idle
      - paused
      - detached_overload
      - job_ongoing
      - job_completed
    icon: mdi:washing-machine

This will help keep the HA configuration simpler and more maintainable in my humble opinion

leofabri commented 2 years ago

Hi @HollyFredD! Thank you for your nice suggestion!

I love this solution! It makes everything way cleaner and well organized. I will change the wiki to reflect these tips with the release of the next version of the blueprint (we are not far from it).

leofabri commented 2 years ago

Done! The new branch has been added and it now includes the suggested change. It has not been merged yet. I need to improve some other things and push some more updates to the docs.

It'll turn into the new main when the job is completed.

Thank you again, have a great day ahead.