Hi @ all and a happy new year!
after diving deeper into pages, custom widget and YAML. I want to display a power flow sheme. I created first an svg in inkscape and then added some item values. That’s how it looks like:
I want the orange circle going to the battery if it is charged and the green on whenn the battery provides power to the inverter. Unfortunately both are allways visible and moving. I found a lot of similar project. But as far as I see and undestand them it should work. This is the Code. Maybe someone has a sharp eye and sees what’s my issue. Many Thanks in advance:
uid: widget_solarthermie
tags:
- diagram
- temperature
- ventilation
props:
parameters:
- description: Widget title
label: Title
name: title
required: false
type: TEXT
- context: item
description: Solarthermie S1 Vorlauf
label: Solarthermie S1 Vorlauf
name: Solarthermie_S1_Vorlauf
required: false
type: TEXT
- context: item
description: Temperatura Za GWC
label: Za GWC Item
name: zagwc
required: false
type: TEXT
- context: item
description: Temperatura Wyrzutnia
label: Wyrzutnia Item
name: wyrzutnia
required: false
type: TEXT
- context: item
description: Pufferspeicher 1-2
label: Pufferspeicher 1-2 Item
name: Pufferspeicher_1_2
required: false
type: TEXT
- context: item
description: Temperatura Wywiew
label: Wywiew Item
name: wywiew
required: false
type: TEXT
timestamp: Jan 5, 2026, 6:06:32 PM
component: f7-card
config:
style:
--f7-card-header-font-size: 16px
--f7-card-header-font-weight: bold
margin: 15 px
min-height: 300px
title: "=props.title ? props.title : 'Maschinenraum - Status'"
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
justify-content: center
margin: 0
padding: 0
position: relative
width: 100%
slots:
default:
- component: div
config:
style:
max-width: 600px
position: relative
width: 100%
slots:
default:
- component: oh-image
config:
style:
display: block
height: auto
width: 100%
url: /static/Solarthermie-Heizung_new.svg
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 6%
padding: 2px 6px
position: absolute
top: 5%
transform: translate(-50%, -50%)
text: =items.Solarthermie_S1_Vorlauf.state
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 23%
padding: 2px 6px
position: absolute
top: 5%
transform: translate(-50%, -50%)
text: =items.Solarthermie_S2_Ruecklauf.state
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 12%
padding: 2px 6px
position: absolute
top: 54%
transform: translate(-50%, -50%)
text: =items.Pufferspeicher_1_1.state
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 12%
padding: 2px 6px
position: absolute
top: 63%
transform: translate(-50%, -50%)
text: =items.Pufferspeicher_1_2.state
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 12%
padding: 2px 6px
position: absolute
top: 72%
transform: translate(-50%, -50%)
text: =items.Pufferspeicher_1_3.state
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 12%
padding: 2px 6px
position: absolute
top: 81%
transform: translate(-50%, -50%)
text: =items.Pufferspeicher_1_4.state
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 39.5%
padding: 2px 6px
position: absolute
top: 54%
transform: translate(-50%, -50%)
text: =items.Pufferspeicher_2_1.state
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 39.5%
padding: 2px 6px
position: absolute
top: 63%
transform: translate(-50%, -50%)
text: =items.Pufferspeicher_2_2.state
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 39.5%
padding: 2px 6px
position: absolute
top: 72%
transform: translate(-50%, -50%)
text: =items.Pufferspeicher_2_3.state
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 39.5%
padding: 2px 6px
position: absolute
top: 81%
transform: translate(-50%, -50%)
text: =items.Pufferspeicher_2_4.state
- component: Label
config:
style:
background: rgba(0, 0, 0, 0)
border: 1px solid
border-radius: 4px
box-shadow: 0 2px 4px rgba(0,0,0,0.15)
color: rgba(106, 176, 212, 100)
font-size: 12px
font-weight: bold
left: 93.1%
padding: 2px 6px
position: absolute
top: 90%
transform: translate(-50%, -50%)
text: =Math.round(items.Batteriestatus_1_Kapazitaet.state) + '%'
- component: div
config:
style:
background: rgba(120, 160, 120, 1)
border-radius: 4px
bottom: 16.5%
height: =Math.max(0, (items.Batteriestatus_1_Kapazitaet.state / 100) * 90) +
'px'
left: 89.5%
position: absolute
width: 43px
z-index: 10
# --- Animation als Overlay ---
- component: svg
config:
style:
position: absolute
top: 0
left: 0
width: 100%
height: 100%
pointer-events: none
z-index: 20
viewBox: "0 0 192.0397 121.61422"
xmlns: "http://www.w3.org/2000/svg"
slots:
default:
# --- Pfad für die Animation ---
- component: path
config:
id: inverterToBattery
d: "m 150.846,60.884988 7.18151,3e-6 V 85.36738 l 11.51017,-2e-6"
fill: none
stroke: orange
stroke-width: 1
- component: circle
config:
r: 4
fill: orange
visible: =(items[props.batteryStatus].state) == 'Laden' ? false:true
slots:
default:
- component: animateMotion
config:
dur: 3s
repeatCount: indefinite
keyPoints: 0;1
keyTimes: 0;1
calcMode: linear
slots:
default:
- component: mpath
config:
xlink:href: "#inverterToBattery"
- component: circle
config:
r: 4
fill: green
visible: =(items[props.batteryStatus].state) == 'Entladen' ? false:true
slots:
default:
- component: animateMotion
config:
dur: 3s
repeatCount: indefinite
keyPoints: 1;0
keyTimes: 0;1
calcMode: linear
slots:
default:
- component: mpath
config:
xlink:href: "#inverterToBattery"


