MQTT auto discovery

I am using auto discovery of MQTT on an Arilux LC06 running Tasmota. The device configuration in Tasmota is shown on the left.


The light control appears in the HA Overview panel. It provides control over brightness and rgb. The Tasmota console shows that the ON and OFF messages are being received. But when I try to address the device using the dev “publish a packet” service there is no response. I am new to MQTT so I am not sure of the correct message format and have tried countless variants such as
image
So while the basic setup of MQTT using the plugin in Hassio is working and Tasmota seems to have set up the configuration for the Arilux LC06 I do not have access to all of the parameters of the LC06 such as transition or colour temperature. These should be available for jason schemas.
Is this because I do not have the correctly formatted topic or could it be that auto discovery does not get all the parameters?
Can someone give me a few pointers please.

Try 0 or 1 as the payload… I don’t think you need to specify POWER in the payload…

1 Like

I think your payload just needs to be ‘off’ or ‘on’

Mine works below:

Also I think in your case the topic wold be

cmnd/office/rgb1/light/POWER

No the topic is right if he’s using discovery (which he is) and it agrees with Tasmota Setting.

On=1 and Off=0 and either should work

You are correct @DavidFW1960 :slight_smile: The first one I checked was a switch in the same room as me…running 5.11.1 with no mqtt discovery and manually added to HA :slight_smile:

I can confirm on my other devices running the dev 6.4.1.21 @DavidFW1960 is spot on

Thanks DavidFW1960 and markbajaj for such speedy help. I tried both the numeric and the alpha variants and neither worked. The “publish” button just changed its shade of blue. I will do some restarts etc. and try again.
Even without immediate success your information is very helpful as it gives me some assurance that I was on the right track.

@DavidFW1960 and @markbajaj. I have restarted HA and the Hassio plugin Mosquitto and looked at the Mosquitto log and Tasmota/LC06 console and am at a loss to understand much of what is going on. However, there are a few things to note:

  1. When I operate the light control in the HA frontend the MQTT message has a “Dimmer” prefix and not a “Power” prefix. See the first Mosquitto log below.
  2. There are a lot of “client id not available” messages.
  3. When I change the MQTT service message topic to “office/rgb1/light/cmnd/Dimmer” and payload to 100 I am still unable to get a message through to Mosquitto.

Mosquitto log when frontend light switch is turned on.

    1553057868: |-- aclcheck(mqttuser, office/rgb1/light/cmnd/Dimmer, 1) SUPERUSER=Y by http
    1553057868: |--  Cached  [EE533BC41CED25760EC4B30F797AC88EEAE15FA5] for (client id not available,mqttuser,1)
    1553057868: |-- mosquitto_auth_acl_check(..., client id not available, mqttuser, office/rgb1/light/ele/STATE, MOSQ_ACL_WRITE) 
    1553057868: |-- aclcheck(mqttuser, office/rgb1/light/tele/STATE, 2) CACHEDAUTH: 0
    1553057868: |-- mosquitto_auth_acl_check(..., client id not available, mqttuser, office/rgb1/light/tele/STATE, MOSQ_ACL_READ)
    1553057868: |-- aclcheck(mqttuser, office/rgb1/light/tele/STATE, 1) CACHEDAUTH: 0
    1553057868: |-- mosquitto_auth_acl_check(..., client id not available, mqttuser, office/rgb1/light/stat/RESULT, MOSQ_ACL_WRITE)
    1553057868: |-- url=http://127.0.0.1:8080/superuser
    1553057868: |-- data=username=mqttuser&password=&topic=&acc=-1&clientid=
    1553057868: |-- aclcheck(mqttuser, office/rgb1/light/stat/RESULT, 2) SUPERUSER=Y by http
    1553057868: |--  Cached  [891AD6414C31D69AE4F4924A1DC2A606A5EB15AC] for (client id not available,mqttuser,2)

Mosquitto log when MQTT service called with office/rgb1/light/cmnd/POWER

1553058908: |-- mosquitto_auth_acl_check(..., client id not available, mqttuser, "office/rgb1/light/cmnd/POWER", MOSQ_ACL_WRITE)
1553058908: |-- url=http://127.0.0.1:8080/superuser
1553058908: |-- data=username=mqttuser&password=&topic=&acc=-1&clientid=
1553058908: |-- aclcheck(mqttuser, "office/rgb1/light/cmnd/POWER", 2) SUPERUSER=Y by http
1553058908: |--  Cached  [1EC27EE8CE20552177EFB8797C2C313E25FAD074] for (client id not available,mqttuser,2)

Mosquitto log when MQTT seervice called with office/rgb1/light/cmnd/Dimmer and value of 100

1553071029: |-- mosquitto_auth_acl_check(..., client id not available, mqttuser, "office/rgb1/light/cmnd/Dimmer", MOSQ_ACL_WRITE)
1553071029: |-- url=http://127.0.0.1:8080/superuser
1553071029: |-- data=username=mqttuser&password=&topic=&acc=-1&clientid=
1553071029: |-- aclcheck(mqttuser, "office/rgb1/light/cmnd/Dimmer", 2) SUPERUSER=Y by http
1553071029: |--  Cached  [E6076F22AD6774C0D5FD97A0AE3F8D23EA774EB3] for (client id not available,mqttuser,2)
1553071037: |-- mosquitto_auth_acl_check(..., client id not available, mqttuser, "office/rgb1/light/cmnd/Dimmer", MOSQ_ACL_WRITE)
1553071037: |-- aclcheck(mqttuser, "office/rgb1/light/cmnd/Dimmer", 2) CACHEDAUTH: 0
1553071047: |-- mosquitto_auth_acl_check(..., client id not available, mqttuser, "office/rgb1/light/cmnd/Dimmer", MOSQ_ACL_WRITE)
1553071047: |-- aclcheck(mqttuser, "office/rgb1/light/cmnd/Dimmer", 2) CACHEDAUTH: 0
1553071296: |-- mosquitto_auth_acl_check(..., client id not available, mqttuser, office/rgb1/light/tele/STATE, MOSQ_ACL_WRITE)
1553071296: |-- aclcheck(mqttuser, office/rgb1/light/tele/STATE, 2) CACHEDAUTH: 0
1553071296: |-- mosquitto_auth_acl_check(..., client id not available, mqttuser, office/rgb1/light/tele/STATE, MOSQ_ACL_READ)
1553071296: |-- aclcheck(mqttuser, office/rgb1/light/tele/STATE, 1) CACHEDAUTH: 0

Well, I finally got the “Publish a packet” service to work!
It was with the following
topic: office/rgb1/light/cmnd/Dimmer
Payload (template allowed): 100
The trick was to leave the quotes off the topic.

Getting MQTT working reminds me of a computer game I used to play a couple of decades ago called Kings Quest IV. One had to wander around the landscape clicking on obscure objects in the hope that one of them would be the magic button to open some hole in the mountain leading on to the next challenge. Of course, with Home Assistant I have to appreciate that a lot of expertise is necessary to play the game competently and I do value the extensive help that I get from those further down the track.
Thanks @DavidFW1960 and @markbajaj.

2 Likes