combine mqtt and squeezebox item

108 views
Skip to first unread message

Michael Pophal

unread,
Sep 12, 2015, 12:37:25 PM9/12/15
to openhab
Hi,

just a simple question: does a item like this

Switch sq_schlafen_power    "Power"    { squeeze="schlafen:power", mqtt=">[mysensor:MyMQTT/23/3/V_LIGHT:command:ON:1], >[mysensor:MyMQTT/23/3/V_LIGHT:command:OFF:0]" }

work? When I power on my squeezebox the amplifier should switch on. This mysensors-MQTT does switch the amplifier. But unfortunately the above defined item doesn't work as expected.
A combination in the item  {squeeze="..", knx=".."} works, but not {squeeze="..", mqtt=".."}. Does this need to be implemented, is it a bug or my mistake?
Can anybody help me?

Kind regards, Michael



Rich Koshak

unread,
Sep 13, 2015, 10:56:49 AM9/13/15
to openhab
it is odd that it worked with knx but not with MQTT. The same code should be executed for both cases.

By "Doesn't work" do you mean that nothing gets sent on the MQTT topic or the wrong thing is sent?

Personally, I prefer to keep the declaratory code (Items) separate from the logic (Rules) so I would put this link into a rule. Though this is just a style choice and not any more or less correct.

Finally, this forum is in the ;process of closing down. Any further discussion or new posting should be done at the openHAB Community.

Rich

Michael Pophal

unread,
Sep 14, 2015, 3:54:58 AM9/14/15
to openhab
Hi Rich,

thanks for your answer. I like this compact item syntax and it works quite reliable. My rules-files are growing and so I want to save as many rules as possible.
To your question:
no mqtt message is being sent. Absolutely nothing happens at my broker, when I switch this item. I had expected it would and I can't see an obvoious mistake in my syntax.

Regards,
Michael

PS: meanwhile I opened a discussion at the openHAB Community, thanks again!

Rich Koshak

unread,
Sep 14, 2015, 10:15:55 AM9/14/15
to openhab
I'm guessing that the problem might be with the MQTT binding definition. I've found it to be a bit tricky to get working sometimes.

It looks right to me but I've never done an outgoing MQTT with "command" and I wonder if that might be a problem. Have you tried using "state" instead?

mqtt=">[mysensor:MyMQTT/23/3/V_LIGHT:state:ON:1], >[mysensor:MyMQTT/23/3/V_LIGHT:state:OFF:0]"

Rich
Reply all
Reply to author
Forward
0 new messages