Super, Vielen Dank!
Ich hatte im Item als SemanticClass nur "Point" angegeben und nicht "Measurement".
openHAB 3 macht richtig Spaß.
Alles Stück für Stück zu entdecken und zu verstehen und zu sehen wie sich das SmartHome so langsam ganz neu aufbaut
Super, Vielen Dank!
..das kann man so nicht sagen
...Das klingt doch schon ganz positiv und das nicht zuletzt wegen deiner Tipps. Danke dir nochmals.
Code: Alles auswählen
uid: Spotify_widget_1.00
tags:
- popup
- music
- spotify
props:
parameters:
- description: Title for the widget
label: Static Title
name: title
required: false
type: TEXT
- context: item
label: Select a 'Spotify Player Bridge' (SpotifyPlayerBridge)
name: prefix
required: false
type: TEXT
parameterGroups: []
timestamp: Feb 14, 2021, 10:14:06 AM
component: f7-card
config:
title: =props.title
style:
min-width: 270px
slots:
default:
- component: f7-row
config:
class: margin display-flex align-items-center
slots:
default:
- component: f7-col
config:
width: 100
xsmall: 30
small: 50
medium: 50
large: 50
xlarge: 50
slots:
default:
- component: f7-row
config:
class: '=(items[props.prefix+"_AlbumImage"].state === "NULL")?"display-none" : "- margin-vertical - justify-content-center"'
slots:
default:
- component: oh-image
config:
item: =props.prefix+"_AlbumImage"
style:
width: 70%
- component: f7-col
config:
width: 100
xsmall: 30
small: 50
medium: 50
large: 50
xlarge: 50
slots:
default:
- component: f7-row
config:
class: = (items[props.prefix+"_ActiveDeviceName"].state !== "NULL")?"display-none":"display-flex justify-content-center"
slots:
default:
- component: Label
config:
text: This Spotify Bridge is Unavailable
- component: f7-row
config:
class: = (items[props.prefix+"_ActiveDeviceName"].state === "NULL")?"display-none":"display-flex justify-content-center"
slots:
default:
- component: Label
config:
text: =items[props.prefix+"_Kunstler"].state || "-"
style:
white-space: nowrap
overflow: hidden
font-size: normal
font-weight: bold
font-style: italic
- component: f7-row
config:
class: = (items[props.prefix+"_ActiveDeviceName"].state === "NULL")?"display-none":"display-flex justify-content-center"
slots:
default:
- component: Label
config:
text: =items[props.prefix+"_Titel"].state || "-"
style:
white-space: nowrap
overflow: hidden
font-size: normal
font-weight: bold
- component: f7-row
config:
class: = (items[props.prefix+"_ActiveDeviceName"].state === "NULL")?"display-none":"display-flex justify-content-center"
slots:
default:
- component: Label
config:
text: =items[props.prefix+"_AlbumName"].state || "-"
style:
white-space: nowrap
overflow: hidden
font-size: normal
font-style: italic
- component: f7-row
config:
style:
position: relative
top: -10px
height: 20px
class:
- justify-content-center
slots:
default:
- component: f7-card
config:
noShadow: true
class: margin display-flex align-items-center
style:
fontSize: 12px
width: calc(100% - 80px)
slots:
default:
- component: Label
config:
text: = items[props.prefix+"_TrackProgressmss"].state
- component: f7-progressbar
config:
color: teal
progress: = 100 * items[props.prefix+"_TrackProgressms"].state / items[props.prefix+"_TrackDurationms"].state
style:
height: 10px
item: props.prefix+"_TrackProgressmss"
- component: Label
config:
text: = items[props.prefix+"_TrackDurationmss"].state
- component: f7-row
config:
class:
- justify-content-space-around
- display-flex
- align-items-center
- align-content-stretch
- margin-top
slots:
default:
- component: f7-icon
config:
f7: '=(props.prefix+"_ActiveDeviceShuffle") ? "shuffle" : ""'
size: 20
color: '=(items[props.prefix+"_ActiveDeviceShuffle"].state === "ON") ? "green" : ""'
style:
position: relative
left: +7%
slots:
default:
- component: oh-button
config:
action: command
actionItem: = props.prefix+"_ActiveDeviceShuffle"
actionCommand: '=(items[props.prefix+"_ActiveDeviceShuffle"].state !== "ON") ? "ON" : "OFF"'
style:
position: absolute
width: 100%
height: 100%
top: 0px
- component: oh-player-item
config:
style:
width: 150px
item: =props.prefix+"_Fernbedienung"
class:
- display-flex
- margin-
- align-content-stretch
- align-items-center
- justify-content-space-around
- component: f7-icon
config:
f7: '=(props.prefix+"_RepeatMode") ? (items[props.prefix+"_RepeatMode"].state === "context") ? "repeat" : (items[props.prefix+"_RepeatMode"].state === "track") ? "repeat_1" : "repeat" : ""'
size: 20
color: '=(items[props.prefix+"_RepeatMode"].state === "context") ? "green" : (items[props.prefix+"_RepeatMode"].state === "track") ? "green" : ""'
style:
position: relative
left: -8%
slots:
default:
- component: oh-button
config:
action: command
actionItem: = props.prefix+"_RepeatMode"
actionCommand: '=(items[props.prefix+"_RepeatMode"].state === "context") ? "track" : (items[props.prefix+"_RepeatMode"].state === "track") ? "off": "context"'
style:
position: absolute
width: 100%
height: 100%
top: 0px
- component: f7-row
config:
class:
- justify-content-space-around
- display-flex
- align-items-center
- align-content-stretch
- margin-top
slots:
default:
- component: f7-card
config:
noShadow: true
class: margin display-flex align-items-center
style:
height: 20px
fontSize: 20px
width: 100%
slots:
default:
- component: f7-icon
config:
f7: speaker_3
class: margin-horizontal margin
size: 25
- component: oh-slider
config:
label: true
style:
width: 75%
--f7-range-knob-color: rgba(122,122,122,0.8)
--f7-range-bar-size: 12px
--f7-range-bar-border-radius: 6px
--f7-range-knob-size: 16px
--f7-range-bar-bg-color: rgba(122,122,122,0.2)
--f7-range-bar-active-bg-color: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.6))
--f7-range-knob-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3)
item: =props.prefix+"_Lautstarke"
- component: f7-row
config:
class: -justify-content-space-around -align-items-center -align-content-stretch
slots:
default:
- component: f7-col
config:
noShadow: true
class: resizable
style:
fontSize: 20px
overflow: hidden
slots:
default:
- component: oh-label-card
config:
icon: f7:hifispeaker
iconSize: 20
action: options
actionItem: =props.prefix+"_ActiveDevices"
item: =props.prefix+"_ActiveDevices"
style:
height: 100%
fontSize: small
- component: f7-col
config:
noShadow: true
class: resizable
style:
fontSize: 20px
overflow: hidden
slots:
default:
- component: oh-label-card
config:
icon: f7:music_note_list
iconSize: 20
action: options
actionItem: =props.prefix+"_Playlists"
item: =props.prefix+"_Playlists"
fontSize: small
Sieht nett aus. Magst Du den Code mit uns teilen, damit wir diesen für unsere Bedürfnisse anpassen könnten?Jan_Tiedemann hat geschrieben: ↑14. Feb 2021 19:35 Mal sehen die ersten Widgets habe ich mir schon vom community openhab forum angepasst und die Sites so konstruiert, dass diese auf dem Handy display bedienbar werden.
Code: Alles auswählen
rule "offline_check"
when
Member of gNet changed
then
// logInfo("Net cross"," Name : {} Status {} ", triggeringItem.name, triggeringItem.state) // debug
val vNetItem = triggeringItem.name.replace('state','dummy')
// logInfo("Net cross"," vNetItem : {}", vNetItem) // debug
if (triggeringItem.state == ON) {
postUpdate(vNetItem, "OFF")
logInfo("Net cross"," Gerät {} ist online ", triggeringItem.name)
}
else if (triggeringItem.state == OFF) {
postUpdate(vNetItem, "ON")
logInfo("Net cross"," Gerät {} ist offline ", triggeringItem.name)
}
end