I have a TV “Thing” with multiple channels linking Items such as POWER, VOL, INPUT, MUTE. The items which are Switch Type such as POWER and MUTE I am able to publish MQTT when using “.sendCommand(ON)” in a rule, but the String Items such as VOL and INPUT won’t publish.
.thing file
Thing mqtt:topic:MBR_Vizio "Master Bedroom TV" (mqtt:broker:unRAID-mosquitto) @ "Master Bedroom"{
Channels:
Type switch : Power [stateTopic="stat/MBR_Vizio/POWER" , transformationPattern="JSONPATH:$.ITEMS.[0].VALUE", commandTopic="cmnd/MBR_Vizio/POWER" ]
Type string : Volume [stateTopic="stat/MBR_Vizio/VOLUME", transformationPattern="JSONPATH:$.ITEMS.[0].VALUE"]
Type string : Input [stateTopic="stat/MBR_Vizio/INPUT", transformationPattern="JSONPATH:$.ITEMS.[0].VALUE", commandTopic="cmnd/MBR_Vizio/INPUT", postCommand="true"]
Type switch : Mute [stateTopic="stat/MBR_Vizio/MUTE" , transformationPattern="JSONPATH:$.ITEMS[0].INDEX", commandTopic="cmnd/MBR_Vizio/MUTE" ]
}
Item file
Switch MBR_Vizio_Power "Power ON / OFF" { channel="mqtt:topic:MBR_Vizio:Power" }
String MBR_Vizio_Volume "Volume [%s ]" { channel="mqtt:topic:MBR_Vizio:Volume" }
String MBR_Vizio_Input "Input" { channel="mqtt:topic:MBR_Vizio:Input" }
Switch MBR_Vizio_Mute "Mute" { channel="mqtt:topic:MBR_Vizio:Mute" }
sample rule
rule "TEST Input"
when
Time cron "0 30 06 ? * MON,TUE,WED,THU,FRI *"
then
MBR_Vizio_Power.sendCommand(ON)
MBR_Vizio_Input.sendCommand("HDMI-2")
MBR_Vizio_Volume.sendCommand("30")
end
I thought maybe the “postCommand=“true”” might be the issue but that didn’t change anything and the Power works fine without it. It only seems to be an issue with the “string” items, all of my switches work just fine. Everything receives the stateTopics and updates fine, it’s only the publishing of the string.