Dear all,
After having them laying around for quite a while, it was time to get a Shelly 1 and 2.5 working with HASSIO.
To do so, I added the Mosquitto add-on in HASSIO with the following configuration:
{
"logins": [],
"anonymous": false,
"customize": {
"active": false,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"require_certificate": false
}
I created a user in the user configuration panel used by Mosquitto.
My configuration.yaml has the following line:
mqtt:
broker: 192.168.0.62
The log of the Mosquitto add-on shows:
1576357458: New connection from 192.168.0.70 on port 1883.
[INFO] found mqtt on Home Assistant
1576357460: New client connected from 192.168.0.70 as mqtt-explorer-0fd101d3 (p2, c1, k60, u'mqtt').
1576357473: New connection from 192.168.0.64 on port 1883.
1576357473: New client connected from 192.168.0.64 as shelly1-E2D346 (p2, c1, k60, u'mqtt').
1576358161: New connection from 192.168.0.62 on port 1883.
1576358161: Socket error on client <unknown>, disconnecting.
I installed MQTT explorer to monitor the Shelly and Broker. When I change the Shelly relay via the web interface I can see the result in MQTT explorer. My conclusion, Shelly is working…
Now I’ve created 2 additional switches in configuration.yaml
switch:
- platform: mqtt
name: "terrace_outlet"
command_topic: "shellies/shelly1-E2D346/relay/0/command"
state_topic: "shellies/shelly1-E2D346/relay/0"
payload_on: 'on'
payload_off: 'off'
retain: true
- platform: rest
name: "terrace_rest"
scan_interval: 5
resource: http://192.168.0.64/relay/0
body_on: 'turn_on'
body_off: 'turn_off'
is_on_template: '{{ value_json == true }}'
headers:
Content-Type: application/x-www-form-urlencoded
One is via MQTT the other via RESTful, now the real issues…
Neither of the switches are shown in the developer tools’ state view??? Anyone got any idea here?
If I try to push the MQTT command via developer tools MQTT
shellies/shelly1-E2D346/relay/0/command
With payload: on the shelly does not respond. Anyone an idea here???
Basically I want the original firmware which works with RESTful and MQTT running in HASSIO. It took me already way too long to figure it out with YouTube manuals and Shelly documentation.
According to MQTT explorer my login is correct (it can connect) and Shelly is shown there.
I have the feeling there is a mistake somewhere in HASS, because I don’t see added entities as well.