Compare commits
No commits in common. "d999cb30aab3cbca84f262446d79c5159b221083" and "73ff7e32399522a6f6316c832ccca0606f64a062" have entirely different histories.
d999cb30aa
...
73ff7e3239
|
@ -45,7 +45,6 @@
|
|||
"||testberry.internal^$dnsrewrite=${lib.net.cidr.host 31 globals.net.vlans.devices.cidrv4}"
|
||||
"||smb.internal^$dnsrewrite=${lib.net.cidr.host globals.services.samba.ip globals.net.vlans.home.cidrv4}"
|
||||
"||${globals.domains.web}^$dnsrewrite=${lib.net.cidr.host 1 globals.net.vlans.services.cidrv4}"
|
||||
"@@||${globals.services.vaultwarden.domain}"
|
||||
"||fritz.box^$dnsrewrite=${lib.net.cidr.host 1 "10.99.2.0/24"}"
|
||||
];
|
||||
dhcp.enabled = false;
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
];
|
||||
customComponents = with pkgs.home-assistant-custom-components; [
|
||||
homematicip_local
|
||||
pkgs.havartastorage
|
||||
];
|
||||
config = {
|
||||
http = {
|
||||
|
@ -95,223 +96,6 @@
|
|||
# organization = "home";
|
||||
# bucket = "home_assistant";
|
||||
# };
|
||||
# Modbus Varta element backup
|
||||
modbus = {
|
||||
|
||||
name = "mb_varta";
|
||||
type = "tcp";
|
||||
host = "10.99.30.20"; # replace with your ip of the your varta;
|
||||
port = 502;
|
||||
delay = 1;
|
||||
timeout = 3;
|
||||
message_wait_milliseconds = 250;
|
||||
sensors =
|
||||
### EMS Software Version { not for Varta link;
|
||||
[
|
||||
{
|
||||
name = "mb_varta_EMS";
|
||||
slave = 1;
|
||||
address = 1000;
|
||||
count = 17;
|
||||
data_type = "string";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
}
|
||||
### ENS Software Version { not for Varta link;
|
||||
{
|
||||
name = "mb_varta_ENS";
|
||||
slave = 1;
|
||||
address = 1017;
|
||||
count = 17;
|
||||
data_type = "string";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
}
|
||||
### Software Version { not for Varta link;
|
||||
{
|
||||
name = "mb_varta_software";
|
||||
slave = 1;
|
||||
address = 1034;
|
||||
count = 17;
|
||||
data_type = "string";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
}
|
||||
### Table version;
|
||||
{
|
||||
name = "mb_varta_table_version";
|
||||
slave = 1;
|
||||
address = 1051;
|
||||
data_type = "uint16";
|
||||
precision = "0";
|
||||
scale = 1;
|
||||
### timestamp {- not working;
|
||||
}
|
||||
{
|
||||
name = "mb_varta_timestamp";
|
||||
slave = 1;
|
||||
address = 1052;
|
||||
data_type = "uint32";
|
||||
swap = "word";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
}
|
||||
### Serial Number;
|
||||
{
|
||||
name = "mb_varta_serial";
|
||||
slave = 1;
|
||||
address = 1054;
|
||||
count = 10;
|
||||
data_type = "string";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
}
|
||||
### Number of Battery Modules installed;
|
||||
{
|
||||
name = "mb_varta_installed_batteries";
|
||||
slave = 1;
|
||||
address = 1064;
|
||||
data_type = "uint16";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
}
|
||||
### State;
|
||||
{
|
||||
name = "mb_varta_state";
|
||||
slave = 1;
|
||||
address = 1065;
|
||||
data_type = "uint16";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
unit_of_measurement = "State";
|
||||
}
|
||||
### Active Power { positive=charge / negative: discharge;
|
||||
{
|
||||
name = "mb_varta_active_power";
|
||||
slave = 1;
|
||||
address = 1066;
|
||||
data_type = "int16";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
device_class = "power";
|
||||
unit_of_measurement = "W";
|
||||
}
|
||||
### Apparent Power { positive=charge / negative: discharge;
|
||||
{
|
||||
name = "mb_varta_apparent_power";
|
||||
slave = 1;
|
||||
address = 1067;
|
||||
data_type = "int16";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
device_class = "apparent_power";
|
||||
unit_of_measurement = "VA";
|
||||
}
|
||||
### State of Charge;
|
||||
{
|
||||
name = "mb_varta_SOC";
|
||||
slave = 1;
|
||||
address = 1068;
|
||||
data_type = "uint16";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
device_class = "battery";
|
||||
unit_of_measurement = "%";
|
||||
}
|
||||
### energy counter AC{>DC - not sure if correct;
|
||||
{
|
||||
name = "mb_varta_ACDC";
|
||||
slave = 1;
|
||||
address = 1069;
|
||||
data_type = "uint32";
|
||||
swap = "word";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
device_class = "energy";
|
||||
unit_of_measurement = "Wh";
|
||||
state_class = "total_increasing";
|
||||
}
|
||||
### Installed capacity;
|
||||
{
|
||||
name = "mb_varta_capacity";
|
||||
slave = 1;
|
||||
address = 1071;
|
||||
data_type = "uint16";
|
||||
precision = 0;
|
||||
scale = 10;
|
||||
device_class = "energy";
|
||||
unit_of_measurement = "Wh";
|
||||
}
|
||||
### Grid Power;
|
||||
{
|
||||
name = "mb_varta_grid_power";
|
||||
slave = 1;
|
||||
address = 1078;
|
||||
data_type = "int16";
|
||||
precision = 0;
|
||||
scale = 1;
|
||||
device_class = "power";
|
||||
unit_of_measurement = "W";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Varta input/output
|
||||
template.sensor = [
|
||||
{
|
||||
name = "Varta Input Power";
|
||||
unit_of_measurement = "W";
|
||||
state_class = "measurement";
|
||||
device_class = "power";
|
||||
state = ''
|
||||
{% if states('sensor.mb_varta_active_power') | float(0) >= 0 %}
|
||||
{% set varta_in = states('sensor.mb_varta_active_power') | float(0) %}
|
||||
{% else %}
|
||||
{% set varta_in = 0 %}
|
||||
{% endif %}
|
||||
{{ varta_in }}
|
||||
'';
|
||||
|
||||
}
|
||||
{
|
||||
name = "Varta Output Power";
|
||||
unit_of_measurement = "W";
|
||||
state_class = "measurement";
|
||||
device_class = "power";
|
||||
state = ''
|
||||
{% if states('sensor.mb_varta_active_power') | float(0) <= 0 %}
|
||||
{% set varta_out = states('sensor.mb_varta_active_power') | float(0) *-1 %}
|
||||
{% else %}
|
||||
{% set varta_out = 0 %}
|
||||
{% endif %}
|
||||
{{ varta_out }}
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
##Grid
|
||||
sensor = {
|
||||
|
||||
platform = "template";
|
||||
sensors = {
|
||||
mb_varta_status = {
|
||||
friendly_name = "Varta Status";
|
||||
value_template = ''
|
||||
{% set mapper = {
|
||||
'0' : 'Busy',
|
||||
'1' : 'Run',
|
||||
'2' : 'Charge',
|
||||
'3' : 'Discharge',
|
||||
'4' : 'Standby',
|
||||
'5' : 'Error',
|
||||
'6' : 'Service',
|
||||
'7' : 'Islanding' } %}
|
||||
{% set state = states.sensor.mb_varta_state.state %}
|
||||
{{ mapper[state] if state in mapper else 'Unknown' }}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
extraPackages =
|
||||
python3Packages: with python3Packages; [
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
globals,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
@ -18,21 +17,15 @@
|
|||
guestWlan = {
|
||||
generator.script = "alnum";
|
||||
};
|
||||
iotWlan = {
|
||||
generator.script = "alnum";
|
||||
};
|
||||
};
|
||||
systemd.services.hostapd.stopIfChanged = false;
|
||||
systemd.services.hostapd.restartIfChanged = false;
|
||||
systemd.services.hostapd.reloadTriggers = lib.mkForce [ ];
|
||||
|
||||
# networking.nftables.firewall.zones.wlan.interfaces = [ "wlan1" ];
|
||||
# networking.nftables.firewall.zones.home.interfaces = [ "br-home" ];
|
||||
# networking.nftables.firewall.rules.wifi-forward = {
|
||||
# from = [ "wlan" ];
|
||||
# to = [ "home" ];
|
||||
# verdict = "accept";
|
||||
# };
|
||||
networking.nftables.firewall.zones.wlan.interfaces = [ "wlan1" ];
|
||||
networking.nftables.firewall.zones.home.interfaces = [ "br-home" ];
|
||||
networking.nftables.firewall.rules.wifi-forward = {
|
||||
from = [ "wlan" ];
|
||||
to = [ "home" ];
|
||||
verdict = "accept";
|
||||
};
|
||||
services.hostapd = {
|
||||
enable = true;
|
||||
radios.wlan01 = {
|
||||
|
@ -64,10 +57,10 @@
|
|||
apIsolate = true;
|
||||
# not supporte by laptop :(
|
||||
# settings.ieee80211w = 0;
|
||||
settings.bridge = "br-home";
|
||||
settings.vlan_file = "${pkgs.writeText "hostaps.vlans" ''
|
||||
10 wifi-home br-home
|
||||
40 wifi-iot br-iot
|
||||
50 wifi-guests br-guests
|
||||
50 wifi-guest br-guest
|
||||
''}";
|
||||
authentication = {
|
||||
saePasswords = [
|
||||
|
@ -75,10 +68,6 @@
|
|||
passwordFile = config.age.secrets.homeWlan.path;
|
||||
vlanid = 10;
|
||||
}
|
||||
{
|
||||
passwordFile = config.age.secrets.iotWlan.path;
|
||||
vlanid = 40;
|
||||
}
|
||||
{
|
||||
passwordFile = config.age.secrets.guestWlan.path;
|
||||
vlanid = 50;
|
||||
|
|
Binary file not shown.
|
@ -1,5 +1,5 @@
|
|||
diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix
|
||||
index 8635dea738ce2..28dd6db874bc4 100644
|
||||
index 8635dea738ce2..12821fc9f07c1 100644
|
||||
--- a/nixos/modules/services/networking/hostapd.nix
|
||||
+++ b/nixos/modules/services/networking/hostapd.nix
|
||||
@@ -1,4 +1,10 @@
|
||||
|
@ -2000,7 +2000,7 @@ index 8635dea738ce2..28dd6db874bc4 100644
|
|||
+ (
|
||||
+ echo -n 'sae_password='
|
||||
+ ${optionalString (entry.passwordFile != null) ''tr -d '\n' < ${entry.passwordFile}''}
|
||||
+ echo ${escapeShellArg lineSuffix}
|
||||
+ cat <<< '${escapeShellArg lineSuffix}'
|
||||
+ ) >> "$HOSTAPD_CONFIG_FILE"
|
||||
+ ''
|
||||
+ ) bssCfg.authentication.saePasswords
|
||||
|
|
|
@ -9,6 +9,7 @@ _inputs: [
|
|||
mongodb-bin = prev.callPackage ./mongodb-bin.nix { };
|
||||
disneyplus = prev.callPackage ./disney.nix { };
|
||||
awakened-poe-trade = prev.callPackage ./awakened-poe-trade.nix { };
|
||||
havartastorage = prev.callPackage ./havartastorage.nix { };
|
||||
neovim-clean = prev.neovim-unwrapped.overrideAttrs (
|
||||
_neovimFinal: neovimPrev: {
|
||||
nativeBuildInputs = (neovimPrev.nativeBuildInputs or [ ]) ++ [ prev.makeWrapper ];
|
||||
|
@ -21,6 +22,7 @@ _inputs: [
|
|||
);
|
||||
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
||||
(_pythonFinal: _pythonPrev: {
|
||||
vartastorage = prev.callPackage ./pyvartastorage.nix { };
|
||||
})
|
||||
];
|
||||
|
||||
|
|
30
pkgs/havartastorage.nix
Normal file
30
pkgs/havartastorage.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
buildHomeAssistantComponent,
|
||||
python3Packages,
|
||||
}:
|
||||
|
||||
buildHomeAssistantComponent rec {
|
||||
owner = "Vip0r";
|
||||
domain = "varta_storage";
|
||||
version = "2025-1-9-unstable";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit owner;
|
||||
repo = "varta_storage";
|
||||
rev = "592cfd8692b24b131cadaa8c6280660fdc262886";
|
||||
hash = "sha256-u5VneR7s3V+NjoTnDYPAO2aJeqpDQwPu5Eko5CZQXTw=";
|
||||
};
|
||||
|
||||
dependencies = [
|
||||
python3Packages.vartastorage
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Send notifications with ntfy.sh and selfhosted ntfy-servers";
|
||||
homepage = "https://github.com/hbrennhaeuser/homeassistant_integration_ntfy";
|
||||
maintainers = with maintainers; [ koral ];
|
||||
license = licenses.gpl3;
|
||||
};
|
||||
}
|
40
pkgs/pyvartastorage.nix
Normal file
40
pkgs/pyvartastorage.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonPackage rec {
|
||||
pname = "vartastorage";
|
||||
version = "2025.1.9";
|
||||
|
||||
disabled = python3Packages.pythonOlder "3.12";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Vip0r";
|
||||
repo = "vartastorage";
|
||||
rev = "5e24b25dbafeabceefd513001f3b8b6a598463a1";
|
||||
hash = "sha256-8eZOTQUbv7ing05aIYYJcP3zfLc91plC7QNqM7a3ZZQ=";
|
||||
};
|
||||
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
build-system = [ ];
|
||||
|
||||
dependencies = [
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Python module to interact with HomeMatic devices";
|
||||
homepage = "https://github.com/SukramJ/hahomematic";
|
||||
changelog = "https://github.com/SukramJ/hahomematic/blob/${src.tag}/changelog.md";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [
|
||||
dotlambda
|
||||
fab
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue