eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 783 forks source link

[MQTT] Update ReadMe #6711

Closed JueBag closed 5 years ago

JueBag commented 5 years ago

Corrected Item syntax and added a note about the difference syntax when creating the things via PaperUI or files.

Signed-off-by: Juergen Baginski opus42@gmx.de

JueBag commented 5 years ago

Second try, same result :-(

Again, I'm out of clues what is wrong AND how to overcome!

yozik04 commented 5 years ago

In my setup channel should be without broker. This is the only way it works.

mqtt:topic::

Switch Kitchen_Light "Kitchen Light" {channel="mqtt:topic:mything:lamp" }
Rollershutter shutter "Blind" {channel="mqtt:topic:mything:blind" }
yozik04 commented 5 years ago
Bridge mqtt:broker:myUnsecureBroker [ host="192.168.0.42", secure=false ]
{
    Thing mqtt:topic:mything {
Channels:
        Type switch : lamp "Kitchen Lamp" [ stateTopic="lamp/enabled", commandTopic="lamp/enabled/set" ]
        Type switch : fancylamp "Fancy Lamp" [ stateTopic="fancy/lamp/state", commandTopic="fancy/lamp/command", on="i-am-on", off="i-am-off" ]
        Type string : alarmpanel "Alarm system" [ stateTopic="alarm/panel/state", commandTopic="alarm/panel/set", allowedStates="ARMED_HOME,ARMED_AWAY,UNARMED" ]
        Type color : lampcolor "Kitchen Lamp color" [ stateTopic="lamp/color", commandTopic="lamp/color/set", rgb=true ]
        Type dimmer : blind "Blind" [ stateTopic="blind/state", commandTopic="blind/set", min=0, max=5, step=1 ]
    }
}

And thing must be defined via: Thing mqtt:topic:mything

yozik04 commented 5 years ago

But if you define Thing topic mything

Then Items will need include broker in channel: channel="mqtt:topic:myUnsecureBroker:mything:blind"

JueBag commented 5 years ago

@yozik04 : The question is which way to define the broker and device did you use. My findings were that you need to specify the broker in the channel definition, if both were created via file. However I only checked with things created by the Thing topic mything syntax, using Thing mqtt:topic:mything it worked as you describe!

I'm not sure anymore what to put into the readme!

openhab-bot commented 5 years ago

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/channel-syntax-differences/60759/4

JueBag commented 5 years ago

The Readme seems to be updated otherwise. The discussion about the different ways to thing can be defined has to be discussed elsewhere. Closing this PR.