Mqtt 2.4 homie 3.0.1 autodiscovery

  • Platform information:
    • Hardware: raspberrypi 3
    • OS: openhabian
    • openHAB version: 2.4.0
  • Issue of the topic:

I coded a NodeMCU esp8266 with homie 3.0.1 (from bodiroga) and OH discovers only the top topic (with interval and another one), none of the different subtopics appear ?
I can create them myself with paperUI and they work properly but the autodiscovery mecanism doesn’t seem to work with this framework.
Do I miss something ?


Although we label specific snapshots as “stable” on the download page, please consider to use a more recent version. There were quite some problems in 2.4 that have been fixed for 2.5M1.

I’ve upgrade to OH 2.5.0 build 1521
Now I have this error message when autodiscovery my NodeMCU
Status: OFFLINE - COMMUNICATION_ERROR java.lang.IllegalArgumentException: ID segment ‘homie_buanderie02_temperature[]’ contains invalid characters. Each segment of the ID must match the pattern [A-Za-z0-9_-]*.
I use homie-array because I have 3 relays and 2 temperature probes connected to my NodeMCU

Yep, while OH 2.4 silently failed you’ll see a wonderful error in OH 2.5 ^^.
And now we know what went wrong. The Homie binding of OH never supported and will never support arrays. Those are actually removed from the Homie 4 specification because they are so flawed.

In your case you also don’t really need “arrays”. Just use node names with an increasing integer id.
The original purpose of arrays was hundreds of leds etc. But that never really worked for various reasons.

Cheers, David

Ok, I recode my Esp without any array and everything is working flawless.
One question though, can I format my temperature data in paperUI ? If yes, where ?
I have 2 decimals, and I prefer to have only one decimal.

Yes you can, from the example in the documentation:

Text item=LR_Temperature label="Livingroom [%.1f °C]"

Also check out these examples.