Questions about integrating Shelly

I just picked up a Shelly1 and a ShellyButton 1 and started toying with them :wink:

A bit confused at the beginning but in the end got them in home Assistant with the (I guess) official integration. Took me some time to understand I didn’t need MQTT for this, as it uses CoIoT.

I have some questions though…

Why, when I enable MQTT on the shellies, are they not picked up by the MQTT integration in Home Assistant? BTW, running HA in a docker container, and Eclipse Mosquitto in another container. I have also MQTT on an Octoprint and this is correctly picked up by the HA MQTT integration. Also, the Shellies are interacting with the MQTT broker, as I could confirm with MQTT Explorer…

Anyway, I tested the CoIoT way and also installed the “Shellies discovery” script with HACS. After that, I was able to set up an automation as described here. The automation runs perfectly when I run it manually from the automations list. In this case: toggle the Shelly 1.
I noted however that for this to work, I had to disable again MQTT on the Shelly Button 1.

But it does not react to a button press on the Shelly Button 1. When I enable MQTT on the button and monitor it with MQTT Explorer, I can confirm MQTT messages being sent for each type of button press (1x, 2w, 3x, long).

What am I missing here ? Why does the integration not trigger when I press the Shelly button? Here is the yml of the automation:

- id: '1635426737617'
  alias: Lumière salle de bain
  description: ''
  trigger:
  - platform: device
    device_id: a0bbcafa8ea92f6a880860a28587a67c
    domain: shelly
    type: single
    subtype: button
  condition: []
  action:
  - type: toggle
    device_id: b2a8659591673be32a005345ec556ceb
    entity_id: switch.shelly1_sdb
    domain: switch
  - service: persistent_notification.create
    data:
      title: DEBUG
      message: Automation Salle de Bain triggered
  mode: single

My feeling is this may not be complete, I am missing the “Button single click”… Seescreenshot below:

Thnx for your ideas :slight_smile: