# UbisyD1/S2/C4: button problems

**URL:** <https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246>\
**Category:** Bug reports\
**Created:** [December 31, 2021, 10:15am UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246 "2021-12-31T10:15:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![cs42](https://forum.phoscon.de/user_avatar/forum.phoscon.de/cs42/32/1050_2.png) [@cs42](https://forum.phoscon.de/u/cs42)\
**Post date:** [December 31, 2021, 10:15am UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/1 "2021-12-31T10:15:17Z")

</div>

Hi,

I have a problem configuring the buttons of my Ubisys D1/S2/C4. It is not possible (anymore) to adjust groups to the buttons. I tried:

- modern Phoscon GUI
- the old web interface
- the bind box in the deCONZ GUI

After that I tried to use my homeassistant instance, but there are no events for the buttons reported and I am sure, that there have been some time ago!

So I did take a look using the REST interface and there’s something interesting to see in the result. Let’s have a look:

```
"12": {
  "config": {
    "group": "25,26,27,28",
    "mode": "momentary",
    "on": true,
    "reachable": true
  },
  "ep": 1,
  "etag": "3b1fcce7f00f060156cad90256f13f89",
  "lastannounced": "2021-09-26T22:31:35Z",
  "lastseen": "2021-12-31T08:21Z",
  "manufacturername": "ubisys",
  "mode": 1,
  "modelid": "C4 (5504)",
  "name": "Schalter Küchenzeile",
  "state": {
    "buttonevent": 1002,
    "lastupdated": "2020-12-15T22:00:31.416"
  },
  "swversion": "1.9.3",
  "type": "ZHASwitch",
  "uniqueid": "00:1f:ee:00:00:00:4d:18-01-0006"
}

```

Did you spot it?

It claims that the last button even has been about a year ago! But;

- I do use them more often 😉
- And they work with the groups I assigned ages ago to them! I just cannot assign new groups.

All devices should be on latest firmware, but my impression is that it wasn’t a firmware update but is rather a problem with deCONZ. I had the problem with an older firmware too (button assignment) and hoped an update would resolve is, but it didn’t.

I could even live without the direct assignment of the buttons **as long** as the events get emitted, because then I just would use homeassistant…

---

<div class="post-metadata">

**Author:** ![jensflorian](https://forum.phoscon.de/user_avatar/forum.phoscon.de/jensflorian/32/1214_2.png) [@jensflorian](https://forum.phoscon.de/u/jensflorian)\
**Post date:** [January 16, 2022, 4:31pm UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/2 "2022-01-16T16:31:16Z")

</div>

I have exactly the same issue with my C4. I am no longer able to assign new groups and cannot read buttonevents with openhab or node-red-deconz.

Node-red output:  
`16.1.2022, 17:27:58[node: 8dc490cad455d71f](http://192.168.1.130:1880/#)msg.payload : Object object buttonevent: 1002 lastupdated: "2020-12-01T19:51:22.895"`

---

<div class="post-metadata">

**Author:** ![manup](https://forum.phoscon.de/user_avatar/forum.phoscon.de/manup/32/9_2.png) [@manup](https://forum.phoscon.de/u/manup)\
**Post date:** [January 16, 2022, 4:39pm UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/3 "2022-01-16T16:39:29Z")

</div>

The ubisys devices are currently under testing, due some non ubisys related changes some problems leaked into the ubisys devices.

The C4 is fixed by this PR:

> <https://github.com/dresden-elektronik/deconz-rest-plugin/pull/5661>
>
> The C4 is currently broken for various reasons. The DDF is meant to replace the …C++ implementation while being backward compatible. Group binding and reconfiguration of these works as for Kobold with the "auto" \`config.group\` support for all 4 endpoints.
> 
> Initially with the DDF the C4 wil create 4 device groups and binds to them so that x002 button events are received right away.
> The controlled groups can be reconfigured via REST API or within the Phoscon App switch details view. It might take a minute or two until the changes are applied.
> 
> \*\*TODO\*\*
> 
> \* ~~Check the C++ implementation of \`processUbisysC4Configuration()\` it looks incomplete, is it even needed?~~
> https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/bindings.cpp#L4496
> \* ~~Remove C++ code for C4~~
> 
> The PR seems good to go, luckily could remove some unholy C++ stuff.
> 
> Tested with C4 firmware versions:
> 
> 10F2-7B09-0000-0004-0107015E-ubisys-C4.ota
> 10F2-7B09-0000-0004-0192020D-spo-fmi4.ota1 &rarr; this version needs to be loaded before the next one!
> 10F2-7B29-0000-0004-01930221-spo-fmi4.ota
> 
> Final note the firmware now also supports a nice Sw Version attribute, Date Code is still 20170531-DE-FB1.

J1 is currently in testing, guess S1 / S2 need the same changes.

---

<div class="post-metadata">

**Author:** ![manup](https://forum.phoscon.de/user_avatar/forum.phoscon.de/manup/32/9_2.png) [@manup](https://forum.phoscon.de/u/manup)\
**Post date:** [January 18, 2022, 1:29am UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/4 "2022-01-18T01:29:36Z")

</div>

Small update, I get the S1 and S2 for testing on Wednesday, fix should hopefully be easy.

---

<div class="post-metadata">

**Author:** ![jensflorian](https://forum.phoscon.de/user_avatar/forum.phoscon.de/jensflorian/32/1214_2.png) [@jensflorian](https://forum.phoscon.de/u/jensflorian)\
**Post date:** [January 28, 2022, 8:43pm UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/5 "2022-01-28T20:43:19Z")

</div>

Great, buttonevents in 2.14.0-beta for the C4 and S2 devices are back and updated. It is possible to add these fixes to the S2-R as well?

---

<div class="post-metadata">

**Author:** ![cs42](https://forum.phoscon.de/user_avatar/forum.phoscon.de/cs42/32/1050_2.png) [@cs42](https://forum.phoscon.de/u/cs42)\
**Post date:** [January 29, 2022, 9:05am UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/6 "2022-01-29T09:05:33Z")

</div>

Hm, assignment of C4 and D1 buttons seems to work again, but I do not see any events in home assistant. Is there something I need to do to get them?

---

<div class="post-metadata">

**Author:** ![jensflorian](https://forum.phoscon.de/user_avatar/forum.phoscon.de/jensflorian/32/1214_2.png) [@jensflorian](https://forum.phoscon.de/u/jensflorian)\
**Post date:** [January 29, 2022, 9:40am UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/7 "2022-01-29T09:40:37Z")

</div>

Buttonevents are properly triggered in NodeRed and OpenHab. Did you restart HA?

> Note: deCONZ automatically signals Home Assistant when new sensors are added, but other devices must at this point in time (deCONZ v2.05.35) be added manually using this service or a restart of Home Assistant

---

<div class="post-metadata">

**Author:** ![cs42](https://forum.phoscon.de/user_avatar/forum.phoscon.de/cs42/32/1050_2.png) [@cs42](https://forum.phoscon.de/u/cs42)\
**Post date:** [January 29, 2022, 10:00am UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/8 "2022-01-29T10:00:59Z")

</div>

I did at least reload the deConz integration, but that doesn’t seem to do the trick - a restart helped. Thanks.

---

<div class="post-metadata">

**Author:** ![manup](https://forum.phoscon.de/user_avatar/forum.phoscon.de/manup/32/9_2.png) [@manup](https://forum.phoscon.de/u/manup)\
**Post date:** [January 30, 2022, 3:33am UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/9 "2022-01-30T03:33:50Z")

</div>

Unfortunately I don’t have a S2-R unit for testing, but I think unlike the S1/S1-R they work the same.  
So it might be worth a try to duplicate the S2 DDF and modify the modelid value to the one shown in the Basic Cluster.

---

<div class="post-metadata">

**Author:** ![jensflorian](https://forum.phoscon.de/user_avatar/forum.phoscon.de/jensflorian/32/1214_2.png) [@jensflorian](https://forum.phoscon.de/u/jensflorian)\
**Post date:** [January 31, 2022, 5:54pm UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/10 "2022-01-31T17:54:38Z")

</div>

According to the Ubisys reference manual on p27 the model id is: “S2-R (5602)”

> **[ubisys-s2-technical-reference.pdf](https://www.ubisys.de/wp-content/uploads/ubisys-s2-technical-reference.pdf)**
>
> 370.32 KB

I used the S2 as a template and changed the modelid. But this doesn’t seem to work (no button events are created). Should changes in DDF after saving appear directly in the REST API?

 ![Bildschirmfoto 2022-01-31 um 18.45.26](https://forum.phoscon.de/uploads/default/original/2X/c/ca6edba37a0267acdd6dad464097e9da67b83317.jpeg)

---

<div class="post-metadata">

**Author:** ![manup](https://forum.phoscon.de/user_avatar/forum.phoscon.de/manup/32/9_2.png) [@manup](https://forum.phoscon.de/u/manup)\
**Post date:** [February 2, 2022, 11:16am UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/11 "2022-02-02T11:16:58Z")

</div>

The DDF is fine I think, the button events are currently separate in the file `button_maps.json`.  
Can you please try to change the modelid for the SR-2 like the following snipped and restart deCONZ:

```auto
        "ubisysS2Map": {
            "vendor": "Ubisys",
            "doc": "Power switch S2",
            "modelids": ["S2 (5502)", "S2", "S2-R (5602)"],
            "map": [
                [1, "0x03", "ONOFF", "TOGGLE", "0", "S_BUTTON_1", "S_BUTTON_ACTION_SHORT_RELEASED", "Toggle"],
                [1, "0x03", "LEVEL_CONTROL", "MOVE_WITH_ON_OFF", "0", "S_BUTTON_1", "S_BUTTON_ACTION_HOLD", "Move up (with on/off)"],
                [1, "0x03", "LEVEL_CONTROL", "STOP_WITH_ON_OFF", "0", "S_BUTTON_1", "S_BUTTON_ACTION_LONG_RELEASED", "Stop_ (with on/off)"],
                [1, "0x03", "LEVEL_CONTROL", "MOVE_WITH_ON_OFF", "1", "S_BUTTON_1", "S_BUTTON_ACTION_HOLD", "Move down (with on/off)"],
                [1, "0x03", "LEVEL_CONTROL", "STOP_WITH_ON_OFF", "1", "S_BUTTON_1", "S_BUTTON_ACTION_LONG_RELEASED", "Stop_ (with on/off)"],
                [1, "0x04", "ONOFF", "TOGGLE", "0", "S_BUTTON_2", "S_BUTTON_ACTION_SHORT_RELEASED", "Toggle"],
                [1, "0x04", "LEVEL_CONTROL", "MOVE_WITH_ON_OFF", "0", "S_BUTTON_2", "S_BUTTON_ACTION_HOLD", "Move up (with on/off)"],
                [1, "0x04", "LEVEL_CONTROL", "STOP_WITH_ON_OFF", "0", "S_BUTTON_2", "S_BUTTON_ACTION_LONG_RELEASED", "Stop_ (with on/off)"],
                [1, "0x04", "LEVEL_CONTROL", "MOVE_WITH_ON_OFF", "1", "S_BUTTON_2", "S_BUTTON_ACTION_HOLD", "Move down (with on/off)"],
                [1, "0x04", "LEVEL_CONTROL", "STOP_WITH_ON_OFF", "1", "S_BUTTON_2", "S_BUTTON_ACTION_LONG_RELEASED", "Stop_ (with on/off)"]
            ]
        },

```

---

<div class="post-metadata">

**Author:** ![jensflorian](https://forum.phoscon.de/user_avatar/forum.phoscon.de/jensflorian/32/1214_2.png) [@jensflorian](https://forum.phoscon.de/u/jensflorian)\
**Post date:** [February 3, 2022, 6:51pm UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/12 "2022-02-03T18:51:29Z")

</div>

> [@manup](#):
>
> button events are currently separate in the file `button_maps.json`.  
> Can you please try to change the modelid for the SR-2

Thank you very much. After editing, the S2-R now reports button events too!

OpenHab output:

```auto
2022-02-03 19:46:44.826 [INFO] [openhab.event.ChannelTriggeredEvent] - deconz:switch:cf2cb54b:001fee0000002345030006:buttonevent triggered 1002

2022-02-03 19:46:45.899 [INFO] [openhab.event.ChannelTriggeredEvent] - deconz:switch:cf2cb54b:001fee0000002345030006:buttonevent triggered 1002

```

---

<div class="post-metadata">

**Author:** ![manup](https://forum.phoscon.de/user_avatar/forum.phoscon.de/manup/32/9_2.png) [@manup](https://forum.phoscon.de/u/manup)\
**Post date:** [February 5, 2022, 9:29pm UTC](https://forum.phoscon.de/t/ubisyd1-s2-c4-button-problems/1246/13 "2022-02-05T21:29:29Z")

</div>

Nice, I’ll add the adapted DDF and button file to the release.
