Mycroft, raspbian, mqtt, switch - almost there!

Hi! I tried to figure it out by reading lots of threads here but It seems I missed the last clue.
What I did:

  • installed Openhabian on a raspi 4
  • installed picroft on an other raspi 3
  • got mycroft to work with respeaker 2 (finaly…)
  • followed a yt-tutorial for getting a simple plug-switch (dlock) to work with openhabian via mqtt broker. I can switch it on/of via Paper UI-Control
  • installed the openhabian-skill in mycroft
  • mycroft can communicate with openhabian, confirmed
  • I read, that mycroft needs “tags” to find items
  • read here somewhere, that Paper-Ui puts Items in a jsondb in /var/lib/openhab2/jsondb/ that I should not edit
  • I found out that i can write items by hand and put them in /etc/openhab2/items/
  • tried to write the item myself
  • mycroft finds my item when asking mycroft for the itmes list

her comes the trouble:

  • It seems, I did something wrong writing the switch.itmes. The handwritten item does not show up in openhabian-Configuration-Things

So, for me there seem to be two possible ways:

  1. let mycroft find the already working item somehow
  2. let openhabian find the item already found by mycroft.

Can someone help, please? (Btw: I am absolutely beginner with openhabian and proud that there is already working something at all :grinning:)


Switch Light "Light" ["Switchable"] { mqtt=">[broker:cmnd/delock/POWER:command:*:default], <[broker:stat/delock/POWER:state:default]" }

It looks like you are using the mqtt version 1 syntax in the item definition, version 2 syntax would look like:

Switch Light "Light" ["Switchable"] {channel"..."}
You can copy the missing part (…) from the corresponding channel in PaperUI (there is a button to copy channel definition, see the red arrow in the picture).

First some nomenclature.

The home automation software is called “openHAB”. The SD card image and series of scripts that install and configure openHAB and a bunch of other stuff on a stock Raspbian OS image is called “openHABian.” The distinction will become important in the future as you post additional requests for help.

Now to your problem. What’s in your logs? Problems loading your .items files will show up in the logs.

Did you delete the Items from PaperUI before recreating them in your .items files? All Items must have a unique name.

It’s not impossible to add tags to Items for Items stored in the JSONDB without manually editing the JSONDB files. Install the REST API Docs (under UIs in PaperUI), open up the Items line and you will find two end points to add and remove tags on Items near the bottom of the list. You can execute a call to those end points right there in the docs so you can add or remove the tags manually there.

NOTE: OH 3’s new replacement for PaperUI lets you set tags through the UI.

Take note of Jürgen’s reply. You are likely using the MQTT 2.5 binding but you are trying to apply the MQTT 1.x syntax to your Item and that won’t work. But you say that you got the plug to work with MQTT so perhaps you are using the MQTT 1.x binding after all? If so you might consider switching over now as in OH 3 there will not be support for 1.x bindings and the effort to move is low for you now as you’ve only the one Item (or just a few Items).

One other thing to note is if you are indeed using the MQTT 1.x binding, nothing related to that binding beyond installation will appear in PaperUI. The control tab in PaperUI will only show those Items linked to 2.x version binding’s Thing’s Channels. So it might be working but if you are looking in the Control tab you wouldn’t see the Item.

Thanks a lot you both! I finaly figured it out! I succesfully combined your suggestions.

I am using MQTT 2.5. But I followed these Instructions. I had not seen those far below.