Does anyone use songpal?

Hi all.
I am trying to integrate songpal and it doesn’t seem to be working.
I think that when integrating it, a new media player object should appear. This did not happen.
I then tried to use songpal from python but I am not doing something right. If someone used it, could you help me?
Thanks you

C:\Users\Milena>songpal discover
Discovering for 5 seconds
INFO:songpal.discovery:Discovering for 5 seconds

Found BDV-N9200W - BDV-2014
* API version: 1.0
* Endpoint: http://192.168.0.12:10000/sony
  Services:
    - Service: guide
    - Service: system
    - Service: illumination
    - Service: audio

[UPnP]
* URL: http://192.168.0.12:64321/bdv-nv-ms.xml
* UDN: uuid:00000001-0000-1010-8000-045d4b136525
  Services:
    - Service: urn:schemas-upnp-org:service:ContentDirectory:1
    - Service: urn:schemas-upnp-org:service:ConnectionManager:1
    - Service: urn:schemas-sony-com:service:ScalarWebAPI:1
C:\Users\Milena>songpal bluetooth off
Endpoint is required except when with 'discover'!
Traceback (most recent call last):
  File "c:\users\milena\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\milena\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Milena\AppData\Local\Programs\Python\Python39\Scripts\songpal.exe\__main__.py", line 7, in <module>
  File "c:\users\milena\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\milena\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\milena\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\milena\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\milena\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\milena\appdata\local\programs\python\python39\lib\site-packages\click\decorators.py", line 69, in new_func
    raise RuntimeError(
RuntimeError: Managed to invoke callback without a context object of type 'Device' existing

There is another method but it doesn’t work. I just wanted to see if the command worked as it was written

It says that the json is wrong

curl -i -d '{ "method":"setSoundSettings", "id":5, "params":[ { "settings":[ { "value":"clearAudio", "target":"soundField" } ] } ], "version":"1.1" }' http://192.168.0.12:10000/sony/audio

curl: (3) Port number ended with 's'
curl: (3) Port number ended with ','
curl: (3) [globbing] bad range specification in column 9
curl: (3) [globbing] unmatched brace in column 1
curl: (3) [globbing] bad range specification in column 11
curl: (3) [globbing] unmatched brace in column 1
curl: (3) Port number ended with 'c'
curl: (3) Port number ended with 's'
curl: (3) [globbing] unmatched close brace/bracket in column 1
curl: (3) [globbing] unmatched close brace/bracket in column 1
curl: (3) [globbing] unmatched close brace/bracket in column 1
curl: (3) [globbing] unmatched close brace/bracket in column 1
curl: (3) Port number ended with '.'
curl: (3) [globbing] unmatched close brace/bracket in column 1
  1. Are you using the songpal integration? If so, check for errors in log
  2. Message is explicit: “Endpoint is required except when with ‘discover’!”. You have to give the sony url here, I assume
  3. Your curl likely misses -X POST

Yes. From Home assistant it does not connect. It says it can’t connect. So my intention was to install songpal on a windows computer and run the commands from there. In Home assistant operating system I cannot install pip. I guess that’s why the integration doesn’t work.

If I run songpal Discover it finds the computer and shows me information but I don’t know how to run a command and make it work

I use songpal. I have set it up using GUI. For me it was just plug & plug. I saw new songpal devices in the integration page with discovery and just pressed configure. I have three songpal devices (2x ZR7, 1X NH5NT)

The integration finds it but then it appears without devices. Have you ever used songpal from the terminal?

No sorry, I only use it like this. I had once that I couldn’t connect, because of an update. Somehow, I needed to start network services again on the Soundbar to accept the terms. Then it worked again. Maybe you need to play around with the settings on the device itself?

Maybe. I am going to try. Thanks a lot

The strange thing is that from the Android application Songpal if it allows remote control. The integration is discovered but you have no devices to control.

I add this just to see if it works to solve it. If I can solve it I will post it so that it does not remain unsolved.

C:\Users\Milena>songpal -dd --endpoint http://192.168.0.49:10000/sony dump-devinfo
Setting debug level to 2
DEBUG:root:Using endpoint http://192.168.0.49:10000/sony
DEBUG:songpal.device:Endpoint: http://192.168.0.49:10000/sony
DEBUG:songpal.device:Guide endpoint: http://192.168.0.49:10000/sony/guide
DEBUG:songpal.device:> POST http://192.168.0.49:10000/sony/guide with body: {‘method’: ‘getSupportedApiInfo’, ‘params’: [{}], ‘id’: 1, ‘version’: ‘1.0’}
DEBUG:songpal.device:Received 200: <bound method ClientResponse.text of <ClientResponse(http://192.168.0.49:10000/sony/guide) [200 OK]>
<CIMultiDictProxy(‘Connection’: ‘close’, ‘Content-Length’: ‘43’, ‘Content-Type’: ‘application/json’)>

Unable to get supported methods: Got an error for getSupportedApiInfo: NoSuchMethod (12): getSupportedApiInfo

I’m also having difficulties with songpal, although in my case the GUI Integration setup succeeds, device (Sony SRS-RA3000) is discovered on my network, and the HA entity gets created no problem. However, after some time it stops functioning… maybe due to multiple timeouts.

To resolve this, I’ve decided to go around the integration and send commands to the speaker directly via cURL and Sony’s Audio Control API

Here’s an example command below (this one works) . As you can see my endpoint is on port:54480.

curl
-H 'Content-Type: application/json'
-H 'X-Auth-PSK:0000'
-X POST
-d '{
"method":"getSupportedApiInfo",
"id":5,
"params":[ {"services":[]} ],
"version":"1.0"}'
http://192.168.1.106:54480/sony/guide/

Unfortunately, I’ve been repeatedly hitting a wall with Sony’s inconsistent API – some methods work and some don’t.