floorplan, humudity sensor alert changes, spotify update
@ -7,7 +7,7 @@ humidity_too_high_bathroom:
|
|||||||
state: "on"
|
state: "on"
|
||||||
repeat:
|
repeat:
|
||||||
- 30
|
- 30
|
||||||
- 180
|
- 360
|
||||||
can_acknowledge: true
|
can_acknowledge: true
|
||||||
skip_first: true
|
skip_first: true
|
||||||
notifiers:
|
notifiers:
|
||||||
@ -22,7 +22,7 @@ humidity_too_high_bathroom_kids:
|
|||||||
state: "on"
|
state: "on"
|
||||||
repeat:
|
repeat:
|
||||||
- 30
|
- 30
|
||||||
- 180
|
- 360
|
||||||
can_acknowledge: true
|
can_acknowledge: true
|
||||||
skip_first: true
|
skip_first: true
|
||||||
notifiers:
|
notifiers:
|
||||||
@ -37,7 +37,7 @@ humidity_too_high_bedroom:
|
|||||||
state: "on"
|
state: "on"
|
||||||
repeat:
|
repeat:
|
||||||
- 30
|
- 30
|
||||||
- 180
|
- 360
|
||||||
can_acknowledge: true
|
can_acknowledge: true
|
||||||
skip_first: true
|
skip_first: true
|
||||||
notifiers:
|
notifiers:
|
||||||
@ -46,13 +46,13 @@ humidity_too_high_bedroom:
|
|||||||
# Wohnzimmer
|
# Wohnzimmer
|
||||||
humidity_too_high_livingroom:
|
humidity_too_high_livingroom:
|
||||||
name: Wohnzimmer Luftfeuchtigkeit zu hoch
|
name: Wohnzimmer Luftfeuchtigkeit zu hoch
|
||||||
message: "Zur Info: Die *Luftfeuchtigkeit* im *Wohnzimmer* hat den Grenzwert überschritten ({{ 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.humidity_4') }}%)."
|
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
|
entity_id: binary_sensor.humidity_too_high_livingroom
|
||||||
state: "on"
|
state: "on"
|
||||||
repeat:
|
repeat:
|
||||||
- 30
|
- 30
|
||||||
- 180
|
- 360
|
||||||
can_acknowledge: true
|
can_acknowledge: true
|
||||||
skip_first: true
|
skip_first: true
|
||||||
notifiers:
|
notifiers:
|
||||||
@ -67,7 +67,7 @@ humidity_too_high_guestroom:
|
|||||||
state: "on"
|
state: "on"
|
||||||
repeat:
|
repeat:
|
||||||
- 30
|
- 30
|
||||||
- 180
|
- 360
|
||||||
can_acknowledge: true
|
can_acknowledge: true
|
||||||
skip_first: true
|
skip_first: true
|
||||||
notifiers:
|
notifiers:
|
||||||
@ -82,7 +82,7 @@ humidity_too_high_office:
|
|||||||
state: "on"
|
state: "on"
|
||||||
repeat:
|
repeat:
|
||||||
- 30
|
- 30
|
||||||
- 180
|
- 360
|
||||||
can_acknowledge: true
|
can_acknowledge: true
|
||||||
skip_first: true
|
skip_first: true
|
||||||
notifiers:
|
notifiers:
|
||||||
@ -97,7 +97,22 @@ humidity_too_high_attic:
|
|||||||
state: "on"
|
state: "on"
|
||||||
repeat:
|
repeat:
|
||||||
- 30
|
- 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
|
can_acknowledge: true
|
||||||
skip_first: true
|
skip_first: true
|
||||||
notifiers:
|
notifiers:
|
||||||
|
@ -1,15 +1,27 @@
|
|||||||
bathroom_window_open:
|
bathroom_window_open:
|
||||||
name: Badezimmer-Fenster geöffnet
|
name: Badezimmer-Fenster geöffnet
|
||||||
message: "Zur Info: Das *Badezimmer-Fenster* ist noch *offen*!"
|
message: "Zur Info - Das *Badezimmer-Fenster* ist noch *offen*!"
|
||||||
done_message: "Zur Info: Das *Badezimmer-Fenster* ist wieder *geschlossen*."
|
done_message: "Zur Info - Das *Badezimmer-Fenster* ist wieder *geschlossen*."
|
||||||
entity_id: binary_sensor.lumi_bathroom_window_magnet
|
entity_id: binary_sensor.lumi_bathroom_window_magnet
|
||||||
state: "on"
|
state: "on"
|
||||||
repeat:
|
repeat:
|
||||||
- 15
|
- 15
|
||||||
- 10
|
|
||||||
- 30
|
- 30
|
||||||
can_acknowledge: true
|
can_acknowledge: true
|
||||||
skip_first: true
|
skip_first: true
|
||||||
notifiers:
|
notifiers:
|
||||||
- telegram_group
|
- telegram_group
|
||||||
- alexa_kitchen
|
- 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
|
@ -9,10 +9,14 @@
|
|||||||
- sensor.hygro_bathroom_parents_temperature
|
- sensor.hygro_bathroom_parents_temperature
|
||||||
- sensor.hygro_bathroom_kids_humidity
|
- sensor.hygro_bathroom_kids_humidity
|
||||||
- sensor.hygro_bathroom_kids_temperature
|
- sensor.hygro_bathroom_kids_temperature
|
||||||
- sensor.humidity_4 # Wohnzimmer
|
- sensor.lumi_livingroom_humidity
|
||||||
- sensor.temperature_3 # Wohnzimmer
|
- sensor.lumi_livingroom_temperature
|
||||||
- sensor.humidity_15 # Büro
|
- sensor.lumi_bedroom_humidity
|
||||||
- sensor.temperature_14 # Büro
|
- 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_humidity_2
|
||||||
- sensor.attic_temperature_2
|
- sensor.attic_temperature_2
|
||||||
# Youtube
|
# Youtube
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
value_template: "{{ states('sensor.lumi_bedroom_humidity') | float > 68 }}"
|
value_template: "{{ states('sensor.lumi_bedroom_humidity') | float > 68 }}"
|
||||||
|
|
||||||
humidity_too_high_livingroom:
|
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:
|
humidity_too_high_guestroom:
|
||||||
value_template: "{{ states('sensor.lumi_guestroom_humidity') | float > 68 }}"
|
value_template: "{{ states('sensor.lumi_guestroom_humidity') | float > 68 }}"
|
||||||
@ -20,3 +20,6 @@
|
|||||||
|
|
||||||
humidity_too_high_attic:
|
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
@ -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)
|
@ -82,14 +82,14 @@ cards:
|
|||||||
- type: horizontal-stack
|
- type: horizontal-stack
|
||||||
cards:
|
cards:
|
||||||
- type: sensor
|
- type: sensor
|
||||||
entity: sensor.humidity_4
|
entity: sensor.lumi_livingroom_humidity
|
||||||
name: Luftfeuchtigkeit
|
name: Luftfeuchtigkeit
|
||||||
graph: line
|
graph: line
|
||||||
unit: "%"
|
unit: "%"
|
||||||
detail: 2
|
detail: 2
|
||||||
hours_to_show: 12
|
hours_to_show: 12
|
||||||
- type: sensor
|
- type: sensor
|
||||||
entity: sensor.temperature_3
|
entity: sensor.lumi_livingroom_temperature
|
||||||
name: Temperatur
|
name: Temperatur
|
||||||
graph: line
|
graph: line
|
||||||
unit: °C
|
unit: °C
|
||||||
|
@ -33,6 +33,7 @@ http:
|
|||||||
ip_ban_enabled: true
|
ip_ban_enabled: true
|
||||||
login_attempts_threshold: 5
|
login_attempts_threshold: 5
|
||||||
use_x_forwarded_for: true
|
use_x_forwarded_for: true
|
||||||
|
base_url: https://hass.f-brinker.de
|
||||||
trusted_proxies:
|
trusted_proxies:
|
||||||
- 127.0.0.1
|
- 127.0.0.1
|
||||||
- ::1
|
- ::1
|
||||||
@ -97,9 +98,6 @@ notify:
|
|||||||
# platform: fcm-android
|
# platform: fcm-android
|
||||||
|
|
||||||
media_player:
|
media_player:
|
||||||
- platform: spotify
|
|
||||||
client_id: !secret spotify_client_id
|
|
||||||
client_secret: !secret spotify_client_secret
|
|
||||||
- platform: androidtv
|
- platform: androidtv
|
||||||
device_class: firetv
|
device_class: firetv
|
||||||
name: Fire TV
|
name: Fire TV
|
||||||
@ -182,6 +180,10 @@ panel_iframe:
|
|||||||
url: !secret url_esphome
|
url: !secret url_esphome
|
||||||
icon: mdi:chip
|
icon: mdi:chip
|
||||||
|
|
||||||
|
spotify:
|
||||||
|
client_id: !secret spotify_client_id
|
||||||
|
client_secret: !secret spotify_client_secret
|
||||||
|
|
||||||
tplink:
|
tplink:
|
||||||
discovery: false
|
discovery: false
|
||||||
switch:
|
switch:
|
||||||
@ -196,6 +198,6 @@ camera: !include config/cameras.yaml
|
|||||||
influxdb: !include config/influxdb.yaml
|
influxdb: !include config/influxdb.yaml
|
||||||
light: !include config/lights.yaml
|
light: !include config/lights.yaml
|
||||||
scene: !include_dir_merge_list config/scenes/
|
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/
|
sensor: !include_dir_merge_list config/sensors/
|
||||||
switch: !include_dir_merge_list config/switches/
|
switch: !include_dir_merge_list config/switches/
|
@ -3,6 +3,7 @@ title: Making Home Great Again
|
|||||||
|
|
||||||
views:
|
views:
|
||||||
- !include config/views/overview.yaml
|
- !include config/views/overview.yaml
|
||||||
|
- !include config/views/floorplan.yaml
|
||||||
- !include config/views/lights.yaml
|
- !include config/views/lights.yaml
|
||||||
- !include config/views/livingroom.yaml
|
- !include config/views/livingroom.yaml
|
||||||
- !include config/views/humidity.yaml
|
- !include config/views/humidity.yaml
|
||||||
@ -17,3 +18,9 @@ resources:
|
|||||||
type: module
|
type: module
|
||||||
- url: /local/lovelace/resources/auto-entities.js
|
- url: /local/lovelace/resources/auto-entities.js
|
||||||
type: module
|
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
|
||||||
|
BIN
www/images/floorplan/dim.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
www/images/floorplan/ground/esstisch.png
Normal file
After Width: | Height: | Size: 146 KiB |
BIN
www/images/floorplan/ground/kuchentheke.png
Normal file
After Width: | Height: | Size: 260 KiB |
BIN
www/images/floorplan/ground/stimmungslicht.png
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
www/images/floorplan/groundfloor.jpg
Normal file
After Width: | Height: | Size: 202 KiB |
BIN
www/images/floorplan/lite.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
www/images/floorplan/liteoff.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
64
www/lovelace/resources/color-lite-card.js
Normal 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);
|
102
www/lovelace/resources/now-playing-card.js
Normal 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);
|