08-06-2017, 17:05:27
(Dieser Beitrag wurde zuletzt bearbeitet: 08-06-2017, 17:22:25 von Smarter.)
Openhab Geräte mit HTTP-Request schalten. Ich benutzte OpenHAB 2.0 mit dem Classic User Interface .
Das Classic Interface hat ein REST Interface und damit können HTTP Befehle abgesetzt werden, um dann in Openhab eingebundene Geräte zu schalten.
Hier gibt es mehr Informationen zum Openhab REST interface link
Hier mal ein HTTP Befehl um für eine Sonos Box das Radio einzustellen und zu starten
Und damit wird die Box wieder bestoppt
Items
Das Classic Interface hat ein REST Interface und damit können HTTP Befehle abgesetzt werden, um dann in Openhab eingebundene Geräte zu schalten.
Hier gibt es mehr Informationen zum Openhab REST interface link
Hier mal ein HTTP Befehl um für eine Sonos Box das Radio einzustellen und zu starten
Code:
http://192.168.178.42:8080/classicui/CMD?Sonos_PLAY1_Bad_Radio=hr1
Und damit wird die Box wieder bestoppt
Code:
http://192.168.178.42:8080/classicui/CMD?Sonos_PLAY1_Bad_Stop=ON
PHP-Code:
//OG-Bad
Player Sonos_PLAY1_Bad_Controller "Bad" <audio_sound> (gSonos) {channel="sonos:PLAY1:RINCON_000E58C61D7401400:control"}
Dimmer Sonos_PLAY1_Bad_Volume "Lautstaerke [%.1f %%]" <audio_audio> (gSonosVolum,gSonos) {channel="sonos:PLAY1:RINCON_000E58C61D7401400:volume"}
Switch Sonos_PLAY1_Bad_Mute "Stumm" <soundvolume_mute> (gSonosMute, gSonosMuteSwitch) {channel="sonos:PLAY1:RINCON_000E58C61D7401400:mute"}
String Sonos_PLAY1_Bad_CurrentTrack "Aktueller Titel [%s]" <audio_playliste> {channel="sonos:PLAY1:RINCON_000E58C61D7401400:currenttrack"}
Switch Sonos_PLAY1_Bad_Stop "Stop" <sonos_stop> (gSonosStop) {channel="sonos:PLAY1:RINCON_000E58C61D7401400:stop", autoupdate="false"}
String Sonos_PLAY1_Bad_Play_URL <audio_sound> {channel="sonos:PLAY1:RINCON_000E58C61D7401400:playuri"}
String Sonos_PLAY1_Bad_Notification "Notification Sound" <audio_audio> {channel="sonos:PLAY1:RINCON_000E58C61D7401400:notificationsound"}
Dimmer Sonos_PLAY1_Bad_NotificationVol "Notification Volume" <audio_audio> {channel="sonos:PLAY1:RINCON_000E58C61D7401400:notificationvolume"}
Switch Sonos_PLAY1_Bad_Save "Save Playlist" <audio_playliste> {channel="sonos:PLAY1:RINCON_000E58C61D7401400:save"}
Switch Sonos_PLAY1_Bad_Restore "Restore Playlist" <audio_playliste> {channel="sonos:PLAY1:RINCON_000E58C61D7401400:restore"}
String Sonos_PLAY1_Bad_Radio {channel="sonos:PLAY1:RINCON_000E58C61D7401400:radio"}
Switch Sonos_PLAY1_Bad_play {channel="sonos:PLAY1:RINCON_000E58C61D7401400:play"}
![[Bild: heart.png]](http://www.rwe-smarthome-forum.de/images/mybbng/smilies_new/heart.png)
![[Bild: heart.png]](http://www.rwe-smarthome-forum.de/images/mybbng/smilies_new/heart.png)