| 28 Nov 2021 |
AngryAnt | I think what I'll do is write a little helper tool to kick off if starting the hass service fails and then scan the log for missing component errors, logging out any matching against that list. | 13:27:55 |
@hexa:lossy.network | hmm | 13:31:37 |
@hexa:lossy.network | you might be interested in our component discovery logic | 13:31:57 |
@hexa:lossy.network | https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/home-assistant.nix#L27-L51 | 13:32:51 |
@hexa:lossy.network | we basically look up the root level of the yaml config, and the values used in platform | 13:33:27 |
AngryAnt | Not following how this is discovering the basic components? | 13:37:16 |
@hexa:lossy.network | given a yaml config
homeassistant:
name: My Home
esphome:
default_config:
sensors:
- platform: influxdb
| 13:44:44 |
@hexa:lossy.network | it will check if the root keys (homeassistant, esphome, default_config, sensor) are components | 13:44:56 |
@hexa:lossy.network | and if any (sensor, ...?) has a platform that is a component | 13:45:12 |
@hexa:lossy.network | that will get added to a list, that is resolved to dependencies, that are injected via extraComponents into the package | 13:45:44 |
AngryAnt | Ah gotcha. So an approach would be to apply that to the default hass config and go from there. | 13:48:10 |
@hexa:lossy.network | well, I assume you could do that using yq | 13:48:41 |
@hexa:lossy.network | https://nixos.wiki/wiki/Home_Assistant | 14:14:47 |
@hexa:lossy.network | some bare bones update | 14:14:57 |
@hexa:lossy.network | we might want to fix applyDefaultConfig | 14:16:08 |
AngryAnt | Very nice | 14:22:00 |
AngryAnt | Yea applyDefaultConfig should probably result in the extraComponents config you list on the wiki there. | 14:22:29 |
AngryAnt | In case of interest, this is the log scan tool I mentioned: https://gist.github.com/AngryAnt/f0548625aa645dff387dbaf04f16f631 | 14:25:30 |
@hexa:lossy.network | neat | 14:26:44 |
@hexa:lossy.network | maybe worth adding a reference to that below https://nixos.wiki/wiki/Home_Assistant#Reusing_existing_YAML_configuration | 14:27:15 |
@hexa:lossy.network | if it works well enough | 14:27:23 |
AngryAnt | I could make a public version of the gist with a time parameter added (last ten minutes for example) - so you're not just searching the full log. I'll post a link here when that's in place. | 14:31:24 |
AngryAnt | Might be helpful for others as a debug tool I guess. | 14:32:11 |
@hexa:lossy.network | right, wondering if journalctl can output siunce last start | 14:33:45 |
AngryAnt | I didn't find anything when putting this together. Only since-last-boot. | 14:34:11 |
@hexa:lossy.network | https://serverfault.com/questions/768901/is-there-a-way-to-make-journalctl-show-logs-from-the-last-time-foo-service-ran/814467#814467 | 14:34:22 |
@hexa:lossy.network | load them timestamp from the unit, pass it to --since | 14:34:37 |
AngryAnt | Ah excellent. Good idea. | 14:35:10 |
AngryAnt | Available here: https://gist.github.com/AngryAnt/74c047a2b8438517c822ffdd9663aa57 | 14:53:37 |
@hexa:lossy.network | needs set -euo pipefail for good measure | 15:29:31 |