Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95483

MQTT with SSL/TLS now working with Home Assistant

$
0
0

@fufs wrote:

Hi,

I’m trying to setup MQTT with Home assistant, but it doesn’t want to work. I’m running Mosquitto broker (not add-on) with configured SSL/TLS, but with require_certificate set to false, since I want encryption, but not necesserily having to hand out certificate files to each client. I have also set a username and password authentication. I have tested this with a mobile app and two devices, and all checks out good (I can publish something on one device and the other device that is subscribed to that topic receives the message).

In Home Assistant I have added this code to configuration.yaml

mqtt:
  broker: 192.168.0.245
  port: 8883
  username: !secret MQTT_user
  password: !secret MQTT_passwd
  tls_insecure: true

and respectively username and password to the secrets.yaml file.

Now here comes the weird part. In the mosquitto log I can see

New connection from 192.168.0.245 on port 8883.,

but when I try to publish something from the MQTT tab in the Developer Tools the value doesn’t change. The same goes, when I try to subscribe to a topic. When I publish to it from another device, Home assistant doesn’t see any changes. I can confirm that the message has been in fact published with the second device.

I also tried to add a binary sensor to confirm, that there is something work with this added to configuration.yaml

binary_sensor:
  - platform: mqtt
    name: "Test Sensor"
    state_topic: "Test/toggle"
    payload_on: "ON"
    payload_off: "OFF"
    unique_id: test_binary

but had no luck either.

I’m running Home Assistant 0.107.3 with Hass.io as a Docker Container on a Raspberry Pi 3 B+. My Python version is 3.7.6, not sure that it would change anything. The MQTT broker is running on the same machine. What am I doing wrong?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95483

Trending Articles