I took a different approach. moOdeAudio is really a full-featured UI over MPD, as well as a handy way to organize a music library, create playlists and manage favorite streaming channels. So I decided to create a separate tab to display the moOde UI directly in an iframe:
This way, I can interact with moOde within the context of HA. I let HA handle my AV receiver to control the volume, as well as whether music plays in other zones.
I did find it handy to use the mpd component to expose buttons for starting/stopping/ffwd/rew operations within HA.
@tomplums did you install lms on the HA server? how?
Iām been using moodeaudio for years and messing around with picoreplayer and lms feels like a step back into the 90s!
I canāt even work out how to get a bbc radio 6 stream running
how do you deal with selecting a particular album to play?
thanks!
ok cheers Iāll persevereā¦
what flavour server are you using?
Iāve just set up HA on an Odroid C2 but Iāve got an old intel motherboard kicking around that I could use to set up a āproper serverāā¦
I think this HA software has a slightly confused āexistenceā
I read only Debian servers are supported but then this image that I just downloaded yesterday is running aarch64ā¦great I thought cos Iām familiar with arch but this weird config on the Odroid doesnāt let you properly get at the base OS and now I discovered aarch64 just means ARM 64 bit architecture so christ knows what OS it is running
Yours confused!
Hello I also have a similar setup, I am using a few pis with PiCorePlayer and a mac based LMS server and a HA os on a rpi4.
Care to elaborate on your setup, I currently am able to do multi-room audio but I control it mainly from Picoreās Materialās web interface. Although i see it in HA i havenāt been able to find a way to build a card that would automatically switch to say the Main living room player that has a Great DAC attached to it or the use the audio from itās HDMI when i want 5.1 or squeeze-cast while showing just that entityā¦ I would like not to have to show/see all 5 possible entities for a single playerā¦ I mean see only the one thatās playing currently.
Iād like to see your card for audio!
Here what mine currently looks like, It works but iām not satisfied.
I have the same issue.
I think I will do it similar to this solution but rather use mqtt instead of ifttt https://moodeaudio.org/forum/showthread.php?tid=2935
Basically it gives you a trigger when the speakers get active independent of the audio source
I detect the audio-output with this simple python script which sends the current state to home assistant. In Home assistant I switch on/off the power for my speakers.
The script is not very elegant but works flawless since some time now.
import time
import paho.mqtt.client as mqtt
import socket
MQTT_SERVER = "YOUR MQTT BROKER IP"
STATUS_UNKNOWN, STATUS_CLOSED, STATUS_OUTPUT = range(3)
status = STATUS_UNKNOWN
def on_connect(client, userdata, flags, rc):
print('connected')
def on_disconnect(client, userdata, rc):
print('disconnected')
connect()
client = mqtt.Client()
client.username_pw_set(username="MQTT USER",password="MQTT PASSWORD")
client.on_disconnect = on_disconnect
client.on_connect = on_connect
def connect():
for i in range(120000): # wait for HA to start
try:
client.connect(MQTT_SERVER, 1883, 60)
except socket.error:
pass
else:
print('needed %i attempts'%i)
break
time.sleep(1)
else:
sys.exit('could not connect')
connect()
time.sleep(2) # give the client time to connect
client.publish('moode/wohnzimmer', 'Start')
counter = 0
while True:
with open('/proc/asound/Headphones/pcm0p/sub0/hw_params') as f:
lines = f.read()
first = lines.split('\n',1)[0]
# print(first)
if first == 'closed':
if status != STATUS_CLOSED or counter > 10:
print('send closed')
client.publish('moode/audio_output_wz', 'OFF')
counter = 0
status = STATUS_CLOSED
else:
if status != STATUS_OUTPUT or counter > 10:
client.publish('moode/audio_output_wz', 'ON')
print('send out')
counter = 0
status = STATUS_OUTPUT
counter += 1
time.sleep(1)
You can auto-start it by adding this line to /etc/rc.local