Shelly Gen 2 (Plus 1) mqtt switch status

Hi,

I have a Shelly Plus 1 with SW Vers. 1.0.8. Generic status update is on. The switch is working, all topics are properly send and received, according to mqtt broker.
However the switch is always in unavailable state?

Any advice what I’m doing wrong here?

Thx

  • switch:
    • unique_id: mqttswitch_pelletofen
      name: “MQTTSwitch Pelletofen”
      availability_topic: “Heizung/Pelletofen/online”
      payload_available: “true”
      payload_not_available: “false”
      state_topic: “Heizung/Pelletofen/status/switch:0”
      value_template: “{{ value_json[‘output’] }}”
      state_off: “false”
      state_on: “true”
      command_topic: “Heizung/Pelletofen/rpc”
      payload_on: ‘{“method”: “Switch.Set”, “params”:{“id”:0,“on”:true}}’
      payload_off: ‘{“method”: “Switch.Set”, “params”:{“id”:0,“on”:false}}’
      qos: 0
      optimistic: false

Hi,

I found the issue. state off and on should be without quotation marks.
So the right config looks like this:

  • switch:
    • unique_id: mqttswitch_pelletofen
      name: “MQTTSwitch Pelletofen”
      availability_topic: “Heizung/Pelletofen/online”
      payload_available: “true”
      payload_not_available: “false”
      state_topic: “Heizung/Pelletofen/status/switch:0”
      value_template: “{{ value_json[‘output’] }}”
      state_off: false
      state_on: true
      command_topic: “Heizung/Pelletofen/rpc”
      payload_on: ‘{“method”: “Switch.Set”, “params”:{“id”:0,“on”:true}}’
      payload_off: ‘{“method”: “Switch.Set”, “params”:{“id”:0,“on”:false}}’
      qos: 0
      optimistic: false
      retain: true