Smart Life via MQTT

Hi there,

I installed openhab last week and tried to configure my first things I already own for years, which are smart life switches and plugs. I googled a few things and tutorials but found out thatz they are not working anymore.
I´ve installed oh on a raspi 3.
But now I´m a bit confused. I found out that I need mqtt, but I just find the mqtt binding, no broker etc.
on the paper ui.
I tried to follow discussions here but I got more and more confused, maybe someone can help me get the right order of installing bindings brokers …

Thankyou very much in advance, I hope sometime I can give the right answers to someone else needing help

Neuron

First of all, openHAB itself isn’t a broker or something, it just works with services, which are exposed to openHAB.
That out of the way, you have two main options:

after having a broker you can then decide to use the http-binding (recommended is the 2.x binding, as it is compatible with upcoming openHAB3): https://www.openhab.org/addons/bindings/mqtt/#mqtt-binding

Which version of openHAB have you istalled

This is the recommended way of installing on a pi

You’ve had good answers already from openHAB’s MQTT professionals. Here’s the order I would recommend:

Outside of openHAB

  1. Install Mosquitto MQTT broker
  2. Install MQTT Explorer or mqtt.fx.
  3. Connect your Smart Life devices to the newly installed Mosquitto broker.
  4. Open MQTT Explorer or mqtt.fx, connect it to your Mosquitto broker, and watch to make sure your Smart Life devices are sending the messages you expect.

Once that is all working:

Inside openHAB

  1. Install the MQTT V2 binding
  2. Create a Bridge Thing to your Mosquitto broker.
  3. Create a Topic Thing (or Generic MQTT Thing), referenced to your Bridge Thing, for each Smart Life device.
  4. Create a Channel within your Topic Thing for each property of your device (temperature reading, switch etc). Here you subscribe to the topics which you will have seen in MQTT Explorer or mqtt.fx.
  5. Create an Item attached to your Channel.
  6. Do whatever you want with your Item: add it to your Sitemap, or use it in a rule…
1 Like

hi evryone,

overwhelming fast answers, thankyou

I´ve got the 2.5.11-1 openhab release installed on my raspi 3b
I have read the mqtt notes of David Graeff
https://www.openhab.org/blog/2018-12-16-mqtt-arrives-in-the-modern-openhab-2-x-architecture.html

All you have to do is, installing the addon in Paper UI to have a working MQTT broker, ready to use.

You can optionally configure the embedded broker in the service section of PaperUI (or via text files as usual):

Is that wrong? So I have to switch to mosquito?

I thought it could be done on the paper ui…
but there I cant find it…

It’s not wrong, but that blog post is two years old. In the meantime the project that the embedded broker is based on, Moquette, is no longer maintained, so in order to future proof your setup it is now recommended to use a 3rd party MQTT broker like Mosquitto.

alright.
Then I start with mosquitto outside openhab and try to get the messages…
Thankyou very much so far

1 Like

Hello again,

now I have mosquitto installed via openhabian-config and running, MQTT Explorer installed on windows running and connected…
Now I need to connect my “Teckin” plugs and switch to mosq…

I have no idea…
But I found a thread, maybe I proceed there?

https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md

Thanks in advance for your replies

No, I dont understand that manual either…

Go to Cloud -> Project and click the project you created earlier. Then click “Link Device”. Click the “Linked Devices by App Account” tab.
Click “Link devices by App Account” and scan the QR code from your smart phone/tablet app by going to the ‘Me’ tab in the app, and tapping a QR code / Scan button in the upper right. Your account will now be linked.

Well, somehow I have to connect trhe devices to mosquitto, instead of connecting them to the smartlife app…
so I need to get the devices in connection mode and then I need to make mosquitto connect to the devices…with mqtt explorer`? or do I have to command mosquitto to connect?!

Thankyou…I feel like in primary school

lol Neuron

This might help you out, take a look.
Tuya devices use either Smart Life app or Tuya Smart app.

You need to setup your device to connect to Mosquitto - you tell your device where it can find Mosquitto, and it will connect. You don’t tell Mosquitto where to find your device.

@Zoltan_Rokk has provided a link which may help you with your device. I don’t have any ‘Teckin’ brand devices, but if it is compatible with Tuya Convert I understand the process is fairly simple.

thankyou very much @Zoltan_Rokk & @hafniumzinc

I am working through it tomorrow, since I have just one micro sd card with openhab…
I hope my teckin works. I already read that the newer ones have a realtek chip working that is not compatible with flashing to tasmota.
I´ll work it out.
We´ll see

I tried my two teckin plugs to flash with tasmota. But it seems they are not flashable.
Looks as there are no ESP chips built into mine.
But since they are connectable via smartlife there could be some other way to get them into openhab?

Is there any source where I can find switches plugs etc working with openhab?
I´d like to have a multi switch with a few more ports…5 or 6?!
`
Thankyou

Look to see if there is a template available

My plugs are listed but with the comment that

NOTICE!!! Manufacturer has started using unsupported non-ESP8266 chips recently and this device might not be compatible anymore

But I ment in general…
Are there favourite type of switches to use via openhab…etc…
Is there a database of good or most likely to use parts to use when you want to use them with openhab?
So I would like to start with some working parts since <i just have a few things so far that are working via smartlife I might replace these and get more stuff that I can control via oh…

thanks and merry xmas

Neuron