[IDEA] REST API - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8) +--- Thread: [IDEA] REST API (/showthread.php?tid=5164) |
REST API - gwurb - 11-02-2022 It would be great to have a REST API to control moOde remotely, and get status updates remotely, etc. This would open the possibility of plugins for things like Home Assistant. RE: REST API - Tim Curtis - 11-02-2022 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. RE: REST API - gwurb - 11-02-2022 (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? RE: REST API - Tim Curtis - 11-02-2022 It's in the Setup guide https://github.com/moode-player/moode/blob/master/www/setup.txt RE: REST API - gwurb - 11-02-2022 (11-02-2022, 11:15 AM)Tim Curtis Wrote: It's in the Setup guide Thanks for that Tim It has been a while since I've read the setup guide... years... Had a quick look, and http://moode/command/?cmd=get_currentsong returns [] http://moode/command/playback.php?cmd=get_mpd_status returns useful info that I can work with I'll look around to see if I can find a way to do everything I am after. Are the commands a work in progress as per Setup guide example not working, and needing an alternative url? Or do you think you think you'll keep them fairly constant? RE: REST API - TheOldPresbyope - 11-02-2022 @gwurb Go to m > Configure > System and turn on the metadata file local service. Now you’ll get currentsong info via the API. Regards, Kent RE: REST API - andib - 12-10-2022 Thank you very much for this thread this helps a lot to get the info if the player is in play or stop mode!! 2 Solutions: - http://moode/command/?cmd=get_currentsong - http://moode/command/?cmd=get_mpd_status After this i was able to connect a zigbee Button to "play" or "stop" sound .... and adjust the volume up and down. RE: REST API - adam_zzz - 02-18-2023 +1 For making this feature more visible, maybe a mention in the homepage feature list A few years ago I remember going for Volumio because it had a rest api and I couldn't find a way to interact programmatically with moOde. RE: REST API - Tim Curtis - 02-18-2023 (02-18-2023, 08:19 PM)adam_zzz Wrote: +1 For making this feature more visible, maybe a mention in the homepage feature list It's in the Setup Guide but I suppose that dev's don't read it ;-) But not a bad idea to mention it in the Feature list and Developer page. I'll add to the TODO list. RE: REST API - dresdner353 - 03-22-2023 (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. 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. |