MQTT support - 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: MQTT support (/showthread.php?tid=1903) Pages:
1
2
|
MQTT support - normand - 11-19-2019 Would love to be able to control MoOde by sending MQTT messages it. At a minimum: Vol+ Vol- Mute Next/Skip Pause As a bonus: Play radio station RE: MQTT support - TheOldPresbyope - 11-19-2019 And what would be sending these messages? (This is a different way of asking Tim’s favorite question, what’s the use case?) Regards, Kent RE: MQTT support - adrii - 11-19-2019 Hi I had a quick look at this, as I am also interested in remote access, and it is straighforward to set up. I installed an MQTT broker on the Moode machine, and added a user and password https://www.vultr.com/docs/how-to-install-mosquitto-mqtt-broker-server-on-ubuntu-16-04 Then adjusted the python script in the following link to use the local broker https://funprojects.blog/2016/12/13/house-music/ Code: client.subscribe("MoodeRadio") I can then play a radio station from a different debian-based machine, by installing "mosquitto-clients" and running Code: mosquitto_pub -t "MoodeRadio" -m "http://51.15.169.131:80/stream/3/" -u my_username -P "my_password" -h moode_player_ip_address You could use the Python script as a starting point for adding the features you want, and then create a systemctl service file so the script is started at boot. My interest in this is that I have been thinking about creating a standalone screen, connected to some small board, to display status and control the player. There are some very cheap TFT touchscreens https://www.ebay.es/itm/240x320-2-4-SPI-TFT-LCD-Serial-Port-Module-3-3V-PBC-Adapter-SD-ILI9341/113039325767?ssPageName=STRK%3AMEBIDX%3AIT Adrian. RE: MQTT support - normand - 11-19-2019 MQTT messages can also span over different networks. Just a few quick examples: Home Automation system could mute audio if it needs to, for example when someone presses the door bell or someone pulls into the driveway. Arming security system could stop player, Disarming could re-start playback Alarm clock but controlled from different remote device Remote MQTT publisher can push a certain stream (for example if you have multiple locations) I'm sure others could come up with better examples, but could be very handy. Adrian, will investigate that RE: MQTT support - Tim Curtis - 11-19-2019 It would prolly be helpful to list each moOde function that would be desirable to control via MQTT. Play and volume are obvious but are there others? RE: MQTT support - TheOldPresbyope - 11-19-2019 As @adrii demonstrates, using mqtt is easy. It also demonstrates that implementing pub-sub technology requires more than just installng the mosquitto packages. The devil is in the details and IMHO it's premature to freeze the definition of the "more" so Tim can officially support it. The use case suggested by the OP essentially duplicates what we already can do with IR/BT remote controllers. Should be easy to lash up. Why not just write a HowTo? Regards, Kent RE: MQTT support - DRONE7 - 11-22-2019 "The robots are coming for humanity " They've been and gone and come again....! RE: MQTT support - CallMeMike - 11-23-2019 (11-22-2019, 07:28 AM)DRONE7 Wrote: "The robots are coming for humanity " Anno Domini 2120... an Android called Greta AI will raise awareness that there were still some living beings called 'humans' on the Planet... and will call for their elimination. RE: MQTT support - normand - 11-23-2019 duracell80 - I like your example use case RE: MQTT support - normand - 03-03-2020 Got more features to add but here is my working MQTT script as it is at this moment. Code: #!/usr/bin/env python |