Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse SmartHome » Switch or Contact for channel - Best practice
Switch or Contact for channel - Best practice [message #1779980] Tue, 16 January 2018 10:04 Go to next message
Martin Eskildsen is currently offline Martin EskildsenFriend
Messages: 5
Registered: January 2018
Junior Member
I am maintaining a Binding for ZoneMinder in openHAB. I am restructuring the Binding, and also adding new functionality.
I am adding a new channel that should be active when the camera is tripped work because of motion. Now the discussion comes if it should be a Contact reporting OPEN/CLOSED or if it should be a SWITCH reporting ON/OFF.

Is there some sort of Best Practice?
Re: Switch or Contact for channel - Best practice [message #1780000 is a reply to message #1779980] Tue, 16 January 2018 13:08 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 661
Registered: December 2011
Senior Member
Hi Martin,

My advice would be to use Contact only where OPEN/CLOSED is clearly the right vocabulary and Switch in all other cases. For a motion trigger information, I'd clearly go for ON/OFF.

Regards,
Kai
Re: Switch or Contact for channel - Best practice [message #1780008 is a reply to message #1780000] Tue, 16 January 2018 13:54 Go to previous messageGo to next message
Martin Eskildsen is currently offline Martin EskildsenFriend
Messages: 5
Registered: January 2018
Junior Member
Thanks, that was also my thought.

Back in openHAB 1.x I could add both a Switch and a Contact to the same Group (and it actually worked). I read somewhere that it has been removed by intention. Is there some recommended way of doing the conversion? Can I expect some kind of support for that in Eclipse SmartHome or maybe openHAB?
Re: Switch or Contact for channel - Best practice [message #1780022 is a reply to message #1780008] Tue, 16 January 2018 15:12 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 661
Registered: December 2011
Senior Member
Not sure what you expect as the outcome of putting them in the same Group. It is imho unclear whether you want to interpret OPEN as ON or OFF (it very much depends on the use case).

Note that the calculation of the group states has just been fixed&clarified, you can find the documentation here: https://github.com/eclipse/smarthome/blob/master/docs/documentation/concepts/items.md#derive-group-state-from-member-items

Re: Switch or Contact for channel - Best practice [message #1780104 is a reply to message #1780022] Wed, 17 January 2018 12:31 Go to previous message
Martin Eskildsen is currently offline Martin EskildsenFriend
Messages: 5
Registered: January 2018
Junior Member
Kai Kreuzer wrote on Tue, 16 January 2018 15:12
Not sure what you expect as the outcome of putting them in the same Group. It is imho unclear whether you want to interpret OPEN as ON or OFF (it very much depends on the use case).

Note that the calculation of the group states has just been fixed&clarified, you can find the documentation here: https://github.com/eclipse/smarthome/blob/master/docs/documentation/concepts/items.md#derive-group-state-from-member-items

I am using it in my sitemap to aggregate to an overall status of a group of Items (eg. PIR sensors). The problem is when I use different datasources where one is reporting OPEN/CLOSED and the other ON/OFF.
I can always create proxy items, and do the conversion in a rule.
Previous Topic:Role based access
Next Topic:Maven install is getting BUILD FAILURE
Goto Forum:
  


Current Time: Mon Nov 19 03:36:13 GMT 2018

Powered by FUDForum. Page generated in 0.02596 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top