tobof / openhab-addons

The next-generation open Home Automation Bus (openHAB)
Eclipse Public License 2.0
39 stars 30 forks source link

Motion channel ON/OFF #24

Closed andreacioni closed 7 years ago

andreacioni commented 8 years ago

Hi Tim,

I'm wondering to change the tripped channel from OPEN/CLOSE to ON/OFF because presence in OH2 was linked to the ON/OFF state. What do you think?

tobof commented 8 years ago

Hey Andrea,

according to this: https://github.com/openhab/openhab/wiki/Explanation-of-items

Contact: "Can be used for sensors that return an "open" or "close" as a state. This is useful for doors, windows, etc."

For me presence and tripped are not the same. A door window maybe OPEN but nobody is at home (presence = OFF). :o)

andreacioni commented 8 years ago

Ok, not a good idea ;)

DerTomm commented 7 years ago

Hi Tobof,

sorry for reviving this issue but today I set up the MySensors OpenHAB binding for the first time and was a little bit confused about using "contact" as item type for motion. Intuitively I would have expected that motion is represented with the status "true/false" (or "on/off") and not with "open/close".

At the moment a non-tripped motion sensor reports "closed" as status. Don't you think that the item type "switch" would be better for motion?

tobof commented 7 years ago

Hey @DerTomm!

I've thought about this for the last days and I have no preference. @andreacioni do you still vote for ON/OFF instead of OPEN/CLOSE? If so, I will prepare a fix.

andreacioni commented 7 years ago

Hi @tobof and @DerTomm. This old question is hard to answer... Tripped channel is used for both motion and contact sensors. So changing that to ON/OFF may create confusion for who now use door/window things through MySensors Binding.

Probably the simplest thing is to do nothing. But @tobof, what about distinguish tripped channel to: tripped-onoff and tripped-openclose?

DerTomm commented 7 years ago

Another argument: In addition to S_DOOR also S_MOTION and S_SMOKE use V_TRIPPED as value. And neither a smoke sensor nor a motion sensor will report something to be open or closed. So I think "on/off" as generic item type would fit best for all of them.

tobof commented 7 years ago

Hmm, it seems, that there is no clear regulation for that. In the Zwave binding there is ON/OFF for Motion and OPEN/CLOSED for Door.

If I look at this page: http://docs.openhab.org/configuration/items.html There is the following example: Group:Contact:OR(OPEN,CLOSED) gMotionSensors (All)

@DerTomm Maybe it makes sense to open a discussion in the community? All bindings should use it the same way.

DerTomm commented 7 years ago

I think the Zwave binding distinguishes between ON/OFF for motion and OPEN/CLOSE for door contact sensors because otherwise the motion sensor widget on any sitemap only shows an open or closed window too - which is quite unsuitable here in my opinion. So I think @andreacioni's approach with two channels "tripped-onoff" and " tripped-openclose" would solve this problem in a nice way.

Alpoy commented 7 years ago

So I think @andreacioni's approach with two channels "tripped-onoff" and " tripped-openclose" would solve this problem in a nice way.

Would be nice if this could be implemented! ;-)