Emil Jensen wrote:
Is this possible:
I walk into my bathroom, a sensor sees that someone is in the room, turn on the lights and start playing radio on the Beoplay M3
And if so, want movement sensor do you recommend that I can buy in Denmark.
And I have seen Philips Hue have one, can that be used?
Hello Emil,
what I have done is to start an M5 when I turn the lights on. If any A/V rendere is playing any source then the M5 joins, otherwise it starts on spotify I
decided to go for the lights state as an event cause the sensor to be reliable it has to cover all the area and I should move "constantly" (my bathroom is a bit big).
For controlling the lights I use fibaro.
Below you can find the lua😕
function(event, engine)
-- Define the resource address in your project:
local music_player_address = "Main/*/AV renderer/*"
local bathroom_address = "Main/Bathroom/AV renderer/Beoplay M5 Bathroom"
-- Get music player state
local music_player = engine.query(music_player_address)[1]
if music_player.get("sourceUniqueId") ~= "" then
engine.fire(bathroom_address .. "/Send command?Command=JOIN&Continue type=short_press")
else
engine.fire("Main/Bathroom/AV renderer/Beoplay M5 Bathroom/Select source?Connector=&Origin=local&Source Type=SPOTIFY")
end
end
I hope that I have no errors, at least for me it works as intended.