Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Problems with sample MQTT configuration #255

Open
Nobodi99 opened this issue Oct 22, 2018 · 3 comments
Open

Problems with sample MQTT configuration #255

Nobodi99 opened this issue Oct 22, 2018 · 3 comments

Comments

@Nobodi99
Copy link

Nobodi99 commented Oct 22, 2018

While implementing the certification into the mqtt connection I stumbled over a problem I can't seem to fix.

When using auto-discovery I can control the LEDs how ever I like. The only thing missing would be a speed option.

But when I use the normal mqtt with pubsubclient I encounter problems.
Since I'm not that experienced with the homeassistant configurations and automations I thought I will just use the sample provided in the wiki.

First thing I figured out was that the topics in there are wrong.
They are actually just "hostname/in" and "hostname/out".

The other problem I have is that I can see the controller receiving the "ON" command by using the serial monitor in Arduino but nothing happens.
The switch in homeassistant is just turning back to its "OFF" position shortly after turning it on.
But no "OFF" command is sent either...

How could I fix that?

@debsahu
Copy link
Collaborator

debsahu commented Oct 23, 2018

There is no option for mqtt json lights in HA for speed. Check this file to see how speed can be implemented.

HA's MQTT topics ( https://github.com/toblum/McLighting/wiki/Homeassistant-integration ) and regular MQTT ( https://github.com/toblum/McLighting/wiki/MQTT-API ) are in different topics. They work differently and everything is documented in wiki.

Using PubSubClient, will only send messages with size maximum of 128 characters, Async MQTT can do 3-4kB data. Async MQTT can do TLS v1.1, but you have to use Platformio for compilation with appropriate flags. See here for more info on how to achieve that.

Regarding the switch turning off automatically, one needs to have appropriate state MQTT topic to inform HA that the light has read the sent message. I can write the TLS/SSL portion, but you will need to give me some time. I don't have a spare mosquitto MQTT server to try TLS/SSL stuff.

@debsahu
Copy link
Collaborator

debsahu commented Nov 18, 2018

I was able to get SSL/TLSv1.2 2-way handshake to work on ESP8266 and ESP32 https://github.com/debsahu/ESP_MQTT_Secure . I will close this issue after creating a PR with adding secure MQTT connections to McLighting! Please follow through the instructions (ESP8266 specific parts) to securing the MQTT connection.

@sehraf
Copy link

sehraf commented Jun 23, 2019

Any update on this?
TLS support for amqtt: #425

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants