diff --git a/config/alerts/humidity.yaml b/config/alerts/humidity.yaml index a6af1a0..f4fca39 100644 --- a/config/alerts/humidity.yaml +++ b/config/alerts/humidity.yaml @@ -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: diff --git a/config/alerts/windows.yaml b/config/alerts/windows.yaml index 3a11896..387043b 100644 --- a/config/alerts/windows.yaml +++ b/config/alerts/windows.yaml @@ -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 \ No newline at end of file diff --git a/config/influxdb.yaml b/config/influxdb.yaml index 54dc019..9cf8b79 100644 --- a/config/influxdb.yaml +++ b/config/influxdb.yaml @@ -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 diff --git a/config/sensors_binary/humidity.yaml b/config/sensors_binary/humidity.yaml index f685cd8..cf70eb2 100644 --- a/config/sensors_binary/humidity.yaml +++ b/config/sensors_binary/humidity.yaml @@ -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 }}" \ No newline at end of file + value_template: "{{ states('sensor.attic_humidity_2') | float > 68 }}" + + humidity_too_high_hwr: + value_template: "{{ states('sensor.hygro_hwr_humidity') | float > 68 }}" \ No newline at end of file diff --git a/config/views/floorplan.yaml b/config/views/floorplan.yaml new file mode 100644 index 0000000..185c275 --- /dev/null +++ b/config/views/floorplan.yaml @@ -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) \ No newline at end of file diff --git a/config/views/humidity.yaml b/config/views/humidity.yaml index 342b646..4f75315 100644 --- a/config/views/humidity.yaml +++ b/config/views/humidity.yaml @@ -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 diff --git a/configuration.yaml b/configuration.yaml index 8f37946..995a420 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -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/ \ No newline at end of file diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index df26a1c..67d9d3a 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -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 diff --git a/www/images/floorplan/dim.png b/www/images/floorplan/dim.png new file mode 100644 index 0000000..0d55e24 Binary files /dev/null and b/www/images/floorplan/dim.png differ diff --git a/www/images/floorplan/ground/esstisch.png b/www/images/floorplan/ground/esstisch.png new file mode 100644 index 0000000..912a08a Binary files /dev/null and b/www/images/floorplan/ground/esstisch.png differ diff --git a/www/images/floorplan/ground/kuchentheke.png b/www/images/floorplan/ground/kuchentheke.png new file mode 100644 index 0000000..648d5b0 Binary files /dev/null and b/www/images/floorplan/ground/kuchentheke.png differ diff --git a/www/images/floorplan/ground/stimmungslicht.png b/www/images/floorplan/ground/stimmungslicht.png new file mode 100644 index 0000000..900f1bc Binary files /dev/null and b/www/images/floorplan/ground/stimmungslicht.png differ diff --git a/www/images/floorplan/groundfloor.jpg b/www/images/floorplan/groundfloor.jpg new file mode 100644 index 0000000..ea6a5e0 Binary files /dev/null and b/www/images/floorplan/groundfloor.jpg differ diff --git a/www/images/floorplan/lite.png b/www/images/floorplan/lite.png new file mode 100644 index 0000000..76b2a0d Binary files /dev/null and b/www/images/floorplan/lite.png differ diff --git a/www/images/floorplan/liteoff.png b/www/images/floorplan/liteoff.png new file mode 100644 index 0000000..96ad36b Binary files /dev/null and b/www/images/floorplan/liteoff.png differ diff --git a/www/lovelace/resources/color-lite-card.js b/www/lovelace/resources/color-lite-card.js new file mode 100644 index 0000000..357a293 --- /dev/null +++ b/www/lovelace/resources/color-lite-card.js @@ -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 = ` + + + `; + + } else { + this.content.innerHTML = ` + + `; + } + } + } + + + 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); \ No newline at end of file diff --git a/www/lovelace/resources/now-playing-card.js b/www/lovelace/resources/now-playing-card.js new file mode 100644 index 0000000..4f92c3c --- /dev/null +++ b/www/lovelace/resources/now-playing-card.js @@ -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 = ` + + + `; + } + else + { + this.content.innerHTML = ` + + `; + } + } + else + { + this.content.innerHTML = ` + + + `; + } + } + else + { + + if ( offposter ) { + this.content.innerHTML = ` + + + `; + } + else + { + this.content.innerHTML = ` + + `; + } + + } + + + } + else + { + + + this.content.innerHTML = ` + + `; + + } + + } + + + + + 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); \ No newline at end of file