floorplan, humudity sensor alert changes, spotify update

This commit is contained in:
Florian Brinker 2020-02-15 16:04:38 +01:00
parent 8c1c58dfd1
commit af02228498
17 changed files with 371 additions and 24 deletions

View File

@ -7,7 +7,7 @@ humidity_too_high_bathroom:
state: "on"
repeat:
- 30
- 180
- 360
can_acknowledge: true
skip_first: true
notifiers:
@ -22,7 +22,7 @@ humidity_too_high_bathroom_kids:
state: "on"
repeat:
- 30
- 180
- 360
can_acknowledge: true
skip_first: true
notifiers:
@ -37,7 +37,7 @@ humidity_too_high_bedroom:
state: "on"
repeat:
- 30
- 180
- 360
can_acknowledge: true
skip_first: true
notifiers:
@ -46,13 +46,13 @@ humidity_too_high_bedroom:
# Wohnzimmer
humidity_too_high_livingroom:
name: Wohnzimmer Luftfeuchtigkeit zu hoch
message: "Zur Info: Die *Luftfeuchtigkeit* im *Wohnzimmer* hat den Grenzwert überschritten ({{ states('sensor.humidity_4') }}%)!"
done_message: "Zur Info: Die *Luftfeuchtigkeit* im *Wohnzimmer* ist wieder in Ordnung ({{ states('sensor.humidity_4') }}%)."
message: "Zur Info: Die *Luftfeuchtigkeit* im *Wohnzimmer* hat den Grenzwert überschritten ({{ states('sensor.lumi_livingroom_humidity') }}%)!"
done_message: "Zur Info: Die *Luftfeuchtigkeit* im *Wohnzimmer* ist wieder in Ordnung ({{ states('sensor.lumi_livingroom_humidity') }}%)."
entity_id: binary_sensor.humidity_too_high_livingroom
state: "on"
repeat:
- 30
- 180
- 360
can_acknowledge: true
skip_first: true
notifiers:
@ -67,7 +67,7 @@ humidity_too_high_guestroom:
state: "on"
repeat:
- 30
- 180
- 360
can_acknowledge: true
skip_first: true
notifiers:
@ -82,7 +82,7 @@ humidity_too_high_office:
state: "on"
repeat:
- 30
- 180
- 360
can_acknowledge: true
skip_first: true
notifiers:
@ -97,7 +97,22 @@ humidity_too_high_attic:
state: "on"
repeat:
- 30
- 180
- 360
can_acknowledge: true
skip_first: true
notifiers:
- telegram_group
# HWR
humidity_too_high_hwr:
name: HWR Luftfeuchtigkeit zu hoch
message: "Zur Info: Die *Luftfeuchtigkeit* im *HWR* hat den Grenzwert überschritten ({{ states('sensor.hygro_hwr_humidity') }}%)!"
done_message: "Zur Info: Die *Luftfeuchtigkeit* im *HWR* ist wieder in Ordnung ({{ states('sensor.hygro_hwr_humidity') }}%)."
entity_id: binary_sensor.humidity_too_high_hwr
state: "on"
repeat:
- 30
- 360
can_acknowledge: true
skip_first: true
notifiers:

View File

@ -1,15 +1,27 @@
bathroom_window_open:
name: Badezimmer-Fenster geöffnet
message: "Zur Info: Das *Badezimmer-Fenster* ist noch *offen*!"
done_message: "Zur Info: Das *Badezimmer-Fenster* ist wieder *geschlossen*."
message: "Zur Info - Das *Badezimmer-Fenster* ist noch *offen*!"
done_message: "Zur Info - Das *Badezimmer-Fenster* ist wieder *geschlossen*."
entity_id: binary_sensor.lumi_bathroom_window_magnet
state: "on"
repeat:
- 15
- 10
- 30
can_acknowledge: true
skip_first: true
notifiers:
- telegram_group
- alexa_kitchen
attic_window_open:
name: Dachboden-Fenster geöffnet
message: "Zur Info - Das *Dachboden-Fenster* ist noch *offen*!"
done_message: "Zur Info - Das *Dachboden-Fenster* ist wieder *geschlossen*."
entity_id: binary_sensor.lumi_attic_window_magnet
state: "on"
repeat: 30
can_acknowledge: true
skip_first: true
notifiers:
- telegram_group
- alexa_kitchen

View File

@ -9,10 +9,14 @@
- sensor.hygro_bathroom_parents_temperature
- sensor.hygro_bathroom_kids_humidity
- sensor.hygro_bathroom_kids_temperature
- sensor.humidity_4 # Wohnzimmer
- sensor.temperature_3 # Wohnzimmer
- sensor.humidity_15 # Büro
- sensor.temperature_14 # Büro
- sensor.lumi_livingroom_humidity
- sensor.lumi_livingroom_temperature
- sensor.lumi_bedroom_humidity
- sensor.lumi_bedroom_temperature
- sensor.lumi_guestroom_humidity
- sensor.lumi_guestroom_temperature
- sensor.lumi_office_humidity
- sensor.lumi_office_temperature
- sensor.attic_humidity_2
- sensor.attic_temperature_2
# Youtube

View File

@ -10,7 +10,7 @@
value_template: "{{ states('sensor.lumi_bedroom_humidity') | float > 68 }}"
humidity_too_high_livingroom:
value_template: "{{ states('.sensor.humidity_4') | float > 68 }}"
value_template: "{{ states('sensor.lumi_livingroom_humidity') | float > 68 }}"
humidity_too_high_guestroom:
value_template: "{{ states('sensor.lumi_guestroom_humidity') | float > 68 }}"
@ -19,4 +19,7 @@
value_template: "{{ states('sensor.lumi_office_humidity') | float > 68 }}"
humidity_too_high_attic:
value_template: "{{ states('sensor.attic_humidity_2') | float > 68 }}"
value_template: "{{ states('sensor.attic_humidity_2') | float > 68 }}"
humidity_too_high_hwr:
value_template: "{{ states('sensor.hygro_hwr_humidity') | float > 68 }}"

138
config/views/floorplan.yaml Normal file
View File

@ -0,0 +1,138 @@
#icon: mdi:home-variant-outline
title: Haus
path: floor
panel: true
cards:
- type: picture-elements
image: /local/images/floorplan/groundfloor.jpg
elements:
# This dims the background to make the lights show up better
- type: image
image: /local/images/floorplan/dim.png
tap_action:
action: none
style:
top: 50%
left: 50%
width: 100%
opacity: .7
# Küchen-Theke
- type: custom:color-lite-card
entity: light.kuchen_theke
tap_action:
action: none
image:
/local/images/floorplan/ground/kuchentheke.png
style:
top: 50%
left: 50%
width: 100%
# Esstisch
- type: custom:color-lite-card
entity: light.esstisch
tap_action:
action: none
image:
/local/images/floorplan/ground/esstisch.png
style:
top: 50%
left: 50%
width: 100%
# Stimmungslicht
- type: custom:color-lite-card
entity: light.stimmungslicht
tap_action:
action: none
image:
/local/images/floorplan/ground/stimmungslicht.png
style:
top: 50%
left: 50%
width: 100%
# Clickables
- type: image
entity: light.kuchen_theke
tap_action:
action: toggle
state_image:
'on': /local/images/floorplan/lite.png
'off': /local/images/floorplan/liteoff.png
style:
top: 66%
left: 33%
width: 5%
- type: image
entity: light.esstisch
tap_action:
action: toggle
state_image:
'on': /local/images/floorplan/lite.png
'off': /local/images/floorplan/liteoff.png
style:
top: 60%
left: 43%
width: 5%
- type: image
entity: light.stimmungslicht
tap_action:
action: toggle
state_image:
'on': /local/images/floorplan/lite.png
'off': /local/images/floorplan/liteoff.png
style:
top: 56%
left: 55%
width: 5%
# cameras
- type: image
camera_image: camera.livingroom
style:
top: 10%
left: 10%
width: 15%
- type: state-icon
entity: switch.camera_livingroom_ir_lights
tap_action:
action: toggle
style:
top: 15%
left: 25%
width: 15%
- type: state-icon
entity: binary_sensor.motion_livingroom
style:
top: 12%
left: 25%
width: 15%
# sensors
- type: state-label
entity: sensor.lumi_livingroom_temperature
style:
top: 50%
left: 37%
color: "#fff"
- type: state-label
entity: sensor.lumi_livingroom_humidity
style:
top: 50%
left: 43%
color: "#fff"
# Now Playing
- type: "custom:now-playing-poster"
entity: media_player.spotify
style:
width: 7%
top: 20%
left: 32.3%
transform: rotate(-28.5deg) rotateX(-50deg)

View File

@ -82,14 +82,14 @@ cards:
- type: horizontal-stack
cards:
- type: sensor
entity: sensor.humidity_4
entity: sensor.lumi_livingroom_humidity
name: Luftfeuchtigkeit
graph: line
unit: "%"
detail: 2
hours_to_show: 12
- type: sensor
entity: sensor.temperature_3
entity: sensor.lumi_livingroom_temperature
name: Temperatur
graph: line
unit: °C

View File

@ -33,6 +33,7 @@ http:
ip_ban_enabled: true
login_attempts_threshold: 5
use_x_forwarded_for: true
base_url: https://hass.f-brinker.de
trusted_proxies:
- 127.0.0.1
- ::1
@ -97,9 +98,6 @@ notify:
# platform: fcm-android
media_player:
- platform: spotify
client_id: !secret spotify_client_id
client_secret: !secret spotify_client_secret
- platform: androidtv
device_class: firetv
name: Fire TV
@ -182,6 +180,10 @@ panel_iframe:
url: !secret url_esphome
icon: mdi:chip
spotify:
client_id: !secret spotify_client_id
client_secret: !secret spotify_client_secret
tplink:
discovery: false
switch:
@ -196,6 +198,6 @@ camera: !include config/cameras.yaml
influxdb: !include config/influxdb.yaml
light: !include config/lights.yaml
scene: !include_dir_merge_list config/scenes/
script: !include_dir_merge_list config/scripts/
script: !include_dir_merge_named config/scripts/
sensor: !include_dir_merge_list config/sensors/
switch: !include_dir_merge_list config/switches/

View File

@ -3,6 +3,7 @@ title: Making Home Great Again
views:
- !include config/views/overview.yaml
- !include config/views/floorplan.yaml
- !include config/views/lights.yaml
- !include config/views/livingroom.yaml
- !include config/views/humidity.yaml
@ -17,3 +18,9 @@ resources:
type: module
- url: /local/lovelace/resources/auto-entities.js
type: module
- url: /local/lovelace/resources/color-lite-card.js
type: js
# https://github.com/bradcrc/color-lite-card/
- url: /local/lovelace/resources/now-playing-card.js
type: js
# https://github.com/bradcrc/Now-Playing-Card

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -0,0 +1,64 @@
class ColorLite extends HTMLElement {
set hass(hass) {
if (!this.content) {
const card = document.createElement('ha-card');
this.content = document.createElement('div');
card.appendChild(this.content);
card.style.background = 'none';
this.appendChild(card);
}
const entityId = this.config.entity;
const state = hass.states[entityId];
// if the light is on
if(state){
if(state.state == 'on'){
const imageURLId = this.config.image;
var ImURL = imageURLId;
const imageURLCId = this.config.color_image;
var rgbval = state.attributes.rgb_color;
var hsval = state.attributes.hs_color;
var hsar = "";
if (hsval) {
if (rgbval != "255,255,255") {
var hsar = ' hue-rotate(' + hsval[0] + 'deg)';
if (imageURLCId) {
ImURL = imageURLCId;
}
}
}
var bbritef = state.attributes.brightness;
var bbrite = (bbritef / 205);
this.content.innerHTML = `
<!-- Custom Lite Card for x${rgbval}x -->
<img src="${ImURL}" style="filter: opacity(${bbrite})${hsar}!important;" width="100%" height="100%">
`;
} else {
this.content.innerHTML = `
<!-- Custom Lite Card for ${entityId} is turned off -->
`;
}
}
}
setConfig(config) {
if (!config.entity) {
throw new Error('You need to define an entity');
}
this.config = config;
}
// The height of your card. Home Assistant uses this to automatically
// distribute all cards over the available columns.
getCardSize() {
return 3;
}
}
customElements.define('color-lite-card', ColorLite);

View File

@ -0,0 +1,102 @@
class NowPlayingPoster extends HTMLElement {
set hass(hass) {
if (!this.content) {
const card = document.createElement('ha-card');
this.content = document.createElement('div');
//this.content.style = "!important;";
card.appendChild(this.content);
card.style = "background: none;";
this.appendChild(card);
}
const offposter = this.config.off_image;
const entityId = this.config.entity;
const state = hass.states[entityId];
const stateStr = state ? state.state : 'unavailable';
if (state) {
const movposter = state.attributes.entity_picture;
if (stateStr == "playing") {
if ( !movposter ) {
if ( offposter ) {
this.content.innerHTML = `
<!-- now playing card ${entityId} -->
<img src="${offposter}" width=100% align="center" style="">
`;
}
else
{
this.content.innerHTML = `
<!-- now playing card ${entityId} no image-->
`;
}
}
else
{
this.content.innerHTML = `
<!-- now playing card ${entityId} -->
<img src="${movposter}" width=100% height=100%">
`;
}
}
else
{
if ( offposter ) {
this.content.innerHTML = `
<!-- now playing card ${entityId} -->
<img src="${offposter}" width=100% align="center" style="">
`;
}
else
{
this.content.innerHTML = `
<!-- now playing card ${entityId} no image-->
`;
}
}
}
else
{
this.content.innerHTML = `
<!-- now playing card ${entityId} not playing -->
`;
}
}
setConfig(config) {
if (!config.entity) {
throw new Error('You need to define an entity');
}
this.config = config;
}
// The height of your card. Home Assistant uses this to automatically
// distribute all cards over the available columns.
getCardSize() {
return 3;
}
}
customElements.define('now-playing-poster', NowPlayingPoster);