Bang Olufsen Module


i want to make a B&O module for my TV and speakers.

The question i have is to make a JSON stream into SYmcon.

B&O works with a JSON stream based on the HTTP/1.1 protocol. connection is not closed, JSON packages are comming in to update the status.

Which I/O module do i need to build this, or made my own I/O module?


Some commands:

the speaker sends a JSON stream on: http://<ip_address>:8080/BeoNotify/Notifications
the volume can be controlled with: curl -H „Content-Type: application/json“ -X PUT -d ‚{„level“:‘${volume_level}’}’
to play the song/radio/spotify that has been paused: curl -H „Content-Type: application/json“ -X POST curl -H „Content-Type: application/json“ -X POST
to pause the song/radio/spotify that has been playing: curl -H „Content-Type: application/json“ -X POST curl -H „Content-Type: application/json“ -X POST
to turn off the speaker (standby mode): curl -H „Content-Type: application/json“ -X PUT -d ‚{„standby“:{„powerState“:„standby“}}‘


I think you have to build your own module. The module type could be a device and has not to be an I/O instance.

Maybe you have a look at the Sonos or Bose SoundTouch modules to get some ideas or any other module like this, e.g Onkyo… Have a look at the community.

Do you have an official API documentation?

If you don‘t want to build a module, you can create scripts to start with, but a module would be the best way.



Gesendet von iPhone mit Tapatalk

thanx for you reply.
Already checked both modules.
I already build some modules, but the question is how to proces a HTTP Stream of data.

A telnet output:
~  telnet 8080  :heavy_check_mark:  158  21:03:25
Connected to beoplay-a6-25611490.steehouwer.local.
Escape character is ‚^]‘.
GET /BeoNotify/Notifications?list=recursive+features HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Accept-Language: en-us
Connection: Keep-Alive

HTTP/1.1 200 OK
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/json

{„notification“:{„timestamp“:„2019-07-19T19:29:44.313096“,„type“:„SOURCE“,„kind“:„source“,„data“:{„primary":",„primaryJid“:"",„primaryExperience“:{„source“:{„id":"“,„friendlyName“:„TuneIn“,„sourceType“:{„type“:„TUNEIN“},„category“:„RADIO“,„inUse“:true,„profile“:"",„linkable“:true,„recommendedIrMapping“:[{„format“:0,„unit“:0,„command“:129},{„format“:11,„unit“:0,„command“:129},{„format“:11,„unit“:1,„command“:129},{„format“:0,„unit“:0,„command“:147},{„format“:11,„unit“:0,„command“:147}],„contentProtection“:{„schemeList“:[„NONE“]},„embeddedBinary“:{„schemeList“:},„product“:{„jid":"“,„friendlyName“:„BeoPlay A6“}},„listener“:[„“],„lastUsed“:„2019-07-19T18:19:22.855000“,„state“:„play“,"_capabilities":{„supportedNotifications“:[{„type“:„SOURCE“,„kind“:„source“},{„type“:„SOURCE_EXPERIENCE_CHANGED“,„kind“:„source“},{„type“:„PLAY_QUEUE_CHANGED“,„kind“:„playing“},{„type“:„NOW_PLAYING_ENDED“,„kind“:„playing“},{„type“:„STREAMING_STATUS“,„kind“:„streaming“},{„type“:„PROGRESS_INFORMATION“,„kind“:„playing“},{„type“:„NOW_PLAYING_NET_RADIO“,„kind“:„playing“}]}}}}}

{„notification“:{„timestamp“:„2019-07-19T19:29:44.314428“,„type“:„NOW_PLAYING_NET_RADIO“,„kind“:„playing“,„data“:{„name“:„Arrow Classic Rock (Classic Rock)“,„genre“:„Classic Rock“,„country“:"",„languages“:"",„image“:[{„url“:„",„size“:„large“,„mediatype“:„image/png“}],„liveDescription“:"FREE - MY BROTHER JAKE“,„stationId“:„s6702“,„playQueueItemId“:„plid-4205.6“}}}




This continues as long as the connection is established.

Now, howto proces this stream, non blocking in Symcon.


The easiest should be a simple ClientSocket. You send the „initial“ request and then you take care of the HTTP processing on your own. As you are only interested in the payload filtering the HTTP overhead should not be that complicated.


Thanx, this helped me a lot! traffic is comming in!

Next question, how can i have a statefull property variable?



  • @property int $State
    class BangOlufsenDevice extends IPSModule

public function Create()


public function ReceiveData($JSONString)
$this->SendDebug(FUNCTION, "COunt: ".$this->State,0);


I get a error: 20-07-2019 13:47:11 | FlowHandler | Could not forward data to instance #37416: <br />
<b>Notice</b>: Undefined property: BangOlufsenDevice::$State in <b>/var/lib/symcon/modules/IPS_BO/BangOlufsen/module.php</b> on line <b>107</b><br />

How can i fix this and make $State not static but keeps my state?

thanx again.

found it,

added those functions to my class and it works:
public function __set($name, $value)
$this->SetBuffer($name, serialize($value));
public function __get($name)
return unserialize($this->GetBuffer($name));