ma homeautomation: update google-muell

This commit is contained in:
makefu 2019-03-06 16:42:52 +01:00
parent 9c702551ab
commit 7e9a2417ba
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
2 changed files with 55 additions and 13 deletions

View File

@ -55,7 +55,8 @@ let
payload_not_available = "Offline"; payload_not_available = "Offline";
}; };
firetv = "192.168.1.238"; firetv = "192.168.1.183";
hassdir = "/var/lib/hass";
tasmota_plug = name: topic: tasmota_plug = name: topic:
{ platform = "mqtt"; { platform = "mqtt";
inherit name; inherit name;
@ -105,13 +106,7 @@ in {
imports = [ imports = [
./mqtt.nix ./mqtt.nix
]; ];
#systemd.services.firetv = {
# wantedBy = [ "multi-user.target" ];
# serviceConfig = {
# User = "nobody";
# ExecStart = "${pkgs.python-firetv}/bin/firetv-server -d ${firetv}:5555";
# };
#};
services.home-assistant = { services.home-assistant = {
config = { config = {
homeassistant = { homeassistant = {
@ -133,9 +128,11 @@ in {
{ platform = "kodi"; { platform = "kodi";
host = firetv; host = firetv;
} }
#{ platform = "firetv"; { platform = "firetv";
# # assumes python-firetv running name = "FireTV Stick";
#} host = firetv;
adbkey = <secrets/hass/adbkey>;
}
]; ];
mqtt = { mqtt = {
broker = "localhost"; broker = "localhost";
@ -211,9 +208,12 @@ in {
flur = [ flur = [
"light.flurlicht" "light.flurlicht"
"binary_sensor.flur_bewegung" "binary_sensor.flur_bewegung"
"automation.dunkel_bei_sonnenuntergang"
"automation.hell_bei_sonnenaufgang"
]; ];
wohnzimmer = [ wohnzimmer = [
"media_player.kodi" "media_player.kodi"
"media_player.firetv_stick"
]; ];
draussen = [ draussen = [
"sensor.dark_sky_temperature" "sensor.dark_sky_temperature"
@ -240,6 +240,47 @@ in {
]; ];
light = [ (tasmota_rgb "Flurlicht" "flurlicht" ) ]; light = [ (tasmota_rgb "Flurlicht" "flurlicht" ) ];
automation = [ automation = [
{ alias = "Dunkel bei Sonnenuntergang";
trigger = {
platform = "sun";
event = "sunset";
# offset: "-00:45:00"
};
action = [
{
service= "light.turn_on";
data = {
entity_id= "light.flurlicht";
# rgb_color = [ 0,0,0 ]; <-- TODO default color
brightness_pct = 15;
};
}
{
service= "light.turn_off";
entity_id= "light.flurlicht";
}
];
}
{ alias = "Hell bei Sonnenaufgang";
trigger = {
platform = "sun";
event = "sunrise";
# offset: "-00:00:00"
};
action = [
{
service= "light.turn_on";
data = {
entity_id= "light.flurlicht";
brightness_pct = 85;
};
}
{
service= "light.turn_off";
entity_id= "light.flurlicht";
}
];
}
{ alias = "Staubsauger Strom aus nach 6h"; { alias = "Staubsauger Strom aus nach 6h";
trigger = { trigger = {
platform = "state"; platform = "state";
@ -255,7 +296,7 @@ in {
]; ];
}; };
enable = true; enable = true;
#configDir = "/var/lib/hass"; configDir = hassdir;
}; };
nixpkgs.config.permittedInsecurePackages = [ nixpkgs.config.permittedInsecurePackages = [
"homeassistant-0.77.2" "homeassistant-0.77.2"

View File

@ -9,7 +9,8 @@ let
# TODO: generate this credential file locally # TODO: generate this credential file locally
ampelcred = "${home}/google-muell-creds.json"; ampelcred = "${home}/google-muell-creds.json";
sleepval = "1800"; sleepval = "1800";
default-color = "244,220,66"; # default-color = "18,63,40";
default-color = "255,127,0";
config_json = toFile "config.json" (toJSON { config_json = toFile "config.json" (toJSON {
mq_hostname = "localhost"; mq_hostname = "localhost";
mq_port = 1883; mq_port = 1883;