[RELEASE] Switch Bindings 2.0

Ok, so it looks like one of your new bulbs is reporting a non-numeric Level to the app. I could add a check for non-numerics, and that would hide the error, but it still wouldn't sync.

Next thought, can you open the device page for one of the zigbee bulbs, and observe what shows as the Level value as you manipulate it?

This changes as expected but here is a var called bulblevel here that is always 4C.
hexlevel seems to follow dec level in current states.

image
image

image
image

image
image

Just define the function without a type, then cast the value to an integer.

functionName(level) {
    Integer levelInt = (level as Integer)
    ...
}

EDIT: Actually, looking at those errors up above closer, the error is from the DEVICE, not your app. It looks like somehow your app is possibly sending a setLevel("A") to the device?

Possibly the app sending things on?
I have many of these bulbs in use for years. I tried a HE Advanced ZB Drivers (what all my bulbs are) and the built-in Generic on and I still get the error.
This is very similar to [RELEASE] Switch Bindings 2.0 - #155 by luke2

Just to clarify:
When I turn Turn On (via the Dashboard or WebCore) Living Room Binding Master Switch only the left light comes on and I get the error only on that one light.
If I send a Set Level command to the binding the right light comes on and both lights set level and Turn Off properly.
I tried this without a Master swtich and only commanded the left light and the error was gone and both lights came on, set level and went off in sync!
I have a Master set for another set of lights bu thtey are ZW. I tuned on the Debug and no error so only a ZB issue?

I was getting that error on both bulbs but "magically" 3.5 days ago the right bulb stopped complaining.
That may have been while I was trying 3 different drivers. I am back to the Built-in Advaned ZigBee Bulb.

Correct, but my app just passes along the value it got from the triggering device. So those new devices are somehow sending level of "A....".

Yeah, stay tunned to get a packet of gravel to throw at me...
I had defined a vitual switch to use as a Master switch (in Webcore) instead of one of the physical devices in the list and that gummed up the works. :frowning: Also explains all of these:
app:17772024-07-29 08:35:24.058debugcheckForFeedbackLoop: Preventing feedback loop

Well, dang.
Living is working fine now so I did the other groups. :frowning:
I shall mess around and see what I can find.
Looking like an initialization issue?
The two new groups are working now without errors. Maybe it's something to do with the 5000 ms sync thing?

app:17852024-07-29 14:04:15.127infoUpdated with settings: [syncOnOff:true, syncColorTemperature:false, syncSpeed:false, nameOverride:Master Bedroom Bedside Binding, responseTime:5000, syncSaturation:false, syncLevel:true, syncHue:false, syncHeld:false, switches:[Master Bedroom Bedside Right, Master Bedroom Bedside Left], enableLogging:true]

Inital errors after creation and activation.

dev:1582024-07-29 13:51:03.529errorjava.lang.NumberFormatException: Character A is neither a decimal digit number, decimal point, nor "e" notation exponential mark. on line 455 (method setLevel)

dev:1582024-07-29 13:46:28.511errorjava.lang.NumberFormatException: Character A is neither a decimal digit number, decimal point, nor "e" notation exponential mark. on line 455 (method setLevel)

dev:1582024-07-29 13:43:16.983errorjava.lang.NumberFormatException: Character A is neither a decimal digit number, decimal point, nor "e" notation exponential mark. on line 455 (method setLevel)

dev:19882024-07-29 13:41:45.521errorjava.lang.IllegalArgumentException: null on line 66 (method off)

dev:19882024-07-29 13:39:48.704errorjava.lang.IllegalArgumentException: null on line 66 (method off)

dev:19882024-07-29 13:35:45.493errorjava.lang.IllegalArgumentException: null on line 66 (method off)

dev:1582024-07-29 13:33:46.396errorjava.lang.NumberFormatException: Character A is neither a decimal digit number, decimal point, nor "e" notation exponential mark. on line 455 (method setLevel)

dev:19882024-07-29 13:31:29.409errorjava.lang.IllegalArgumentException: null on line 75 (method setLevel)

dev:19882024-07-29 13:31:29.152errorjava.lang.IllegalArgumentException: null on line 59 (method on)

dev:19882024-07-29 13:29:10.837errorjava.lang.IllegalArgumentException: null on line 75 (method setLevel)

dev:19882024-07-29 13:29:10.585errorjava.lang.IllegalArgumentException: null on line 59 (method on)

dev:19882024-07-29 13:28:36.698errorjava.lang.IllegalArgumentException: null on line 75 (method setLevel)

dev:19882024-07-29 13:28:36.444errorjava.lang.IllegalArgumentException: null on line 59 (method on)

dev:19882024-07-29 13:20:22.662errorjava.lang.IllegalArgumentException: null on line 66 (method off)

Sadly one came back erroring after working?
Set Level makes both lights come on as before.

dev:1582024-07-29 16:43:02.182errorjava.lang.NumberFormatException: Character A is neither a decimal digit number, decimal point, nor "e" notation exponential mark. on line 455 (method setLevel)

dev:1582024-07-29 16:41:13.647errorjava.lang.NumberFormatException: Character A is neither a decimal digit number, decimal point, nor "e" notation exponential mark. on line 455 (method setLevel)

I'm really struggling with getting my binding working fully, and I am starting to suspect the extra layer I have here is to blame, but looking for ideas / suggestions on what to try to make it work.

I have a Hue Group sync'd to hubitat with 3 bulbs. I have also a z-wave switch which those bulbs are connected to (Zooz). I have the switch set to smart bulb mode (so no physical control enabled).

When I bind the switch and my hue group, the on/off state syncs great from the switch itself. However when I turn the bulb group off in Hue, or if I turn it off in HomeKit, the switch never seems to have its on/off state updated.

I have not set a master switch, because I really do want either device to toggle on/off (so i can control rgbw for the bulbs from the hue app or homekit, and also use that exposed device to turn off/on).

Now I have another setup which is a group (2.1 groups) of zigbee sengled BR30 RGBW lights, bound with this app to another Zooz switch in smart bulb mode. I have the bulb group exposed to homekit. I have the exact same problem here as the hue bulbs. On/Off works fine from the switch but it never seems to get updated when I turn things on/off from the homekit side.

Am I missing something obvious here?

What does the event history show on the Zooz switch (screenshot please). Go to the device page and click Events at the top.

Thinking maybe this app is sending the on/off commands but since the switch is in smart bulb mode it is not doing anything with that. If you click on/off on the device page of the switch does it change the state?

Ok so i think I have more clues as to what's happening but it seems a bit random.

This is me turning the lights off first with HomeKit, and then hitting the physical zooz switch to turn them back 'on'.

Now I've noticed it seems like the zooz switch is actually clicking the hardware switch state on/off when i trigger it from HomeKit, despite it being set to "Physical Control disabled".

I just had the thought that maybe what I actually want is "Physical and Z-Wave Control disabled" so I just tried that which appears to be working. Perhaps i was misunderstanding that setting a bit still and the binding rule was turning the z-wave state off which meant turning off the actual power to the bulbs?

Ok, the Kitchen setup seems good, that's the one with Hue. It's also a bit simpler as it's a single switch.

I'm still having issues with my Living room lights. These are the ones on a Zooz Dimmer, with a 3 way switch involved here, and finally, a 2.1 group of zigbee bulbs (sengled BR30).

I have:

  • Living Room Accent RGB (Sengled bulb group 2.1) - Exposed to HomeKit
  • Living Room Accent Lights (Zooz Dimmer 3 way switch) - Not Exposed to Homekit
  • Living Room Accent Binding (Switch Binding 2.0) - Binding both above

It mostly works, except it seems like if i turn the Living Room Accent RGB off from HomeKit, and then try and hit "on" on the "Living Room Accent Lights" zooz switch, the bulbs won't turn back on. I don't hear a physical click on/off on this one in any case, and I see in the logs below that RGB2 (which is one of the 4 bulbs in the group) is showing up which seems unusual.

I'm noticing when things 'work', I see the individual RGB bulbs reporting in, and when it doesn't work, I'm not seeing them all report in....

Your first set of logs there shows the switch turned on, and then the app turned on the "Living Room Accent RGB" which I think is your group, but then nothing after that from the bulbs, I assume they did not turn on.

You should check the states and event log on the group device, seems like in this case that is where he issue is happening. (The event log is a tab on the device page and is not the same as the system logs)

Ok, I don't notice anything in the group logs, but I did tweak a few settings and switched to using Zooz community drivers which seem a bit more reliable in this scenario at least.

In doing so I noticed something interesting:

The community driver seems to distinguish between physical and digital switch state changes.

Given that the bindings 2.0 has a 'timeout' interval for preventing feedback loops, I'm wondering if it could be made to leverage this digital vs physical info instead?

If the digital change ever happens, it should just change the switch's state. I'm not sure if it's possible to do so without that state change also triggering an event, but if it is, in theory the app could ignore the next state change of that switch (for only a period of time to be safe).

Perhaps this is already how it's working and I'm just naive to it?

I kind of wish I could just make my Zooz up / down paddles act as buttons and get rid of any concept of a switch state to maintain/sync. In that way I could just have triggers on button presses to manage the state of the bulb group and it would always only be a "One Way" sync.

The logs or the EVENT history? From the group device (not the app)?
If the group device has any "Current States" there has to be event history.

image

Ummm... you can.

Would it be possible to add an option to only bind with switches that are currently in an On state?

Let’s say I have four switches binded and I adjust the level of one, I don’t want it to turn on the switches that are currently off to adjust the level. The switches I have do not have a pre-stage option.

If it was only an option when just a master switch is selected would be okay too.

@jwetzel1492 @jtp10181

I am using Switch Binding custom app. in the next scenario.
All automations are running on the main C8 Pro hub. Also I have few NSPanel devices which are very nice and easy customizable Wall Scene controllers but these reired Home Assistant. In order to bring NSPanels to HE I am using Home Assistant Device Bridge (HADB) on the C7 hub which is hub-mashed with main C8 Pro. Because on the C8 all devices are HADB-childs I don't want use them directly. And here is a Switch Binding app is a BIG help. Everything works as expected except occasionally (about 25-30%) synchronization across C7-C8 mesh is failing. I suspect this is due to timing, possibly race conditions.
Is it any way to debug and fix this annoying issue?

Does it have anything to do with this app If the failure is between the two hubs with hub mesh?

There is a full sync setting in hub mesh, you could try turning that down to a shorter time.

Near 100 devices and parameters are passing across hub mesh. Failure is observed only for the devices participating in the Switch Binding app. However 100% conclusion is impossible.

The default value for the full sync is 1 hour. I guess, this is "just in case" feature and changing it to 2 min (possible min sync interval) will not fix this specific problem. Switch Binding app also has a 5 sec default timeout for the device response. This is more than enough because when everything is working the response is near instant. Something else is going on inside the app.

BTW. For instance if one virtual switch has auto off timer enabled it never gets synchronized regardless of how long is auto off timeout. This behavior makes no sense at all.

@jwetzel1492 @jtp10181

Is Switch Bind custom up still supported or I should forget about it and find a different solution?
When it works, this app is extremely helpful but unfortunately the synchronization gets lost about 25-30% cases. This is not acceptable specifically for maintaining really high WAF.

It is not my app, it was just recently updated so I assume still supported.

I do not understand how this issue is related to this app at all? From the sounds of it your issue is with Hub Mesh.

If you think there is an issue with the app itself, reproduce it without Hub Mesh involved and post the steps to re-create the issue.

2 Likes