I have a centralized Home Assistant running inside a Docker Container that controls 4 remote locations using MQTT. The Shelly 1 switch on my dashboard is greyed out and is unavailable under the Entities category.
I tested the MQTT connection and it’s connected as shown:
{
"wifi_sta": {
"connected": true,
"ssid": "****************",
"ip": "*****************",
"rssi": -62
},
"cloud": {
"enabled": false,
"connected": false
},
"mqtt": {
"connected": true
...
}
Under the Home Assistant Web Settings > Entities, I see the switch but it has a red mark under the status column and is showing “Unavailable”.
The configuration file for the switch:
# MQTT Devices
mqtt:
- switch:
unique_id: bathroom_light
name: "Bathroom Light"
state_topic: "shellies/shelly1-**************/relay/0"
command_topic: "shellies/shelly1-**************/relay/0/command"
availability:
- topic: "shellies/shelly1-**************/online"
payload_on: "ON"
payload_off: "OFF"
payload_available: "true"
payload_not_available: "false"
retain: true
qos: 1
When I log directly into the local Shelly web interface and press the on/off button, I can see the recorded MQTT logs on my remote home assistant server. This tells me that it’s talking to the server and the message exchange works.
Message 21 received on shellies/shelly1-**************/relay/0 at 8:27 PM:
off
QoS: 1 - Retain: false
Message 20 received on shellies/shelly1-**************/relay/0 at 8:26 PM:
on
I also tried restarting the Home Assistant and MQTT containers but no luck.
Am I missing something? I used to be able to control the switch from the dashboard before but it stopped working. I don’t recall doing any updates to my Home Assistant server.