Shelly factory firmware configuration with Home Assistant

Hi everyone,

I have been trying to use shelly 1 and shelly 2 with shelly’s factory firmware but just am unable to to get connected. Here is what the MQTT log says. “-- mosquitto_auth_acl_check(…, client id not available, konnect, shellies/shelly1-xxxxxx/input/0, MOSQ_ACL_WRITE)
1555499182: |-- aclcheck(konnect, shellies/shelly1-xxxxxx/input/0, 2) CACHEDAUTH: 0”

And here is my configuration.yaml entry, "

  • platform: mqtt
    name: “S-Light”
    command_topic: “shellies/shelly1-xxxxxx/relay/0”
    state_topic: “shellies/shelly1-xxxxxx/relay/0/command”
    payload_on: “ON”
    payload_off: “OFF”
    retain: true
    Would appreciate assistance. Do not know where I went wrong.

Hi @piratedpearl

I suggest you to use the </> button to mark everything is a code otherwise would be difficult for other to understand it.

Supposing you showed a Shelly 1 as switch, this is my working configuration

  - platform: mqtt
    name: "Shelly1_1"
    state_topic: "shellies/shelly1-xxxxxx/relay/0"
    command_topic: "shellies/shelly1-xxxxxx/relay/0/command"
    payload_on: "on"
    payload_off: "off"
    state_on: "on"
    state_off: "off"
    optimistic: false
    qos: 0
    retain: false

Do you have other MQTT stuff in HA that is working?

Can you show with a printscreen the Shelly MQTT settings (removing the shelly number)?

You can use this: Shellies Discovery Script

Hi @ woody4165

This here is my Shelly MQTT settings. I have checked and rechecked everything is OK. Even included the “state_on” and “state_off” but but its still not working.

I have a perfectly working MQTT as I have 8 Tasmota devices including Shelly and Sonoff. Everything is working. The only thing that’s not working is Shelly on factory firmware.

You can use Shelly Discovery script as said before, or you can use an MQTT viewer to see what happens.

Try to use on and off in lower case, as I’m doing in my config

You can also flash ESPHome, it took me 2 minutes, and the integration with HASS is instant

Regarding the error, try to see here

@woody4165 ran the discovery script as well. but still not working.

Have you tried looking at an MQTT client what’s going on?

You can try also to submit command from there to see what happens

command_topic: “shellies/shelly1-xxxxxx/relay/0”
state_topic: “shellies/shelly1-xxxxxx/relay/0/command”
payload_on: “ON”
payload_off: “OFF”

the topic is switched with the command
command_topic: “shellies/shelly1-xxxxxx/relay/0/command”
state_topic: “shellies/shelly1-xxxxxx/relay/0”

and the payload, dont write using capital letters
ON = on
OFF = off

1 Like