Allow some degree of control over Supervisor

Currently, Supervisor performs varies activities over which the user has no control. For example, it performs an Internet connectivity check every 5 minutes (and makes several DNS lookups each time). It also performs version checks many times a day. This activity makes it one of the most chatty clients on my local network (more than commercial devices I have that rely on the cloud).

It would be useful to have a supervisor.yaml file where one could control some of Supervisor’s activities.

For example, the following specifies:

  • interval of 1 hour for connectivity checks
  • 1 day for version checks
  • Supervisor should not automatically update itself
  • a default name for snapshots
# supervisor.yaml
connectivity_check: 3600
version_check: 86400
auto_update: false
snap_shot_default: 'ha123 {{ now() }}'

Feel free to suggest other things Supervisor does that you would like some control over it.

Snapshot-related options

  1. Snapshot schedule (i.e. take one nightly)
  2. Snapshot password (ideally not stored plaintext in this file but if auto-snapshotting I want a password)
  3. Always skip the on update snapshot & prompt (if the above two options are implemented these single container snapshots are not really necessary and the prompt is annoying)
  4. Basically as many of the non-google drive related options they want to pull in from Hassio Google Drive Backup

Also separate discussion but a native non-local option for backups would be nice. Like perhaps an add-on for Cloud subscribers to backup snapshots to Nabu Casa?

Other supervisor options:

  1. List an external drive you want mounted in each HA container (HA itself and all add-ons) and a path to mount it at. See a lot of people struggling with this on the forum and doing things like forking addons to adjust to make this tweak
  2. The HassOS Configurator repo has a number of tools to make common tasks easier like the one above. I don’t know all of the use cases but there might be some others that could be pulled in to a config file like this. Ideally people would not need to rely on something as dangerous as injecting a custom startup.d task to easily use their external drive everywhere.

Technically these are related to the DNS container but since it comes with supervisor it seems like it would be configured in the same place:

  1. Option to choose a different DNS server as the fallback instead of requiring it be cloudflare.
  2. Control whether REFUSED or NXDOMAIN responses to should go to fallback or be accepted (since server did respond successfully in those cases, unlike SERVFAIL).
2 Likes

All great suggestions.

FWIW, I’m trying to avoid making suggestions in this Feature Request that involve additions to Supervisor’s frontend (currently, it has next to none for its configuration). Basically, it ought to be a setting in the proposed supervisor.yaml that is loaded on Superisor’s startup. The snapshot schedule would ideally need a frontend UI.

  1. Snapshot schedule
    I’m not sure how user-friendly this would be if implemented purely as a setting (in YAML). Plus, there is no existing snapshot scheduler; it would be an entirely new function.
  2. Snapshot password
    Can be in supervisor.yaml but it would be in clear text.
  3. Skip update snapshot prompt
    Readily done with a setting.
  4. Nothing specific here so I can’t comment on it.

The next two don’t sound like anything that already exists in Supervisor so would merit their own Feature Request.

The last two, related to DNS, definitely could be settings in the file.

To summarize, something like this:

snapshot_password: L@zerPH!shmunK
backup_before_updating: false
dns_fallback: 9.9.9.9
respond_to_fallback: true
1 Like

I was imagining something super basic like:

snapshot_daily: "4:30"

Basically just put the time if you want it to snapshot.

But I see your point, focus on things supervisor already does that could be settings, makes sense.

Not sure, if this fits here… :woozy_face:

I’d love to see some kind of “dismiss” button on the update notification for supervisor and core updates. I’m thinking about “dismiss until next version”, so if you have core-2021.5.2 and core-2021.5.3 is the next version, you can dismiss this update until core-2021.5.4 or core-2021.6.0.

For the curious, there’s an option in Home Assistant’s CLI that allows you to disable the “content-trust” feature (i.e. it will cease checking for source-code modifications).

ha supervisor options --content-trust=false

If you do this your instance of Home Assistant will be flagged as “unsupported”. However, it will allow for source-code mods, such as adjusting the frequency of connectivity/version checks. Optimally, the frequency could be configured and so there would be no need to patch the code.

It could always use the cron syntax for the schedule but hold it in a hash with other settings so you could have something like

auto_snapshots:
  daily: 
    schedule: 30 4 * * 1-6 
    history: 7
    encrypt: !secret  snapshot_password
  weekly:
    schedule: 30 4 * * 0 
    history: 8
    encrypt: !secret  snapshot_password

If you want a basic workaround I use an automation to do it at the moment, but it would be nice to have something built in.

alias: HASSOS Snapshot - Weekly on Sunday
description: Weekly HASSOS Snapshot
trigger:
  - at: '02:30:00'
    platform: time
condition:
  - condition: time
    weekday:
      - sun
action:
  - service: hassio.snapshot_full
    data_template:
      name: >-
        AutoBackup HASSOS {{states('sensor.hass_version')}} - {{ now().strftime('%Y-%m-%d-%H%M')}}
mode: single

Which gives me snapshots named like “AutoBackup HASSOS 2021.6.6 - 2021-07-04-0230”

1 Like

you can create that with automation and autobackup integration from hacs.

However I love the idea of having more control over the system

Is there any work in progress?
I’m relatively new to Home Assistant. But a look into my DNS logs showed me that my HA instance is producing more lookups than all network participants together. This is not the behaviour anyone likes to see who chosed HA beacuse of it’s internet independency. More, this is no common behaviour of an arbitrary internet connected device.
I pose the sense question: why is it so vital to ask for new versions every 5 min? Once a day, once a week may be enough. I cannot react anyway to install anything new within 5 min after reporting. The same with internet connectivity testing. If it was wanted for some reason, provide an addon. If not… my home is wanted to be internet independend.
So please let me control the frequency of those polls.

2 Likes

You can check the Pull Requests in the Supervisor repository on GitHub to see what is being added (Open Pull Requests) or has been added (Closed, but not all closed PRs means they were added).

https://github.com/home-assistant/supervisor/pulls?q=is%3Apr+is%3Aopen

FWIW, I haven’t seen any PRs that attempt to fulfill this Feature Request.