mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-17 04:58:19 -04:00
added van_weather
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
users = {
|
||||
users.hass = {
|
||||
@@ -21,6 +22,7 @@
|
||||
victron_modbuss = "!include ${./home_assistant/victron_modbuss.yaml}";
|
||||
battery_sensors = "!include ${./home_assistant/battery_sensors.yaml}";
|
||||
gps_location = "!include ${./home_assistant/gps_location.yaml}";
|
||||
van_weather = "!include ${./home_assistant/van_weather_template.yaml}";
|
||||
};
|
||||
};
|
||||
recorder = {
|
||||
@@ -71,6 +73,10 @@
|
||||
unifi-discovery # for ubiquiti integration
|
||||
];
|
||||
extraComponents = [ "isal" ];
|
||||
customComponents = with pkgs.home-assistant-custom-components; [
|
||||
pirate-weather
|
||||
];
|
||||
|
||||
};
|
||||
esphome = {
|
||||
enable = true;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
weather:
|
||||
- platform: template
|
||||
name: "Van Weather"
|
||||
unique_id: van_weather_template
|
||||
condition_template: "{{ states('sensor.van_weather_condition') }}"
|
||||
temperature_template: "{{ states('sensor.van_weather_temperature') }}"
|
||||
apparent_temperature_template: "{{ states('sensor.van_weather_apparent_temperature') }}"
|
||||
humidity_template: "{{ states('sensor.van_weather_humidity') }}"
|
||||
pressure_template: "{{ states('sensor.van_weather_pressure') }}"
|
||||
wind_speed_template: "{{ states('sensor.van_weather_wind_speed') }}"
|
||||
wind_bearing_template: "{{ states('sensor.van_weather_wind_bearing') }}"
|
||||
visibility_template: "{{ states('sensor.van_weather_visibility') }}"
|
||||
forecast_daily_template: "{{ state_attr('sensor.van_weather_forecast_daily', 'forecast') }}"
|
||||
forecast_hourly_template: "{{ state_attr('sensor.van_weather_forecast_hourly', 'forecast') }}"
|
||||
attribution_template: "Powered by Pirate Weather"
|
||||
31
systems/brain/services/van_weather.nix
Normal file
31
systems/brain/services/van_weather.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
systemd.services.van-weather = {
|
||||
description = "Van Weather Service";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
environment = {
|
||||
PYTHONPATH = "${inputs.self}/";
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.my_python}/bin/python -m python.van_weather.main";
|
||||
EnvironmentFile = "/etc/van_weather.env";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5s";
|
||||
StandardOutput = "journal";
|
||||
StandardError = "journal";
|
||||
NoNewPrivileges = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = "read-only";
|
||||
PrivateTmp = true;
|
||||
ReadOnlyPaths = [ "${inputs.self}" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user