Shelly Plus 2PM - Use imput as button not as switch

Hi there,
i added a shelly Plus 2PM for tracking some temps and operations. So i use the input for operations-feedback from technical equipment.
If i change the config of the input from switch to button, the input disappear in HA. Can me help some one?

Kind Regards Paul

Also ask yourself if a button really makes sense in your case (not totally understanding what you exactly do)

In short, if want to have inputs decoupled from the switch, you have to use button mode, and then listen to events instead of input.

That is not correct.
You can set as switch and have the relay type as “Detached”.

I have dozens of Shelly devices set as switch and detached from the input, and in all those cases the input entity still available in Home Assistant.

I hope what you are saying is still valid for gen2 devices (suppose the device from your screenshot is gen1)
Otherwise, you have right. The detached mode in Shelly settings should be enough. Not sure why OP wants to use button mode in Shelly integration. I don’t know this integration at all. It was my assumption (based on HA docs) that it changes shelly settings together with the change of way how to listen to events.

My screenshot was from a Shelly Plus 2PM (Gen 2). The settings are slightly different, but you can set the same behavior on the Gen 1 devices.
I’ve tested in the following devices and it worked fine in all of those:

Gen 1:

  1. Shelly 1PM
  2. Shelly 2.5PM
  3. Shelly Dimmer 2

Gen 2:
4. Shelly Plus 1PM
5. Shelly Plus 2PM

1 Like

Yeah… seeing “outlet” on the screenshot I thought it must be Plug or PlugS. My bad assumption.

1 Like

Any help to use it via Mqtt instead of integration ? I’m able to see the switch state but not the input state.

The question is, do you really need to “see” input states for any reason?
In general, it’s enough to define an mqtt switch, allowing reading and setting the Shelly state.

I can imagine you can want to track input press time or the number of input clicks…
If so, I then define MQTT binary sensor for input topic of your Shelly 2PM

BTW inputs are read-only.

For a case, here is my config (no input monitoring though)

pck_entrance:
  mqtt:
    switch:
      - name: "Front Motion Light"
        unique_id: "Front Motion Light"
        state_topic: "shellies/entrance/status/switch:0"
        command_topic: "shellies/entrance/rpc"
        availability_topic: "shellies/entrance/online"
        value_template: "{{ 'on' if value_json.output else 'off' }}"
        payload_on: "on"
        payload_off: "off"
        payload_available: "true"
        payload_not_available: "false"
        qos: 1
        device:
          name: "Entrance Shelly Light"
          configuration_url: "http://192.168.107.211"
          connections: [["mac", "xxxx"]]
          manufacturer: "Allterco Robotics Ltd."
          model: "Shelly Plus 2PM"
    sensor:
      - name: "Front Motion Power"
        unique_id: "Front Motion Power"
        state_topic: "shellies/entrance/status/switch:0"
        availability_topic: "shellies/entrance/online"
        value_template: "{{ value_json.apower }}"
        device_class: power
        unit_of_measurement: "W"
        payload_available: "true"
        payload_not_available: "false"
        device:
          name: "Entrance Shelly Light"
          configuration_url: "http://192.168.107.211"
          connections: [["mac", "xxxx"]]
          manufacturer: "Allterco Robotics Ltd."
          model: "Shelly Plus 2PM"

      - name: "Entrance Hall Light Power"
        unique_id: "Entrance Hall Light Power"
        state_topic: "shellies/entrance/status/switch:1"
        availability_topic: "shellies/entrance/online"
        value_template: "{{ value_json.apower }}"
        device_class: power
        unit_of_measurement: "W"
        payload_available: "true"
        payload_not_available: "false"
        device:
          name: "Entrance Shelly Light"
          configuration_url: "http://192.168.107.211"
          connections: [["mac", "xxxx"]]
          manufacturer: "Allterco Robotics Ltd."
          model: "Shelly Plus 2PM"

      - name: "Entrance Shelly Temperature"
        unique_id: "Entrance Shelly Temperature"
        state_topic: "shellies/entrance/status/switch:1"
        availability_topic: "shellies/entrance/online"
        value_template: "{{ value_json.temperature.tC }}"
        unit_of_measurement: "°C"
        device_class: temperature
        payload_available: "true"
        payload_not_available: "false"
        entity_category: diagnostic
        device:
          name: "Entrance Shelly Light"
          configuration_url: "http://192.168.107.211"
          connections: [["mac", "xxxx"]]
          manufacturer: "Allterco Robotics Ltd."
          model: "Shelly Plus 2PM"

    light:
      - name: "Entrance Hall Light"
        unique_id: "Entrance Hall Light"
        state_topic: "shellies/entrance/status/switch:1"
        command_topic: "shellies/entrance/command/switch:1"
        availability_topic: "shellies/entrance/online"
        state_value_template: "{{ 'on' if value_json.output else 'off' }}"
        payload_on: "on"
        payload_off: "off"
        payload_available: "true"
        payload_not_available: "false"
        qos: 1
        device:
          name: "Entrance Shelly Light"
          configuration_url: "http://192.168.107.211"
          connections: [["mac", "xxxx"]]
          manufacturer: "Allterco Robotics Ltd."
          model: "Shelly Plus 2PM"