Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

home assistant component can't load: No Such Method #46

Closed
jimsmt opened this issue Mar 1, 2019 · 5 comments
Closed

home assistant component can't load: No Such Method #46

jimsmt opened this issue Mar 1, 2019 · 5 comments

Comments

@jimsmt
Copy link

jimsmt commented Mar 1, 2019

I'm running home assistant on raspberry pi 3,

python_version | 3.5.3
home assistant version | 0.88

config is same as advised

media_player:
  - platform: songpal
    name: my soundbar
    endpoint: http://192.168.2.240:60200/sony

but get this error message

Platform songpal not ready yet. Retrying in 120 seconds.
1:54 PM helpers/entity_platform.py (WARNING)
Unable to get methods from songpal: Got an error for getSupportedApiInfo: NoSuchMethod (12): No Such Method
1:54 PM components/media_player/songpal.py (ERROR) - message first occured at 1:51 PM and shows up 4 times
Platform songpal not ready yet. Retrying in 90 seconds.
1:52 PM helpers/entity_platform.py (WARNING)
Platform songpal not ready yet. Retrying in 60 seconds.
1:51 PM helpers/entity_platform.py (WARNING)
Setup failed for xiaomi_aqara: Component failed to initialize.
1:51 PM setup.py (ERROR)
No gateway discovered
1:51 PM components/xiaomi_aqara/__init__.py (ERROR)
Error doing job: Exception in callback EventBus.async_listen_once.<locals>.onetime_listener(<Event homeassistant_start[L]>) at /srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py:614
1:51 PM components/person/__init__.py (ERROR)
Platform songpal not ready yet. Retrying in 30 seconds.
1:51 PM helpers/entity_platform.py (WARNING)
 
 2019-03-01 05:51:24 ERROR (MainThread) [homeassistant.components.media_player.songpal] Unable to get methods from songpal: Got an error for getSupportedApiInfo: NoSuchMethod (12): No Such Method
2019-03-01 05:51:24 WARNING (MainThread) [homeassistant.components.media_player] Platform songpal not ready yet. Retrying in 30 seconds.
2019-03-01 05:51:27 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback EventBus.async_listen_once.<locals>.onetime_listener(<Event homeassistant_start[L]>) at /srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py:614
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
    self._callback(*self._args)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 626, in onetime_listener
    self._hass.async_run_job(listener, event)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 333, in async_run_job
    target(*args)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/person/__init__.py", line 342, in person_start_hass
    self.person_updated()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/person/__init__.py", line 363, in person_updated
    self._update_state()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/person/__init__.py", line 374, in _update_state
    for entity_id in self._config.get(CONF_DEVICE_TRACKERS, []):
TypeError: 'NoneType' object is not iterable

but I can manual use songpal command line toll in the /srv/homeassistant/bin folder

any help will be appreciated

@rytilahti
Copy link
Owner

If it is working in console, it sounds like the endpoint is likely incorrect. Is that value the same as given by songpal discover? You could adjust your homeassistant's logger to include debug logging for songpal and get more output what is happening.

If it is not working with the cli tool, then this is likely a duplicate of #29 . What device is it?

@jimsmt
Copy link
Author

jimsmt commented Mar 1, 2019

Thanks, Yes I realized that it’s my music server that doesn’t support the method “getSupportedApiInfo”

I did some test and can only use some of the API functions, my device is HAP-S1, not listed as supported device, but it does have the API and I can control it using cellphone APP

@rytilahti
Copy link
Owner

Can you post the output of songpal discover? It will show what services the device offers, which can give a clue of what is/can be supported (soundbars generally support guide, audio, avContent and system). I'm currently doing some code refactoring, one goal being to be able to use those devices without getSupportedApiInfo in the end.

For the time being you can look up commands you need (the source gives some hints) and use songpal command <service> <method> <parameters> to call them manually.

@jimsmt
Copy link
Author

jimsmt commented Mar 2, 2019

./songpal discover
Discovering for 5 seconds
INFO:songpal.discovery:Discovering for 5 seconds
ERROR:songpal.discovery:Unable to find X_ScalaerWebAPI_DeviceInfo

Found HAP-S1 - None
* API version: 1.0
* Endpoint: http://192.168.2.240:60200/sony
  Services:
    - Service: guide
    - Service: system
    - Service: audio
    - Service: avContent

[UPnP]
* URL: http://192.168.2.240:60100/hap.xml
* UDN: uuid:00000000-0000-1010-8000-uid-removed
  Services:
    - Service: urn:schemas-sony-com:service:ScalarWebAPI:1
    - Service: urn:schemas-sony-com:service:MusicConnect:1

This is what I get using songpal discover

I did some tests with the methods in the API document, only some are supported, others either return "no such method" or just empty json file. I can get information of the currently played song, use paly/pause feature, control volume, get next and previous song, set power off

Basic control features are supported, I guess all Sony device with this API should support it, so maybe you can make a hard-coded version of songpal with just some basic control features, that's what most people need. or you can let the users to choose what API method to use

And thanks for your help

@rytilahti
Copy link
Owner

Alright, I'll close this as a duplicate for #29 - thanks for your input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants