NEWBIE MQTT Config Help Needed

Please note, I have little to no experience in coding/programming.

I am at my wits end with trying to configure MQTT. I’ve read and been trying for the past week to no avail, and I think I’m suffering from information overload as there is so much content out there. I think it’s time to reach out for help

My objective is pretty simple at this stage: I’m trying to automate a few lights home. Been using the Phillips Hue system for years on a few lights, but I’m trying to take it one step further to smart switches.

I have openhabian running on a RPi3B+, with the embedded MQTT broker configured and “running”. Trying to set up MQTT on a Gosund Smart WIFI Switch that has been flashed with Tasmota.
Was following this guide (https://www.openhab.org/blog/2018-12-16-mqtt-arrives-in-the-modern-openhab-2-x-architecture.html) for the MQTT config but I’m not getting any response from the switch.

I’m able to subscribe to topics via MQTTfx on my Mac and when I toggle the switch, either manually or via the Sonoff web UI I am seeing the changes of state.

  • Platform information:

    • Hardware: Raspberry Pi 3B+
    • OS: openhabian
  • Issue of the topic: MQTT Configuration Nightmare?

PS: Yesterday I did a fresh installation of openhabian, and I’m open to doing it again and starting from the very beginning to get this working.

Can you please load your configs

Which configs do you need? .items and mqtt?

Yes your Items and mqtt.
have you checked your log for errors ?

.items file

Group Home “home” [“Building”]

Group OU “Outside” (Home) [“Outdoor”]
Group GF “Ground Floor” (Home) [“GroundFloor”]
Group FF “First Floor” (Home) [“FirstFloor”]

Group OU_FrontYard “Front Yard” (Home, OU) [“Garden”]
Group OU_Driveway “Driveway” (Home, OU) [“Outdoor”]
Group OU_Garage “Garage” (Home, OU) [“Garage”]
Group GF_LivingRoom “Living Room” (Home, GF) [“LivingRoom”]
Group GF_Kitchen “Kitchen” (Home, GF) [“Kitchen”]
Group GF_Dining “Dining” (Home, GF) [“Room”]
Group FF_Bedroom “Bedroom” (Home, FF) [“Bedroom”]
Group FF_LivingRoom “Living Room” (Home, FF) [“LivingRoom”]
Group FF_MasterBedroom “Master Bedroom” <bedroom_red> (Home, FF) [“Bedroom”]

Switch OU_FrontYard_Light “Light” (OU_FrontYard, gLight) [“Lighting”, “Switchable”] {channel=""}
Switch OU_Driveway_Light “Light” (OU_Driveway, gLight) [“Lighting”, “Switchable”] {channel=""}
Switch OU_Garage_Light “Light” (OU_Garage, gLight) [“Lighting”, “Switchable”] {channel=""}
Switch GF_LivingRoom_Light “Light” (GF_LivingRoom, gLight) [“Lighting”, “Switchable”] {channel=""}
Switch GF_Kitchen_Light “Light” (GF_Kitchen, gLight) [“Lighting”, “Switchable”] {channel=""}
Switch GF_Dining_Light “Light” (GF_Dining, gLight) [“Lighting”, “Switchable”] {channel=""}
Switch FF_Bedroom_Light “Light” (FF_Bedroom, gLight) [“Lighting”, “Switchable”] {channel=""}
Switch FF_LivingRoom_Light “Light” (FF_LivingRoom, gLight) [“Lighting”, “Switchable”] {channel=""}
Switch FF_MasterBedroom_Light “Light” (FF_MasterBedroom, gLight) [“Lighting”, “Switchable”] {channel=""}

Group:Switch:OR(ON, OFF) gLight “Light” (Home) [“Lighting”, “Switchable”]

Not sure the file path for the mqtt config

The most relevant entry in the log output was:

2019-02-04 08:32:43.097 [WARN ] [nal.handler.AbstractMQTTThingHandler] - Channel test not supported

I can copy the entire log output if necessary.

I used Homebuilder to create the items file. I then tried to create the item and thing in Paper UI, got as far as Generic MQTT Thing and created a channel for it…

Your Item :

Switch OU_FrontYard_Light “Light” (OU_FrontYard, gLight) [“Lighting”, “Switchable”] {channel=""}

My Item :

Switch   FamilyRoom_Light         "Light"         <light>         (FamilyRoom, gLight)            {mqtt=">[flatcntr:LeefVertrek/relay/0/set:command:*:MAP(OFF0ON1.map)],<[flatcntr:LeefVertrek/relay/0:state:MAP(0OFF1ON.map)]"}
Switch   FamilyRoom_Pargola_Light        "Pargola Light"         <light>         (FamilyRoom, gLight)  {mqtt=">[flatcntr:LeefVertrek/relay/2/set:command:*:MAP(OFF0ON1.map)],<[flatcntr:LeefVertrek/relay/2:state:MAP(0OFF1ON.map)]"}
Switch   FamilyRoom_Fan           "Fan"           <fan_ceiling>   (FamilyRoom, gFan)              {mqtt=">[flatcntr:LeefVertrek/relay/1/set:command:*:MAP(OFF01ON.map)],<[flatcntr:LeefVertrek/relay/1:state:MAP(0OFF1ON.map)]"}
Number   FamilyRoom_Temperature   "Temperature"   <temperature>   (FamilyRoom, gTemperature)

On paper does your MQTT show online ?

all my mqtt is setup in text based. I don’t use the embedded MQTT broker.

On paper does your MQTT show online ?

Yes, it’s online.

WatchOut!
@joashmgn you have most probably installed MQTT2.4 however @allen is posting items Setup for MQTT1! The Setup is totaly differnt!!

all my mqtt is setup in text based. I don’t use the embedded MQTT broker.

I’m open to doing it that way.

My Item :

Switch   FamilyRoom_Light         "Light"         <light>         (FamilyRoom, gLight)            {mqtt=">[flatcntr:LeefVertrek/relay/0/set:command:*:MAP(OFF0ON1.map)],<[flatcntr:LeefVertrek/relay/0:state:MAP(0OFF1ON.map)]"}
Switch   FamilyRoom_Pargola_Light        "Pargola Light"         <light>         (FamilyRoom, gLight)  {mqtt=">[flatcntr:LeefVertrek/relay/2/set:command:*:MAP(OFF0ON1.map)],<[flatcntr:LeefVertrek/relay/2:state:MAP(0OFF1ON.map)]"}
Switch   FamilyRoom_Fan           "Fan"           <fan_ceiling>   (FamilyRoom, gFan)              {mqtt=">[flatcntr:LeefVertrek/relay/1/set:command:*:MAP(OFF01ON.map)],<[flatcntr:LeefVertrek/relay/1:state:MAP(0OFF1ON.map)]"}
Number   FamilyRoom_Temperature   "Temperature"   <temperature>   (FamilyRoom, gTemperature)

If I understand what you’re saying here, I need to update the channel on the item file to reflect the channel I’ve set in the Generic MQTT Thing?

WatchOut!
@joashmgn you have most probably installed MQTT2.4 however @allen is posting items Setup for MQTT1 ! The Setup is totaly differnt!!

I do have MQTT2.4 installed

yes I am running mqtt1. I battled with 2.4. maybe I can get mine to run as well . :sweat_smile:

have a look at the following Post.

@allen I’ll have a look, but that may lead to more information overload. I’ve been going at this for a while, and my limited experience doesn’t allow me to intuitively see what I need to change to suit my needs.

Suggestion, I/we could walk you through the setup of one of your sonoff switches, that way you should be able to do the others.
Please state which way you prefer, setup via PaperUi or via files?
Please show a screenshot showing the mqtt page of one sonoff switch.

P.S. Sorry for the short and abrupt answer earlier, I had to an oncoming appointment.

I’d greatly appreciate the help @opus.

Based on all the reading I’ve done the files option would be the better way as it will give me the most control, not so?

Both give you the same control! Take your pick, post the screenshot and I’ll write you through later tonight.

Let’s go with files.

I’ll probably try to replicate the process afterwards in PaperUI for another one of the switches just to see if/how it will work.

Here’s the screenshot:

Apparently I’m at my daily limit for replies as a new user but I’ll follow along any instructions given later tonight.