Button Controller - the use of button 0

Is there a way to use button 0 in Button Controller? Some device inputs are indexed from 0 rather than 1,
In rule machine it is possible to use button 0:

In Button Controller I cannot use button 0:

None of hubitats button drivers use button 0 as its technically an invalid id. If you are using a user driver that is sending button 0 events then it should be updated to support the correct button ids.

1 Like

Is there a reason why 0 is considered invalid? If a device has two button inputs labeled 0 and 1, it's confusing to number them differently in software.

Sure, button ids map to physical buttons and these out of convention begin at 1, not 0.
Programmers understand array indexing starts at 0, but this is not how mapping is usually done in the physical universe for non programmers.

1 Like

Counterpoint: EDIT: nevermind, I was wrong.

1 Like

I have to admit, as an end user, I've always found it odd that Shelly uses 0 as the first relay, push button, etc...

1 Like

@mike.maxwell on the other site I have to say this is also confusing for me as end user, the inputs are 0&1 in the web interface of the device but will be 1&2 in hubitat.
This is a screenshot by default:

This is when I renamed the inputs

very confusing for end users and a developer is probably also not amused with this situation🤦‍♂️

1 Like

I think this is a problem that Shelly must fix.
... the 'normal' people count starting from 1, while the software developers count starting from 0.. :sweat_smile:

2 Likes

Agree, no other buttons i am aware of start at 0...

2 Likes

there was some brainstorming done on it, :slight_smile:
image

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.