-
-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
home-assistant: missing sensor.mqtt in component-packages.nix #55958
Comments
The configuration you listed above does not yield an evaluation error. I have verified that by building it myself. You must have specified |
I don't have any other mention of services.home-assistant.config.mqtt = {
broker = "127.0.0.1";
username = "homeassistant";
# password = "";
}; which might change the evaluation. I can confirm that when I remove the sensor config, the evaluation error goes away, which is why I didn't think I needed to include the brocker config. Those are the only mention of Still it's strange that the line was removed from |
I've just noticed now that I have forgotten Here is the actual pieces of relevant config: services.home-assistant = {
enable = true;
autoExtraComponents = true;
package = unstable.home-assistant;
config = {
mqtt = {
broker = "127.0.0.1";
username = "homeassistant";
# password = "";
};
sensor = [
{
name = "Temperature room";
platform = "mqtt";
state_topic = "sensors/temperature/room";
qos = 0;
unit_of_measurement = "°C";
}
];
};
}; |
That's the default. No need to include it. After all, I was able to reproduce your error by building NixOS from the stable channel. My bad. It's caused by the following line:
which will use the availableComponents from the stable package.However, if I set availableComponents = cfg.package.availableComponents; I get error: stack overflow (possible infinite recursion) which I still have to investigate.
|
I really have no idea what's going on. The way I test this is by having a file { ... }:
{
imports = [
/etc/nixos/hardware-configuration.nix
];
boot.loader.systemd-boot.enable = true;
services.home-assistant = {
enable = true;
package = (import <unstable> {}).home-assistant;
config = {
sensor = [
{
name = "Temperature room";
platform = "mqtt";
state_topic = "sensors/temperature/room";
qos = 0;
unit_of_measurement = "°C";
}
];
};
};
} and a checkout of the diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix
index 0756e81612a..441fcb30569 100644
--- a/nixos/modules/services/misc/home-assistant.nix
+++ b/nixos/modules/services/misc/home-assistant.nix
@@ -10,7 +10,7 @@ let
(builtins.toJSON (if cfg.applyDefaultConfig then
(lib.recursiveUpdate defaultConfig cfg.config) else cfg.config));
- availableComponents = pkgs.home-assistant.availableComponents;
+ availableComponents = cfg.package.availableComponents;
# Given component "parentConfig.platform", returns whether config.parentConfig
# is a list containing a set with set.platform == "platform". When building the configuration I get
What's strange is that there is no error when |
I am happy you could reproduce this! Still, I don't see any line for What I still find strange, is that the referred file in my original error is from Is this making any sense ? |
Yes, this makes sense: The module is taking the list of |
Ok, thank you for your explanations, I understand where the error comes from now ! I did some digging around to know why the
When I define a mqtt sensor in my nixos config, will the nixos module be able to do the conversion from |
Not yet. I will implement that once I was able to solve the stack overflow issue. |
@netixx The problem should be solved once you upgrade your system since 753f58d is now in the |
I can confirm that I don't have the build error anymore, thank you ! However, the home-assistant environment is missing component dependencies. Same as stated previously, home-assistant code has been refactored, but config is the same, which means that dependencies are not found. For example, I have |
Adjusting the code for |
Ok, at the moment, I am using manual config because I am testing home-assistant, using Do you think we could add a |
Sure, no problem. However, I suscpect that will often not build due to some Python packages not building. Do you want to make a PR or should I do it? |
I can surely try, but I am not sure how I should proceed :
Which option do you think is best ? |
I guess the first option comes close to the best one. However, please don't use |
See https://developers.home-assistant.io/blog/2019/02/19/the-great-migration.html and #55958 (comment). (cherry picked from commit 971187e) closes #59251
Issue description
Nixos build error when using a MQTT sensor, following this configuration.
Steps to reproduce
unstable
being thenixos-unstable
channel.Technical details
The corresponding line seems to have been removed in :
6cb6b90f1a67f0513fa34c3db880684e6ae533a6
which is the commit for the update to0.86.4
.Maybe the code has changed and the python script no longer recognises sensors correctly ?
"x86_64-linux"
Linux 4.14.95, NixOS, 18.09pre-git (Jellyfish)
yes
yes
nix-env (Nix) 2.1.3
"nixos-18.09.2203.9bd45dddf81, unstable-19.03pre169108.36f31600749"
/var/nixpkgs
The text was updated successfully, but these errors were encountered: