everything in angle brackets has to be your configuration. (e.g. <broker> should read your name of the broker.
Please feel free to come back, if further problems arise.
Hint:
Try to avoid a trailing “/” in your topic, this makes the main Level of your topic NULL, which makes it harder to use wildcards and other stuff, see:
I already have my broker up and running with other items. But this problem is that I can not insert {}][ in to my code, because it thinks it is a part of the code. Not the part I need to sent.
Is there a way to send a MQTT command in a string item or something else?
I tryed to make a string item, it works if I send a clean test message to the string w2811 from a rule or sitemap, but when I insert my code to the rule/sitemap or send it direct to the w2811 string it not work.
My OH2 log tell me there is a problem with my code because I use characters like these " } )( "
so it does not see the difference to the text I’m going to send and the code for the item/sitemaps/rules itself
rule sendMQTT
when
Item w2811 changed
then
w2811.sendCommand("{"state":"ON","color":{"r":255,"g":255,"b":255},"brightness":255,"effect":"confetti"}")
end
Writing JSON directly in the item configuration won’t work. I’m on my mobile, but you have to use a transformation (see my above link).
Basically you tell the transformation to fire and it will then send the JSON for you. Should work,I think. All the transformation had to do is to insert ON. And I guess OFF works the same way?