03-22-2023, 10:01 AM
(11-02-2022, 10:38 AM)gwurb Wrote:(11-02-2022, 10:25 AM)Tim Curtis Wrote: There are already ways to control moOde remotely and get status via http so it would be better to be more specific about what you want to accomplish instead of just saying make a REST API or a plugin for Home Assistant.
Hi Tim,
I would like to write a python script to control playback, get status of volume, get information about song or radio stream being played, etc.
When you write that there is already a way to control moOde remotely and get status via http, where do I look for documentation or examples?
I thought I may be able to start with something simple myself and tried doing this:
curl http://moode/command/?cmd=status
and I get no return. I found a post where you mentioned un-commenting an echo $resp in /var/www/command/index.php , but looking at /var/www/command/index.php I don't see an echo $resp being commented out.
To be clear, I want to control moOde playback, not MPD.
Thanks
Edit: Or would you recommend that I direct attention to controlling MPD?
I would also recommend the MPD route. Moode has a very good integration with MPD and for Python, there already is a good module with MPD support (https://github.com/Mic92/python-mpd2). I used this in developing mpd2chromecast for casting playback to chromecast devices.
You will get the same results as using the moode API, but it will be a bit more generic and portable to other MPD-based solutions.