Merge branch 'master' into patch-14

This commit is contained in:
Ranlvor 2018-06-24 17:04:41 +02:00 committed by GitHub
commit 04dce55a70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 369 additions and 117 deletions

View file

@ -2,7 +2,8 @@
import type { Config } from "config/flowtypes";
import * as types from "config/types";
import { hex, rgb, rgba, rainbow } from "config/colors";
import { esper_topics, esper_statistics, floalt } from "./utils";
import { mdi, raw_mdi, mdi_battery } from "config/icon";
import { esper_topics, esper_statistics, floalt, tradfri_remote } from "./utils";
const config : Config = {
space: {
@ -48,6 +49,12 @@ const config : Config = {
defaultValue: "OFF",
values: { on: "ON", off: "OFF" }
},
olymp_printer: {
state: "stat/sonoff2/POWER",
command: "cmnd/sonoff2/power",
defaultValue: "OFF",
values: { on: "ON", off: "OFF" }
},
flyfry: {
state: "/service/openhab/out/wifi_flyfry/state",
command: "/service/openhab/in/wifi_flyfry/command",
@ -190,10 +197,20 @@ const config : Config = {
values: {}
}
},
//Kuechen-Floalts
floalt.topics("65537"),
floalt.topics("65538"),
floalt.topics("65539"),
floalt.topics("65540"),
tradfri_remote.topics("65536"),
tradfri_remote.topics("65547"),
//Theken-Floalts
floalt.topics("65543"),
floalt.topics("65544"),
tradfri_remote.topics("65542"),
tradfri_remote.topics("65546"),
esper_topics("afba40", "flyfry"),
esper_topics("afba45", "alarm")
],
@ -201,63 +218,64 @@ const config : Config = {
led_stahltrager: {
name: "LED Stahlträger",
position: [380, 590],
icon: "white-balance-iridescent",
icon: mdi("white-balance-iridescent"),
iconColor: ({led_stahltraeger}) => led_stahltraeger == "on" ? rainbow : hex("#000000"),
ui: [
{
type: "toggle",
text: "Stahlträger LED",
topic: "led_stahltraeger",
icon: "power"
icon: mdi("power")
},
]
},
snackbar: {
name: "Snackbar",
position: [510, 500],
icon: "fridge",
icon: mdi("fridge"),
iconColor: ({snackbar}) => snackbar == "on" ? hex("#E20074") : hex("#000000"),
ui: [
{
type: "toggle",
text: "Snackbar",
topic: "snackbar",
icon: "power"
icon: mdi("power")
}
]
},
twinkle: {
name: "Twinkle",
position: [530, 560],
icon: ({twinkle}) => twinkle == "on" ? "led-on flip-v" : "led-off flip-v",
icon: ({twinkle}) =>
twinkle == "on" ? raw_mdi("led-on flip-v") : raw_mdi("led-off flip-v"),
iconColor: ({twinkle}) => twinkle == "on" ? rainbow : hex("#000000"),
ui: [
{
type: "toggle",
text: "Twinkle",
topic: "twinkle",
icon: "power"
icon: mdi("power")
}
]
},
fan: {
name: "Ventilator",
position: [520, 450],
icon: "fan",
icon: mdi("fan"),
iconColor: ({fan}) => fan == "on" ? hex("#00FF00") : hex("#000000"),
ui: [
{
type: "toggle",
text: "Ventilator",
topic: "fan",
icon: "power"
icon: mdi("power")
}
]
},
cashdesk: {
name: "Cashdesk",
position: [500, 470],
icon: "coin",
icon: mdi("coin"),
ui: [
{
type: "link",
@ -269,49 +287,68 @@ const config : Config = {
videogames: {
name: "Videospiele",
position: [100, 100],
icon: "gamepad-variant",
icon: mdi("gamepad-variant"),
iconColor: ({videogames}) => videogames == "on" ? hex("#00FF00") : hex("#000000"),
ui: [
{
type: "toggle",
text: "Videospiele",
topic: "videogames",
icon: "power"
icon: mdi("power")
}
]
},
olymp_pc: {
name: "Rechner und Drucker",
name: "Rechner",
position: [297, 90],
icon: "desktop-classic",
icon: mdi("desktop-classic"),
iconColor: ({olymp_pc}) => olymp_pc == "on" ? hex("#00FF00") : hex("#000000"),
ui: [
{
type: "toggle",
text: "Rechner und Drucker",
text: "Rechner",
topic: "olymp_pc",
icon: "power"
icon: mdi("power")
}
]
},
olymp_printer: {
name: "Drucker",
position: [335, 90],
icon: mdi("printer"),
iconColor: ({olymp_printer}) => olymp_printer == "on" ? hex("#00FF00") : hex("#000000"),
ui: [
{
type: "toggle",
text: "Drucker",
topic: "olymp_printer",
icon: mdi("power")
},
{
type: "link",
link: "http://annette.rzl/",
text: "Open Annette"
}
]
},
flyfry: {
name: "Fliegenbratgerät",
position: [450, 590],
icon: "fire",
icon: mdi("fire"),
iconColor: ({flyfry}) => flyfry == "on" ? hex("#6666FF") : hex("#000000"),
ui: esper_statistics("flyfry", [
{
type: "toggle",
text: "Fliegenbratgerät",
topic: "flyfry",
icon: "power"
icon: mdi("power")
}
])
},
artnet: {
name: "Artnet",
position: [535,480],
icon: "spotlight",
icon: mdi("spotlight"),
iconColor: ({artnet}) =>
({
off: hex("#000000"),
@ -328,7 +365,7 @@ const config : Config = {
topic: "artnet",
on: "cycle",
toggled: val => val != "off",
icon: "power"
icon: mdi("power")
},
{
type: "dropDown",
@ -342,7 +379,7 @@ const config : Config = {
cycle: "Farbwechsel"
},
enableCondition: val => val != "off",
icon: "palette"
icon: mdi("palette")
}
]
},
@ -351,12 +388,12 @@ const config : Config = {
position: [350, 650],
iconColor: ({onkyo_connection, onkyo_power}) =>
onkyo_connection != "connected" ? hex("#888888") : (onkyo_power == "on" ? hex("#00FF00") : hex("#000000")),
icon: "audio-video",
icon: mdi("audio-video"),
ui: [
{
type: "toggle",
text: "Power",
icon: "power",
icon: mdi("power"),
topic: "onkyo_power",
enableCondition: (a, b, state) => state.onkyo_connection.internal == "connected"
},
@ -370,14 +407,14 @@ const config : Config = {
topic: "onkyo_volume",
min: 0,
max: 50,
icon: "volume-high",
icon: mdi("volume-high"),
enableCondition: (a, b, state) => state.onkyo_connection.internal == "connected"
},
{
type: "toggle",
text: "Mute",
topic: "onkyo_mute",
icon: "volume-off",
icon: mdi("volume-off"),
enableCondition: (a, b, state) => state.onkyo_connection.internal == "connected"
},
{
@ -395,7 +432,7 @@ const config : Config = {
pult: "Pult",
front: "Front HDMI"
},
icon: "usb",
icon: mdi("usb"),
enableCondition: (a, b, state) => state.onkyo_connection.internal == "connected"
},
{
@ -414,7 +451,7 @@ const config : Config = {
somafm_beatblender: "Beat Blender (Soma FM)",
ponyville: "Ponyville FM"
},
icon: "radio",
icon: mdi("radio"),
enableCondition: (a, b, state) => state.onkyo_connection.internal == "connected" && state.onkyo_inputs.internal == "netzwerk"
},
{
@ -431,28 +468,28 @@ const config : Config = {
rundumleuchte: {
name: "Rundumleuchte",
position: [310,275],
icon: "alarm-light",
icon: mdi("alarm-light"),
iconColor: ({rundumleuchte}) => rundumleuchte == "on" ? hex("#F0DF10") : hex("#000000"),
ui: [
{
type: "toggle",
text: "Rundumleuchte",
topic: "rundumleuchte",
icon: "power"
icon: mdi("power")
}
]
},
alarm: {
name: "Alarm",
position: [340, 250],
icon: "alarm-bell",
icon: mdi("alarm-bell"),
iconColor: () => hex("#000000"),
ui: esper_statistics("alarm")
},
door: {
name: "Tür",
position: [455,350],
icon: "swap-vertical",
icon: mdi("swap-vertical"),
iconColor: ({door_status}) => door_status == "on" ? hex("#00FF00") : hex("#FF0000"),
ui: [
{
@ -464,13 +501,13 @@ const config : Config = {
type: "text",
text: "Anwesend",
topic: "presence_status",
icon: "account"
icon: mdi("account")
},
{
type: "text",
text: "Devices",
topic: "devices_status",
icon: "wifi"
icon: mdi("wifi")
}
]
@ -478,14 +515,14 @@ const config : Config = {
infoscreen: {
name: "Infoscreen",
position: [255, 495],
icon: "television-guide flip-v",
icon: mdi("television-guide flip-v"),
iconColor: ({infoscreen}) => infoscreen == "on" ? hex("#4444FF") : hex("#000000"),
ui: [
{
type: "toggle",
text: "Infoscreen",
topic: "infoscreen",
icon: "power"
icon: mdi("power")
},
{
type: "link",
@ -497,7 +534,7 @@ const config : Config = {
printer_3d: {
name: "Ultimaker 3",
position: [754, 560],
icon: "printer-3d",
icon: mdi("printer-3d"),
iconColor: ({printer_3d_status}) =>
({
awaiting_interaction: hex("#b3b300"),
@ -518,7 +555,7 @@ const config : Config = {
},
{
type: "progress",
icon: "rotate-right",
icon: mdi("rotate-right"),
min: 0,
max: 1,
text: "Printing Progress",
@ -529,7 +566,7 @@ const config : Config = {
partkeepr: {
name: "Partkeepr",
position: [48, 450],
icon: "chip",
icon: mdi("chip"),
ui: [
{
type: "link",
@ -541,7 +578,7 @@ const config : Config = {
kitchen_light: {
name: "Deckenlicht Küche",
position: [325, 407],
icon: "ceiling-light",
icon: mdi("ceiling-light"),
ui: [
{
type: "toggle",
@ -550,14 +587,14 @@ const config : Config = {
toggled: n => parseInt(n) > 0,
topic: "kitchen_light_brightness",
text: "Ein/Ausschalten",
icon: "power"
icon: mdi("power")
},
{
type: "slider",
min: 0,
max: 100,
text: "Helligkeit",
icon: "brightness-7",
icon: mdi("brightness-7"),
topic: "kitchen_light_brightness",
delayedApply: true
},
@ -566,7 +603,7 @@ const config : Config = {
min: 0,
max: 100,
text: "Farbtemperatur",
icon: "weather-sunset-down",
icon: mdi("weather-sunset-down"),
topic: "kitchen_light_color",
delayedApply: true
},
@ -579,7 +616,7 @@ const config : Config = {
min: 0,
max: 100,
text: "Helligkeit",
icon: "brightness-7",
icon: mdi("brightness-7"),
topic: floalt.brightness("65537"),
delayedApply: true
},
@ -588,7 +625,7 @@ const config : Config = {
min: 0,
max: 100,
text: "Farbtemperatur",
icon: "weather-sunset-down",
icon: mdi("weather-sunset-down"),
topic: floalt.color("65537"),
delayedApply: true
},
@ -601,7 +638,7 @@ const config : Config = {
min: 0,
max: 100,
text: "Helligkeit",
icon: "brightness-7",
icon: mdi("brightness-7"),
topic: floalt.brightness("65538"),
delayedApply: true
},
@ -610,7 +647,7 @@ const config : Config = {
min: 0,
max: 100,
text: "Farbtemperatur",
icon: "weather-sunset-down",
icon: mdi("weather-sunset-down"),
topic: floalt.color("65538"),
delayedApply: true
},
@ -623,7 +660,7 @@ const config : Config = {
min: 0,
max: 100,
text: "Helligkeit",
icon: "brightness-7",
icon: mdi("brightness-7"),
topic: floalt.brightness("65539"),
delayedApply: true
},
@ -632,7 +669,7 @@ const config : Config = {
min: 0,
max: 100,
text: "Farbtemperatur",
icon: "weather-sunset-down",
icon: mdi("weather-sunset-down"),
topic: floalt.color("65539"),
delayedApply: true
},
@ -645,7 +682,7 @@ const config : Config = {
min: 0,
max: 100,
text: "Helligkeit",
icon: "brightness-7",
icon: mdi("brightness-7"),
topic: floalt.brightness("65540"),
delayedApply: true
},
@ -654,7 +691,7 @@ const config : Config = {
min: 0,
max: 100,
text: "Farbtemperatur",
icon: "weather-sunset-down",
icon: mdi("weather-sunset-down"),
topic: floalt.color("65540"),
delayedApply: true
}
@ -663,7 +700,7 @@ const config : Config = {
kitchen_sink_light: {
name: "Licht Spüle",
position: [300, 345],
icon: "wall-sconce-flat",
icon: mdi("wall-sconce-flat"),
ui: [
{
type: "toggle",
@ -672,19 +709,112 @@ const config : Config = {
toggled: n => parseInt(n) > 0,
topic: "kitchen_sink_light_brightness",
text: "Ein/Ausschalten",
icon: "power"
icon: mdi("power")
},
{
type: "slider",
min: 0,
max: 100,
text: "Helligkeit",
icon: "brightness-7",
icon: mdi("brightness-7"),
topic: "kitchen_sink_light_brightness",
delayedApply: true
}
]
}
},
kitchen_counter_light: {
name: "Deckenlicht Theke",
position: [400, 440],
icon: mdi("ceiling-light"),
ui: [
{
type: "section",
text: "Lampe Eingang"
},
{
type: "slider",
min: 0,
max: 100,
text: "Helligkeit",
icon: mdi("brightness-7"),
topic: floalt.brightness("65544"),
delayedApply: true
},
{
type: "slider",
min: 0,
max: 100,
text: "Farbtemperatur",
icon: mdi("weather-sunset-down"),
topic: floalt.color("65544"),
delayedApply: true
},
{
type: "section",
text: "Lampe Hauptraum"
},
{
type: "slider",
min: 0,
max: 100,
text: "Helligkeit",
icon: mdi("brightness-7"),
topic: floalt.brightness("65543"),
delayedApply: true
},
{
type: "slider",
min: 0,
max: 100,
text: "Farbtemperatur",
icon: mdi("weather-sunset-down"),
topic: floalt.color("65543"),
delayedApply: true
}
]
},
remotes: {
name: "Fernbedinungen",
position: [400, 344],
icon: mdi("light-switch"),
iconColor: (state) => //if any remote is low make icon red
["65536", "65542", "65546", "65547"].some(
x => state[tradfri_remote.low(x)] == "true") ? hex("#ff0000") : hex("#000000"),
ui: [
{
type: "progress",
icon: mdi_battery(tradfri_remote.level("65536")),
min: 0,
max: 100,
text: "Licht Tisch 1",
topic: tradfri_remote.level("65536")
},
{
type: "progress",
icon: mdi_battery(tradfri_remote.level("65547")),
min: 0,
max: 100,
text: "Licht Tisch 2",
topic: tradfri_remote.level("65547")
},
{
type: "progress",
icon: mdi_battery(tradfri_remote.level("65542")),
min: 0,
max: 100,
text: "Licht Theke 1",
topic: tradfri_remote.level("65542")
},
{
type: "progress",
icon: mdi_battery(tradfri_remote.level("65546")),
min: 0,
max: 100,
text: "Licht Theke 2",
topic: tradfri_remote.level("65546")
}
]
},
},
layers: [
{