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

songpal command in the console #66

Closed
Theiamania opened this issue Apr 13, 2020 · 8 comments
Closed

songpal command in the console #66

Theiamania opened this issue Apr 13, 2020 · 8 comments
Labels

Comments

@Theiamania
Copy link

I need to subscribe to notifications in my Hassio (Docker), but I cant use 'songpal' command in the console (because is Docker?). It answer me "command not found".

How can I use 'songpal' command in console or in any other way?

@rytilahti
Copy link
Owner

You need to access the container where the integrations are installed (and potentially activate the virtualenv, if hassio is using it?).

May I ask why you want to access the notifications?

@Theiamania
Copy link
Author

Do you know where are installed, by default, the integrations in Hassio. Sorry, I'm very newbie with HA.

I want use notifications to get info about the input media, and select the sound mode according this info. A.F.D. is not enough for me.

@rytilahti
Copy link
Owner

Unfortunately I'm not familiar with hassio, sorry. Anyway, here's how the source change notification is handled by homeassistant: https://github.com/home-assistant/core/blob/dev/homeassistant/components/songpal/media_player.py#L164 and here's all available properties for the notification (varies between devices): https://github.com/rytilahti/python-songpal/blob/master/songpal/notification.py#L160 which can be helpful if you are going to modify the code.

@Theiamania
Copy link
Author

I may be wrong, but by reviewing the Sony API it seems like the only way to get the information I need is using notifyPlayingContentInfo.

In python-songpal I suppose that i must use songpal notifications --listen-all avContent to get this info. So I want to use the console, since I would not know how to modify your code and adapt it to my needs.

@rytilahti
Copy link
Owner

rytilahti commented Apr 13, 2020

Yes, that's for the console tool to listen for events. The link I gave to homeassistant's code base is where it is being used. But as a word of warning, modifying hassio instances (nor containers) is a simple task, it is much easier to work outside containers, at least for development purposes.

edit: to add, you could simply install songpal locally and start experimenting with it until you get a feeling how it works. To see all notifications you have to use the --debug flag like this: songpal --debug notifications --listen-all

@Theiamania
Copy link
Author

Thank you! I'll try it

@rytilahti
Copy link
Owner

Did you get it working? Can this be closed now?

@Theiamania
Copy link
Author

Yes, it can be closed. I have finally chosen to use node-red to solve it. But I still use your addon in HA. Thank you so much for everything

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

No branches or pull requests

2 participants