Hallo beoandy
Besten Dank für deine Inputs und Links! Ich bin heute einen Riesenschritt vorangekommen - und zwar so weit, dass ich - mindestens zur Zeit - den BeoLink Gateway weglassen kann....
Was ich wollte, ist, dass ich mit meinen MyStrom-Buttons (link und ) einen Join auslösen kann - und es ist mir gelungen!!!
Zuerst dachte ich, das BeoLink Gateway müsse dazu die Button-Events mitkriegen - aber einen 'Listener' auf dem BeoLink Gateway habe ich nicht hingekriegt. Dann habe ich realisiert, dass man in den Buttons direkt Action-Links hinterlegen kann, was mir letztendlich gelang. Noch ist die Programmierung unten clumsy, und man könnte vermutlich auch friendly names verwenden, aber es funzt. Die Zusammenfassung meiner Notizen, die ich dazu gebraucht habe, folgt im Anschluss.
Was mir nun eigentlich fehlt - und ich bislang nirgends gefunden habe - ist ein NetworkLink Befehlssatz, d.h. welche Befehle (Funktionen) es insgesamt gibt. Damit könnte man noch einige elegante Dinge anstellen...
Dir schon mal herzlichen Dank - und gerne auf weiteren Austausch!
Nietz.
************************* N O T I Z E N *********************
Bang & Olufsen / Beolink Gateway
***************************************************************
01.07.2020/Nietz
curl-Befehle
**************
Join BeoSound Core für BeoSound 2 (IP: 192.168.0.78):
Get Sources:
curl -H "Content-Type: application/json" -X GET 192.168.0.198:8080/BeoZone/Zone/Sources
Join:
curl -d '{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}' -H "Content-Type: application/json" -X POST 192.168.0.78:8080/BeoZone/Zone/ActiveSources
MYSTROM-Befehle zum Programmieren der Tastenbefehle:
****************************************************
Auslesen der gespeicherten Tastenbefehle:
curl --request GET '192.168.0.72/api/v1/action'
Programmieren eines Tastenbefehls:
curl --request POST '192.168.0.72/api/v1/action/single' \--data-raw 'get://192.169.0.14/test'
Löschen eines Tastenbefehls:
curl --request POST '192.168.0.72/api/v1/action/single' \--data-raw ''
MySwitch-Befehl für Join B&O:
*****************************
A) Single Press:
curl --request POST '192.168.0.72/api/v1/action/single' \--data-raw 'post://192.168.0.78:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}'
B) Double:
curl --request POST '192.168.0.72/api/v1/action/double' \--data-raw 'post://192.168.0.78:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}'
C1) Long: (zwei B&O-Geräte joinen)
curl --request POST '192.168.0.72/api/v1/action/long' \--data-raw 'post://192.168.0.78:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}||post://192.168.0.108:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}'
C2) Long: (drei B&O-Geräte joinen)
curl --request POST '192.168.0.72/api/v1/action/long' \--data-raw 'post://192.168.0.78:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}||post://192.168.0.108:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}||post://192.168.0.147:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}'
C3) Long: (vier B&O-Geräte joinen)
curl --request POST '192.168.0.72/api/v1/action/long' \--data-raw 'post://192.168.0.78:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}||post://192.168.0.108:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}||post://192.168.0.147:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}||post://192.168.0.57:8080/BeoZone/Zone/ActiveSources?{"activeSources":{"primary":"radio:2797.1293039.28562990@products.bang-olufsen.com"},"join":true}'
Aus https://github.com/PolyPv/BeoRemote/blob/master/BeoRemote.txt:
**********************************************************************************
****************************** General information *******************************
**********************************************************************************
Remember that this is a note of my experiences with the BeoRemote protocol.
It is neither an official documentation nor am I responsible for any direct,
indirect, incidental or consequential damages resulting from using this as
your reference.
Furthermore this is a work-in-progress and most likely incomplete and
outdated.
**********************************************************************************
******************************* Bonjour / Zeroconf *******************************
**********************************************************************************
NAME: _beoremote._tcp.local
PORT: 8080
TXT RECORD: mac=Macaddress / device=Devicename / type=Typenumber
**********************************************************************************
********************************** RESTful API ***********************************
**********************************************************************************
Everything is handled with JSON over HTTP.
HTTP header field for "accept" and "content-type" is both "application-json".
To get an idea of the protocol simply enter the ip address of your device in
a normal web browser (e.g. http://192.168.0.123:8080) and follow the links.
The PUT and POST commands can be easily send with e.g. CURL for testing purpose.
Most PUT and POST commands needs a RELEASE command afterwards. This is very
important for e.g. VOLUME_UP. Otherwise volume will automatically increment to
its maximum.
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/Ping
DESCR: ping
TYPE: HTTP GET
RETURNS: 200
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Sources
DESCR: list of all available sources
TYPE: HTTP GET
RETURNS: sourcenames and IDs
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Notifications
DESCR: stream with 2way notifications
TYPE: HTTP GET stream
EVENTS: NUMBER_AND_NAME | KEYBOARD | TRACKPAD | VOLUME | SOURCE
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoOneWay/Input
DESCR: send input commands / needs a RELEASE command afterwards
TYPE: HTTP POST
PAYLOAD: {"timestamp":74728000,"command":"insert_command_here"}
{"character":"character_here"}
COMMANDS: RELEASE | TEXT | PMUTE | MENU | RED | GREEN | YELLOW |
BLUE | WIND | REWIND | PLAY | STOP | BACK | STANDBY |
DIGIT_0 | DIGIT_1 | DIGIT_2 | DIGIT_3 | DIGIT_4 | DIGIT_5 |
DIGIT_6 | DIGIT_7 | DIGIT_8 | DIGIT_9 | VOLUME_DOWN |
VOLUME_UP | STEP_UP | STEP_DOWN | CURSOR_UP | CURSOR_DOWN |
CURSOR_LEFT | CURSOR_RIGHT | SELECT | MUTE
RETURNS: 202
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoInput/Control
DESCR: send control commands
TYPE: HTTP POST
PAYLOAD: {"control":"insert_command_here"}
COMMANDS: BACKSPACE | DONE
RETURNS: 202
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/ActiveSources
DESCR: change the current source
TYPE: HTTP POST
PAYLOAD: {"activeSources":{"secondary":"secondary_ID","primary":"primary_ID"},"join":true}
RETURNS: 202
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Sound/SpeakerGroup
DESCR: get all speaker groups
TYPE: HTTP GET
RETURNS: all speaker groups and their numbers
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Stand
DESCR: get all stand positions
TYPE: HTTP GET
RETURNS: all stand positions and their numbers
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Picture/Mode
DESCR: get all picture modes
TYPE: HTTP GET
RETURNS: all picture modes and their numbers
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Picture/Format
DESCR: get all picture formats
TYPE: HTTP GET
RETURNS: all picture formats and their numbers
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Sound/Mode
DESCR: get all sound modes
TYPE: HTTP GET
RETURNS: all sound modes and their numbers
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Sound/SpeakerGroup/Active
DESCR: change the active speaker group
TYPE: HTTP PUT
PAYLOAD: {"active":integer_value}
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Sound/Mode/Active
DESCR: change the active sound mode
TYPE: HTTP PUT
PAYLOAD: {"active":integer_value}
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Stand/Active
DESCR: change the active stand position
TYPE: HTTP PUT
PAYLOAD: {"active":integer_value}
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Picture/Mode/Active
DESCR: change the active picture mode
TYPE: HTTP PUT
PAYLOAD: {"active":integer_value}
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
URL: http://hostname.local:8080/BeoZone/Zone/Picture/Format/Active
DESCR: change the active picture format
TYPE: HTTP PUT
PAYLOAD: {"active":integer_value}
----------------------------------------------------------------------------------