How to send radio stream or mp3 to a speaker?

Hi,
i have installed a speaker in the bathroom. Now everytime the presence detection triggers, i want to start the music in this room. The speaker is wired directly to the technics room, where the openhab server is installed.

Is there a cheap way to send audio to the speaker? Maybe with the audio out (headphones-out)? Or do i have to buy an amplifier? But then, can i do this with my openhab server or do i have to install another device (hifiberry?) which only has to do this one job?

Depending on the speaker, the power output by the Pi’s headphone jack is unlikely to be powerful enough, but it is worth a try. You can wire up a headphone jack to the speaker wires and plug it in and see what happens. I’m going to guess it will be either too quiet, noisy, or both.

In which case an apm of some sort would be required. This is outside my area of expertise so I can’t point you in the right direction. But if you buy a commercial device it will almost certainly have a wire between the headphone jack of your Pi and an input on the amp and the speakers will be hooked up to the amp.

You could use a powered PC/laptop speaker, they would draw the signal from the audio jack and have their built-in amp; but the native audio capability of the raspberry is rather poor, lots of clicks, etc so as long as your expectations are not too high, this may work. if you are looking for an amp there are some cheap class D amplifiers around that may do the trick; if you are more willing to experiment, and know how to, USB sound cards can also be a cheap way to get better sound on a raspberry (maybe you have one laying around); googling will get you lots of tutorials; personally I went the squeezebox (Logitechmediaserver, also opensource) route with a few squeezelite players (hifiberry and other audio cards with class D amps), to have pretty cheap and very satisfying audio capabilities.