Shelly: Expose switch inputs and input mode configuration for Gen4 1/1PM/1PM Mini/2PM - #12059
Conversation
….0.0-beta1 & toggle for detached mode 2PM
|
Thanks! |
Hello @SebiGo, I have Shelly 1 Gen4, Shelly 1 PM & Shelly 1PM Mini at home running version 2.0.0beta1 and Z2M 2.10.0 Shelly 1PM Gen4: Shelly 1PM Mini Gen4: Switch Mode is not ok. Value is Null and Title should be: Toggle, Momentary, Edge, Detached, Activation Device states in Z2M shows: Shelly 1 Gen4: I tried to reconfigure each device but no changes. |
|
Hello @KroFR Thank you for your feedback. As stated, I have not been offered the 2.0.0.-beta1 on my 1PM & 1PMmini yet - hence I have to rely on your input :) Two things I'd like to investigate: Missing input exposes on 1/1PM Gen4: I only had the 1 Mini Gen4 to test against, so the endpoint map for the non-Mini variants is likely off. Could you post a screenshot of the Z2M Clusters tab for both Shelly 1 Gen4 and Shelly 1PM Gen4? I'm specifically looking for any endpoint beyond 1 and 239 that has genOnOffSwitchCfg as input cluster — that's where the switch input lives. switch_mode_sw1 is null on 1PM Mini: that's odd because switch_type_sw1 reads correctly. Can you set Z2M log_level to debug, trigger a refresh of switch_mode_sw1, and share the raw RPC response from the log? Alternatively, what does curl http:///rpc/Switch.GetConfig?id=0 return when the device is in WiFi mode? I want to see if the firmware's mode field is named or formatted differently than I assumed. Will open a follow-up PR once we have that info. |
|
Here you fo @SebiGo Shelly 1 Gen4: Looks like firmware 2.0.0beta1 does not expose Input mode on this one For the logs, i will submit as soon as possible. I can't right now |
|
I did a full interview of the device because there is no refresh button for switch_mode_sw1
curl http:///rpc/Switch.GetConfig?id=0 result: |
|
Same issue on my side, switch mode is not readable/writable, no refresh button. |
|
Same here! Worth to mention that the new input entity is not appear as MQTT entity in HA. |
|
Looking at the changes an input is not expected, it’s exposed as an event action |
Added curl http:///rpc/Switch.GetConfig?id=0 result to previous logs for 1PM Mini. |
I need to be in that screen while changing the input, and the input needs to be detached. It’s not a state it’s an event (transient), so it won’t be stored as state. Haven’t done myself since I have no need for it, but for action events to show in home assistant I think some setup is needed (not sure how up to date that is) |
|
Thanks everyone for the testing and feedback while I've been out in the mountains. Thanks @lexbrugman for your explanations. @KroFR — Shelly 1PM Mini Gen4 The @KroFR — Shelly 1 Gen4 @N3rdix @Mosher23 — getting the action into HA - domain: mqtt
device_id: <your-device-id>
type: action
subtype: input_1_off
trigger: deviceValid subtypes: |
My Shelly 1 Gen 4 returns: Ive re-paired the device after the down- and upgrade. |
|
@KroFR & @Cemaver the issue with Shelly1 Gen4 should be fixed with #12096. I would appreciate if you could test this before I remove the draft status. Would you mind testing this custom converter and provide feedback here? Unfortunately, I still haven't been offered 2.0.0-beta1 on my Shelly 1 (Mini/PM) Gen4 devices. |
Ok, that could explain why it doesn’t show up on my test device (1PM Gen4).
Yes, it's upgraded to version 2.0.0beta1 |
|
@SebiGo: { But "switch mode" does not work. Edit: if i trigger the SW the Action becomes N/A |
place shelly1gen4firmware.js here and restart Z2M |
|
Thanks @Cemaver @SebiGo I now see the this on the Shelly 1 Gen4: State curl http:///rpc/Switch.GetConfig?id=0 If I trigger Switch Mode refresh: |
|
Thanks @KroFR and @Cemaver, I will proceed with the PR #12096 |
|
Thanks @SebiGo. Let's follow up after next release. |
External converter shelly1gen4firmware2.js is for Shelly 1 Gen4 only. For Shelly 1PM mini, you need to upgrade Z2M to version 2.10.0 AND to upgrade 1PM mini firmware to version 2.0.0beta1. |
|
I am on Z2M 2.10 and Shelly is on 2.0.0 Beta 1 |
Actually, I can see the changes on your screenshot. Switch Type & Switch Mode are there already. |
|
#12096 As mentioned here for me update doesn't improve anything. |
|
Hi! |
|
I have 4x Gen4 1PM minis and 1x Gen4 1PM. All on the 2.0.0beta1. I tried reconfiguring them multiple times, nothing helps. Does anyone have an idea on whats happening with my setup? |
|
@Mosher23 I had to do both: Re-Interview and Re-configure to make actions appear. But I ran into a different problem: I have a Shelly 1 Mini Gen4 (S4SW-001X8EU) on firmware 2.0.0-beta1 with Zigbee2MQTT 2.12.0. With switch type set to "switch" (=toggle) in the shelly UI, normal input actions are published correctly: However, when I switch the shelly to "Button" (=momentary) the device sends genScenes.commandRecall with scene IDs 1, 2, 3, or 4, Zigbee2MQTT throws: Current converter only maps scene IDs 5 and 11. Furthermore, switch_type does not read correctly nor can be set:
@Koenkk as mentioned here shelly publishes sequence events via scene IDs. Is it possible to implement the scene IDs 1–4 to correctly show single/double/triple/long press as action? Like: And should this be discussed here or in a separate issue? Thanks a lot in advance! |
|
@SebiGo Thanks a lot! 🥳 |



















The external converter for the Shelly 1 Mini Gen4 has been tested by @Chicchi7393 in #12011 .
I assume the 1PM and 1PM Mini expose the same endpoint and behave identically, but this is untested as I haven't received the 2.0.0-beta1 firmware on my devices yet.
I also included an RPC-based converter for configuring non-standard switch input modes (follow, flip, detached, cycle, activation) as well as ZCL-based switch_type configuration (toggle/momentary via genOnOffSwitchCfg). Both apply to the 1 Mini, 1PM Mini, 1PM Gen4, and 2PM Gen4.