Hello,
I’m trying to connect Shelly through MQTT (mosquitto) with my HA (on Hass.io).
Below you can find log from mqtt mosquito
And also switch config from configuration.yaml
and from shelly configuration page
I cannot switch the relay, the button ingo HA turning on for 2 secs but nothing happened.
Any advices?
[09:05:20] INFO: Setup mosquitto configuration
[09:05:20] WARNING: SSL not enabled - No valid certs found!
[09:05:20] INFO: No local user available
[09:05:21] INFO: Initialize Hass.io Add-on services
[09:05:21] INFO: Initialize Home Assistant discovery
[09:05:21] INFO: Start Mosquitto daemon
1576742721: mosquitto version 1.6.3 starting
1576742721: Config loaded from /etc/mosquitto.conf.
1576742721: Loading plugin: /usr/share/mosquitto/auth-plug.so
1576742721: |-- *** auth-plug: startup
1576742721: ├── Username/password checking enabled.
1576742721: ├── TLS-PSK checking enabled.
1576742721: └── Extended authentication not enabled.
1576742721: Opening ipv4 listen socket on port 1883.
1576742721: Opening ipv6 listen socket on port 1883.
1576742721: Opening websockets listen socket on port 1884.
1576742721: Warning: Mosquitto should not be run as root/administrator.
1576742725: New connection from 172.30.32.1 on port 1883.
1576742726: Socket error on client <unknown>, disconnecting.
1576742726: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1576742726: New client connected from 172.30.32.1 as auto-2218411D-330D-3606-627F-84B79D7B2DDB (p2, c1, k60, u'homeassistant').
1576742740: New connection from 192.168.0.14 on port 1883.
[INFO] found hass on Home Assistant
1576742741: New client connected from 192.168.0.14 as shelly1-xxxxx (p2, c1, k60, u'hass').
1576742744: Socket error on client shelly1-B97AA2, disconnecting.
1576742746: New connection from 192.168.0.14 on port 1883.
1576742746: New client connected from 192.168.0.14 as shelly1-xxxxx (p2, c1, k60, u'hass').
If you aks me, don’t go that route.
The best way is the shelly discovery component. It will find the shelly devices automaticly.
Check this: Shellies Discovery Script
I tried it before (I mean shellies discovery script).
Relay was discovered, but…
problem was different - after each restart of HA - shellies was unavailable.
So that’s the reason why I removed device “automatically discovered” and start to figure out how to add this manually and make it work.
Just for the information I already tested for simple things Domoticz - relays, ESP sensors etc. It was very easy but … ugly. I like the way how HA works, but I need to learn a lot about this systems before I start to build my house.
O_o = I have correct quotiations something went wrong when pasted here.
According to switches i cannot use switchx instead of switch x because if I change i have fault - there is no integration switch4 etc.
I leave it like it was.
Neverthless… I create again automation scripts, remove mqtt from integrations. Reset whole system. And then it is working in both way - with REST method and MQTT manually added sensor and MQTT automatically discovered - MQTT work much faster so I will test both method for couple of weeks and will see …
Still I have no idea what was wrong…
I also added Access Control List to MQTT configs etc…