Hello! Just need a bit help. Currently, I’m trying to create music player using MQTT. Everything is fine when I’m trying to enable/disable player, but I also want to send full path to the audio file. I see in web-UI that field updated properly, but I can’t see proper value in MQTT topic.
In brief:
Everything works fine with command: ON/OFF
MQTT topic doesn’t update with String Items or Slider
.Items
Switch Music_intro_enabled "Enabled [%s]" {mqtt=">[OpenHab:quest/room1/music/intro_enabled:command:ON:1], >[OpenHab:quest/room1/music/intro:command:OFF:0]"}
String Music_intro_path "Path [%s]" {mqtt=">[OpenHab:quest/room1/music/intro_path:command:*]"}
Dimmer Music_intro_volume "Volume [%s]" {mqtt=">[OpenHab:quest/room1/music/intro_volume:command:*]"}
.Rules
rule "Init"
when
System started
then
postUpdate(Music_intro_enabled, OFF)
postUpdate(Music_intro_path, "/home/alex/Mysterium/Raspberry/MusicMixer/Player/1.mp3")
sendCommand(Music_intro_path, "/home/alex/Mysterium/Raspberry/MusicMixer/Player/1.mp3")
postUpdate(Music_intro_volume, 100)
end
.Sitemap
Frame label="Sound"
{
Frame label="Intro"
{
Switch item=Music_intro_enabled
Text item=Music_intro_path
Slider item=Music_intro_volume
}
}
Thanks!!!