[SOLVED] Architectural question: openHab / ZigBee & Z-Wave / MQTT / Red Node - Route MQTT to Things

Hi all,

first of all, thanks for the amazing work you’re doing.
To clarify, I’m digging experienced in it topics, but new into IoT and home automation.
I want to share my experiences here with beginners.

I’ve defined my requirerings as as following:

  1. Flexibility for including any kind devices (ai, voice, protocols, extensibility, etc.)
  2. Open & living system
  3. Mostly graphical configuration
  4. Programmable rulings

These requireings answered:

  • Flexibility for including any kind devices (protocols, extensibility, etc.)
    This was mainly about to get introduced into what kind of devices the market offers and how they differentiate frome implementing perspective.
    To break it down: There are mainly two protocols implemented by the market - and some other mehtods i won’t mention here. The main protocols are Zigbee and Z-Wave. Both have different advantages and disadvantages.
    Hadware: This leads to a zigbee hub and/oror z-wave hub. Or a device (here raspberry) with an usb stick.
    (For more info check https://www.the-ambient.com/guides/zigbee-vs-z-wave-298 and
    https://www.postscapes.com/internet-of-things-protocols/ )
    Solution to be open: There is a stick called HUSBZB-1 which supports both protocols (I’ve ordered, not yet arrived, but should work with OH referring different threads here).

  • Open & living system & Mostly graphical configuration
    This led to domotics, home assistant and openHAB.
    I’ve choosen openHAB because of the graphical interfaces, I am already familliar with java and this seems to fits best for me. Obviously for you too. :wink:

  • Programmable rulings
    This topic led me to node red, which comes in handy because everybody who created workflows or processes somewhere feels familiar quite fast and the possibilites are endless.

After a couple of investigation this lead to the following architecture for this setup:
image

Long introduction, here’s what I am trying and where i fail

  • Set up openHAB as a MQTT Router using PaperUI, which passes MQTT to other things.

What I’ve tried using binding-mqtt-2.4.0:

  • Created MQTT Broker
  • Created Generic MQTT Thing
  • Added channel, created an Item and linked them
  • Can successfully connect from Node Red via mosquitto and publish to openHAB.

Except for the following error message everything works:
2019-01-14 13:07:42.658 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to ‘127.0.0.1’. Next attempt in 10000ms

From my understanding this should work like this:
Node Red --> MQTT --> openHAB MQTT thing --> Other thing (using different binding)

My problem: I can’t link the brightness of my bulb (here: IKEA TRADFRI using IKEA Gateway) to the newly created item that is linked to the MQTT thing.

  • Am i completely wrong with the direction where this setup is leading to?
  • Am i misunderstanding something completely wrong?
  • Is there a best practice to configure these things?
  • I’m aware that a lot of *2mqtt sources exists, but i want to keep the entry point central to openHAB

Screenshots of the paperui configuration can be posted, if requested (currently limited to one picture per post).

  • Platform information:
    • Hardware: Raspberry PI 3 Model B
    • OS: openhabian
    • Java Runtime Environment: Zulu
    • openHAB version: 2.4.0.

Thanks in advance and best regards,
LaSchmu

Your architecture is possible and you can even stay on the UI for everything.
What you want to do is to disable “Simple mode” in Paper UI so that no Items are created automatically for you.

Then you link your MQTT channel (percentage channel) to an Item and your Tradfri Brightness channel to the same item. The MQTT channel should have the “post command” configuration set to true.

Cheers, David

1 Like

I agree it’s a possible setup but I don’t really see the value of the MQTT layer between OH and Node Red. If all your items are in OH bindings you are probably better of using the Node red OH integration. https://flows.nodered.org/node/node-red-contrib-openhab2

Works great, your MQTT is just another layer. You can still link in non OH components through MQTT (I do this as well) but for OH items I don’t see the value of it.

@David_Graeff Thank you, had already disabled the simple mode.
I was missing the detail that MQTT needs to be percentage to be represented as dimmer.

What do you mean with “post command”? I just found an option “Is command” for switches.
Therefore I recognized that it’s necessary need to set the profile to system:follow Did you meant this?

@rswennen Probably there is no value right now in having the MQTT layer. This is more my personal it-nerd-consultant-fetish to have a clear architecture using standards if possible, without “proprietary” add ins like the OH-palette. I appreciate that hint anyway.