lovelace - Various fixes

This commit is contained in:
Thomas Lovén 2019-02-15 00:45:46 +01:00
parent c5b4b5bad5
commit 7ce12d29fb
5 changed files with 62 additions and 74 deletions

View File

@ -4,99 +4,65 @@ cards:
image: !file /local/images/Bottenvåning.png image: !file /local/images/Bottenvåning.png
elements: elements:
{% set lamp = """ {% macro lamp(entity, x, y) -%}
- entity: {{entity}}
style: { left: {{x}}%, top: {{y}}% }
type: state-icon type: state-icon
tap_action: { action: toggle } tap_action: { action: toggle }
""" %} {%- endmacro %}
{% set dimlamp = """ {% macro dimlamp(entity, x, y) -%}
- entity: {{entity}}
style: { left: {{x}}%, top: {{y}}% }
type: state-icon type: state-icon
tap_action: { action: toggle } tap_action: { action: toggle }
hold_action: { action: more-info } hold_action: { action: more-info }
""" %} {%- endmacro %}
# Kontoret # Kontoret
- entity: light.taklampa_kontoret {{ dimlamp('light.taklampa_kontoret', 82, 68) }}
style: { left: 82%, top: 68% } {{ lamp('light.kontor_fonster', 83, 87) }}
{{ dimlamp }} {{ dimlamp('light.skrivbordslampa_1', 88, 58) }}
- entity: light.kontor_fonster
style: { left: 83%, top: 87% }
{{ lamp }}
- entity: light.skrivbordslampa_1
style: { left: 88%, top: 58% }
{{ dimlamp }}
# Lilla hallen # Lilla hallen
- entity: light.lilla_hallen {{ dimlamp('light.lilla_hallen', 72, 53) }}
style: { left: 72%, top: 53% }
{{ dimlamp }}
# Stora hallen # Stora hallen
- entity: light.stora_hallen {{ dimlamp('light.stora_hallen', 43, 70) }}
style: { left: 43%, top: 70% } {{ lamp('light.trappbelysning', 49, 61) }}
{{ dimlamp }}
- entity: light.trappbelysning
style: { left: 49%, top: 61% }
{{ lamp }}
# Köket # Köket
- entity: light.taklampa_koket {{ dimlamp('light.taklampa_koket', 32, 76) }}
style: { left: 32%, top: 76% }
{{ dimlamp }}
- type: state-icon - type: state-icon
entity: switch.kaffebryggare entity: switch.kaffebryggare
tap_action: { action: toggle } tap_action: { action: toggle }
style: { left: 16%, top: 84% } style: { left: 16%, top: 84% }
# Vardagsrummet # Vardagsrummet
- entity: light.vardagsrum {{ dimlamp('light.vardagsrum', 60, 30) }}
style: { left: 60%, top: 30% } {{ dimlamp('light.takflakt', 43, 30) }}
{{ dimlamp }} {{ lamp('light.bokhylla', 55, 45) }}
- entity: light.takflakt {{ lamp('light.deko_vardagsrum', 49, 15) }}
style: { left: 43%, top: 30% }
{{ dimlamp }}
- entity: light.bokhylla
style: { left: 55%, top: 45% }
{{ lamp }}
- entity: light.deko_vardagsrum
style: { left: 49%, top: 15% }
{{ lamp }}
- type: state-label - type: state-label
entity: sensor.vardagsrum_0 entity: sensor.vardagsrum_0
style: { left: 40%, top: 36% } style: { left: 40%, top: 36% }
# Sovrum # Sovrum
- entity: light.sovrum {{ dimlamp('light.sovrum', 81, 30) }}
style: { left: 81%, top: 30% }
{{ dimlamp }}
# Tvättstuga # Tvättstuga
- entity: light.skotbord {{ lamp('light.skotbord', 21, 15) }}
style: { left: 21%, top: 15% }
{{ lamp }}
# Utomhus # Utomhus
- entity: light.ute_framsidan {{ lamp('light.ute_framsidan', 44, 94) }}
style: { left: 44%, top: 94% } {{ lamp('light.ute_framsidan', 16, 94) }}
{{ lamp }} {{ lamp('light.ute_framsidan', 60, 94) }}
- entity: light.ute_framsidan {{ lamp('light.ute_framsidan', 75, 94) }}
style: { left: 16%, top: 94% } {{ lamp('light.ute_framsidan', 95, 30) }}
{{ lamp }} {{ lamp('light.ute_framsidan', 95, 70) }}
- entity: light.ute_framsidan
style: { left: 60%, top: 94% }
{{ lamp }}
- entity: light.ute_framsidan
style: { left: 75%, top: 94% }
{{ lamp }}
- entity: light.ute_framsidan
style: { left: 95%, top: 30% }
{{ lamp }}
- entity: light.ute_framsidan
style: { left: 95%, top: 70% }
{{ lamp }}
- type: state-label - type: state-label
entity: sensor.elmatare_0 entity: sensor.elmatare_0
style: { left: 5%, top: 55% } style: { left: 5%, top: 55% }
- type: custom:popup-card - type: custom:popup-card
entity: light.takflakt entity: light.takflakt
title: Takfläkt title: Takfläkt

View File

@ -1,22 +1,13 @@
{% set dev_card="- !include dev_card.yaml" %}
title: Åvägen title: Åvägen
resources: !include resources.yaml resources: !include resources.yaml
views: views:
- title: Hemma - !include views/diverse_view.yaml
cards:
{{ dev_card }}
- !include floorplan.yaml
- !include coffee_card.yaml
- !include cameras/barnrum.yaml
- !include cameras/kontor.yaml
- !include temperatures_card.yaml
- title: Floorplan - title: Floorplan
panel: true panel: true
icon: mdi:floor-plan
cards: cards:
- type: vertical-stack - type: vertical-stack
cards: cards:
{{ dev_card }} - !include dev_card.yaml
- !include floorplan.yaml - !include floorplan.yaml
- !include views/dev_view.yaml - !include views/dev_view.yaml

17
lovelace/power_card.yaml Normal file
View File

@ -0,0 +1,17 @@
type: entities
show_header_toggle: false
title: Elförbrukning
entities:
- type: section
label: Senaste dygnet
- type: custom:hui-history-graph-card
hours_to_show: 24
entities:
- sensor.filtered_power
- type: section
label: Senaste veckan
- type: custom:hui-history-graph-card
hours_to_show: 168
entities:
- sensor.filtered_power
- sensor.power_meter

View File

@ -0,0 +1,9 @@
title: Diverse
icon: mdi:home-assistant
cards:
- !include floorplan.yaml
- !include coffee_card.yaml
- !include cameras/barnrum.yaml
- !include cameras/kontor.yaml
- !include temperatures_card.yaml
- !include power_card.yaml

View File

@ -41,3 +41,8 @@ sensor:
power_meter: power_meter:
value_template: "{{ states.sensor.elmatare_20.attributes.V_WATT }}" value_template: "{{ states.sensor.elmatare_20.attributes.V_WATT }}"
unit_of_measurement: 'W' unit_of_measurement: 'W'
- platform: filter
name: "Filtered power"
entity_id: sensor.power_meter
filters:
- filter: lowpass