Hello
I use openhab for few years now i am on the way to update my system.
Openhab for me is a dream … i love the write my own configs / rules / scripts so i can integrate everything that i want to integrate … in the way i want
So for me Openhab is a real flexible system where you can do nearly everything but you have to invest some (little) time to learn how if you dont wont to spend this time and have fancy simple clicking ui it will be better to buy some out of the box system …
At the moment i switch from Mqtt 1.x to Mqtt2.x binding and wonder why it get so complicated (to get fancy ui integration) and dont forward the clean&easy way.
What did i mean:
Get an Item to communicate over MQTT:
MQTT 1.x:
- Config the MQTT Broker once:
mqtt1.url=tcp://localhost:1883
mqtt1.clientId=openhab
mqtt1.user=openhabian
mqtt1.pwd=xxx
- Get the Item / Items / Things etc. MQTT ready:
Switch LAB1 "Light" <light> (Licht, LAB) {mqtt=">[mqtt1:Licht:command:on:LAB1ON],>[mqtt1:Licht:command:off:LAB1OFF]"}
Done ! nice easy and clean in my point of view …
MQTT 2.x:
- Make a broker Thing (Bridge) (once):
Bridge mqtt:broker:WorkBroker "Work Broker" [ host="localhost", port="1883", secure=false, username="openhabian", password="ohmqtt", clientID="WORKOPENHAB24" ]
- Make Topic/Channel thing:
Thing mqtt:topic:WorkBroker:WorkSonoff "Work Sonoff" (mqtt:broker:WorkBroker) {
Channels:
Type switch : WorkLight "Work Light" [ stateTopic="stat/worklight/POWER", commandTopic="cmnd/worklight/POWER" ]
Type switch : WorkLightTele "Work Tele" [ stateTopic="tele/worklight/STATE", transformationPattern="JSONPATH:$.POWER" ]
}
- Make the item mqtt ready:
Switch Kitchen_Light "Kitchen Light" { channel="mqtt:topic:myUnsecureBroker:mything:lamp" }
So my questions:
Why i have to create a thing for channels when i only want to get a item to communicate over mqtt ? In the 1.x version it was only a one line code …
I dont want to expose the channel things in a sitemap for security why i have to / i am forced to ?
Example:
If i write the thing code like:
Thing mqtt:topic:WorkBroker:WorkSonoff "Work Sonoff" (mqtt:broker:WorkBroker) @ "mysitemap" {
The thing is exposed to the sitemap “mysitemap” this is ok.
When i write the code like:
Thing mqtt:topic:WorkBroker:WorkSonoff "Work Sonoff" (mqtt:broker:WorkBroker) {
The thing should not to be exposed to any sitemap but oh will create a new sitemap “Home” with the thing on it !?!?
I think this is realy bad … lets say i have a placeholder item this item should communicate over mqtt but not shown in a sitemap because i only use it in a rule/script as a trigger … why i should expose this to an sitemap ? or why i am forced to expose it ?
Thanks
Patrick