I have a Smart Meter (AMS) I want to read meter values from to use in Energy. I have a reader from OSS (oss.no) which has an API which also provides me access to their MQTT broker with the data.
I want to connect to the MQTT broker, but have not been able to configure this in Home Assistant.
I have been able to connect using MQTT Explorer using the following details:
mqtt://mqtt.oss.no Port: 8883 Username: my e-mail Password: My public token Encyption (tls): enabled (true) Validate certiicate: disabled (false)
If I add the details in Home Assistant I am not able to make any configuration to add Encryption (tls). I just get an error message from HA (“Failed to connect”). I assume this is because I have not enabled Encryption.
I have tried to add “auto” as described here: MQTT Certificate - Home Assistant
# Example configuration.yaml entry mqtt: certificate: 'auto'
However, this did not help.
I have also tried to generate my own ca.crt and ca.key as described here: [solved] MQTT with SSL/TLS not working with Home Assistant - #11 by fufs
- Create CA private key (recommended to create password)
$ openssl genrsa -des3 -out ca.key 2048
- Generate CA certificate (valid for 20 years)
$ openssl req -new -x509 -days 7300 -key ca.key -out ca.crt
I have added this to my ssl folder with the below configuration:
mqtt: client_cert: /ssl/ca.crt client_key: /ssl/ca.key
This did not help. either…
I am a bit lost. Anyone know how I can connect to the broker from HA?
PS! Just to be clear, I do not need to specify any certs or keys when connect using MQTT Explorer, but if I enable the “Validate certificate” I get an error…