ich habe eine Frage bezüglich des Player-Items.
Ich habe diese Rule, um mit Spotify zu interagieren. Das klappt für PLAY und PAUSE soweit auch gut.
Code: Alles auswählen
rule "Spotify Item zuweisung"
when
Item spotify_player received update
then
spotify_action.sendCommand(spotify_player.state.toString.toLowerCase())
switch(spotify_player.state) {
case PLAY: {
spotify_action.sendCommand("play")
}
case PAUSE: {
spotify_action.sendCommand("pause")
}
case NEXT: {
spotify_action.sendCommand("next")
logInfo("Spotify", "Updated NEXT: " + spotify_player.state.toString.toLowerCase())
}
}
logInfo("Spotify", "Updated: " + spotify_player.state.toString.toLowerCase())
end
Code: Alles auswählen
Default item=spotify_player
Code: Alles auswählen
Player spotify_player
Wo muss ich denn noch Einstellen, dass diese Werte für das Item legitim sind?
Laut der Seite sollte das ganze ja eigentlich klappen (https://www.openhab.org/docs/configurat ... .html#type), oder überlese ich da etwas?
Auch wenn ich in der Karaf-Konsole das Item ändere
Code: Alles auswählen
smarthome:update spotify_player NEXT
Error: State 'NEXT' is not valid for item 'spotify_player'
Valid data types are: ( PlayPauseType RewindFastforwardType UnDefType )