!QhvgabMQzwEQeWehhZ:lossy.network

NixOS Home Automation

521 Members
Declarative Home Automation and other Sidequests | https://wiki.nixos.org/wiki/Home_Assistant132 Servers

Load older messages


SenderMessageTime
28 Nov 2021
@AngryAnt:matrix.orgAngryAntI 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@hexa:lossy.networkhmm13:31:37
@hexa:lossy.network@hexa:lossy.networkyou might be interested in our component discovery logic13:31:57
@hexa:lossy.network@hexa:lossy.networkhttps://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/home-assistant.nix#L27-L5113:32:51
@hexa:lossy.network@hexa:lossy.networkwe basically look up the root level of the yaml config, and the values used in platform13:33:27
@AngryAnt:matrix.orgAngryAntNot following how this is discovering the basic components?13:37:16
@hexa:lossy.network@hexa:lossy.network

given a yaml config

homeassistant:
  name: My Home
esphome:
default_config:
sensors:
  - platform: influxdb
13:44:44
@hexa:lossy.network@hexa:lossy.networkit will check if the root keys (homeassistant, esphome, default_config, sensor) are components 13:44:56
@hexa:lossy.network@hexa:lossy.networkand if any (sensor, ...?) has a platform that is a component13:45:12
@hexa:lossy.network@hexa:lossy.networkthat will get added to a list, that is resolved to dependencies, that are injected via extraComponents into the package13:45:44
@AngryAnt:matrix.orgAngryAntAh gotcha. So an approach would be to apply that to the default hass config and go from there.13:48:10
@hexa:lossy.network@hexa:lossy.networkwell, I assume you could do that using yq13:48:41
@hexa:lossy.network@hexa:lossy.networkhttps://nixos.wiki/wiki/Home_Assistant14:14:47
@hexa:lossy.network@hexa:lossy.networksome bare bones update14:14:57
@hexa:lossy.network@hexa:lossy.network we might want to fix applyDefaultConfig 14:16:08
@AngryAnt:matrix.orgAngryAntVery nice14:22:00
@AngryAnt:matrix.orgAngryAnt Yea applyDefaultConfig should probably result in the extraComponents config you list on the wiki there. 14:22:29
@AngryAnt:matrix.orgAngryAntIn case of interest, this is the log scan tool I mentioned: https://gist.github.com/AngryAnt/f0548625aa645dff387dbaf04f16f63114:25:30
@hexa:lossy.network@hexa:lossy.networkneat14:26:44
@hexa:lossy.network@hexa:lossy.networkmaybe worth adding a reference to that below https://nixos.wiki/wiki/Home_Assistant#Reusing_existing_YAML_configuration14:27:15
@hexa:lossy.network@hexa:lossy.networkif it works well enough14:27:23
@AngryAnt:matrix.orgAngryAntI 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:matrix.orgAngryAntMight be helpful for others as a debug tool I guess.14:32:11
@hexa:lossy.network@hexa:lossy.networkright, wondering if journalctl can output siunce last start14:33:45
@AngryAnt:matrix.orgAngryAntI didn't find anything when putting this together. Only since-last-boot.14:34:11
@hexa:lossy.network@hexa:lossy.networkhttps://serverfault.com/questions/768901/is-there-a-way-to-make-journalctl-show-logs-from-the-last-time-foo-service-ran/814467#81446714:34:22
@hexa:lossy.network@hexa:lossy.network load them timestamp from the unit, pass it to --since 14:34:37
@AngryAnt:matrix.orgAngryAntAh excellent. Good idea.14:35:10
@AngryAnt:matrix.orgAngryAntAvailable here: https://gist.github.com/AngryAnt/74c047a2b8438517c822ffdd9663aa5714:53:37
@hexa:lossy.network@hexa:lossy.network needs set -euo pipefail for good measure 15:29:31

There are no newer messages yet.


Back to Room ListRoom Version: 6