Hue Binding - Dimmer Switch

@sihui @cweitkamp
not sure about links, but it´s pretty easy, just like the Dimmer Switch. The Hue Tap just gives back different values from the Dimmer Switch

The json response from a Hue Tap within the api looks like that:
http://hue-bridge/api/api-token/sensors/10

state
buttonevent 17
lastupdated “2018-12-26T21:01:35”
swupdate
state “notupdatable”
lastinstall null
config
on true
name “Hue Tap Schlafzimmer”
type “ZGPSwitch”
modelid “ZGPSWITCH”
manufacturername “Philips”
productname “Hue tap switch”
uniqueid “00:00:00:00:XX:XX:XX:XX-XX”
capabilities
certified true

Then you have to convert the values from those Button press events with a .map like:
16=Button 2
17=Button 3
18=Button 4
34=Button 1

For now my Items look like that:

String HueTapSZButton "Hue Tap Schlafzimmer [MAP(hue.map):%s]" (HueSwitch) {http="<[huetap:1000:JSONPATH($.state.buttonevent)]"}
String HueTapSZUpdate "Hue Tap SZ Last Update [%s]" <clock> (HueSwitch) {http="<[huetap:30000:JSONPATH($.state.lastupdated)]"}
1 Like

For sure. You may have to tell me how to get those data needed :grinning:

Thank you very much, sounds easy indeed, will try tomorrow to get it to work.

@apfelflo89 Thank you very much. Should be enough for a first glimpse. I will incorporate the Hue Tap into the binding.

I will return to you if I need anything else.

1 Like

If you like to test it:

2 Likes

Uninstalled hue binding via PaperUI, dropped test jar into my addons folder, cleared tmp and cache, restarted openHAB (2.5 Snapshot #1467 manual install on Debian 9.5):

2018-12-28 12:22:14.900 [ERROR] [org.eclipse.smarthome.binding.hue   ] - FrameworkEvent ERROR - org.eclipse.smarthome.binding.hue
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.smarthome.binding.hue [191]
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634) ~[?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614) ~[?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585) ~[?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528) ~[?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) ~[?:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

2018-12-28 12:22:59.862 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/opt/openhab2/addons/org.eclipse.smarthome.binding.hue-0.11.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.smarthome.binding.hue [191]
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]



openhab> bundle:list | grep hue
191 x Installed x  80 x 0.11.0.201812281054    x Eclipse SmartHome hue Binding


openhab> bundle:start 191
Error executing command: Error executing command on bundles:
        Error starting bundle 191: Could not resolve module: org.eclipse.smarthome.binding.hue [191]
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

Sorry, missed that post. It’s starting now, will do some further testing :kissing_heart:

2018-12-28 13:32:01.997 [.ItemChannelLinkAddedEvent] - Link 'TabLiving_Sw-hue:0830:0017882e7a2d:5:tap_switch' has been added.
2018-12-28 13:32:02.060 [.ItemChannelLinkAddedEvent] - Link 'TabLiving_lastUpdated-hue:0830:0017882e7a2d:5:last_updated' has been added.
2018-12-28 13:32:02.084 [.ItemChannelLinkAddedEvent] - Link 'TabLiving_Bat-hue:0830:0017882e7a2d:5:battery_level' has been added.
2018-12-28 13:32:02.106 [vent.ItemStateChangedEvent] - TabLiving_lastUpdated changed from NULL to 2018-12-28T12:16:57.000+0100
2018-12-28 13:32:02.126 [.ItemChannelLinkAddedEvent] - Link 'TabLiving_lowBat-hue:0830:0017882e7a2d:5:battery_low' has been added.
2018-12-28 13:33:45.569 [vent.ItemStateChangedEvent] - TabLiving_lastUpdated changed from 2018-12-28T12:16:57.000+0100 to 2018-12-28T13:33:44.000+0100
2018-12-28 13:33:47.424 [vent.ItemStateChangedEvent] - TabLiving_lastUpdated changed from 2018-12-28T13:33:44.000+0100 to 2018-12-28T13:33:46.000+0100
2018-12-28 13:33:49.363 [vent.ItemStateChangedEvent] - TabLiving_lastUpdated changed from 2018-12-28T13:33:46.000+0100 to 2018-12-28T13:33:48.000+0100
2018-12-28 13:33:51.415 [vent.ItemStateChangedEvent] - TabLiving_lastUpdated changed from 2018-12-28T13:33:48.000+0100 to 2018-12-28T13:33:50.000+0100

2018-12-28 13:32:02.169 [vent.ChannelTriggeredEvent] - hue:0830:0017882e7a2d:5:dimmer_switch_event triggered 34.0
2018-12-28 13:32:02.212 [vent.ChannelTriggeredEvent] - hue:0830:0017882e7a2d:5:dimmer_switch_event triggered 34.0
2018-12-28 13:33:45.100 [vent.ChannelTriggeredEvent] - hue:0830:0017882e7a2d:5:dimmer_switch_event triggered 16.0
2018-12-28 13:33:47.402 [vent.ChannelTriggeredEvent] - hue:0830:0017882e7a2d:5:dimmer_switch_event triggered 17.0
2018-12-28 13:33:49.342 [vent.ChannelTriggeredEvent] - hue:0830:0017882e7a2d:5:dimmer_switch_event triggered 18.0
2018-12-28 13:33:51.394 [vent.ChannelTriggeredEvent] - hue:0830:0017882e7a2d:5:dimmer_switch_event triggered 34.0

The remote went offline after a few seconds, will do more tests tomorrow. Thanks so far :+1:

Here are my findings:

The tap_switch_event channel reflects every button press on all of the four available buttons with the correct numbers.
The last_updated channel contains the correct DateTime events for the button presses.
The tap_switch channel does not get any state updates.
The battery_level and battery_low channels don’t get anything because the Tap Remote does not have a battery :grinning: It is powered by kinetic energy when pressing the buttons.

2018-12-29 08:45:05.196 [vent.ItemStateChangedEvent] - TabLiving_lastUpdated changed from 2018-12-29T07:41:25.000+0100 to 2018-12-29T08:45:04.000+0100
2018-12-29 08:45:05.218 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882e7a2d:5' has been updated.
2018-12-29 08:45:06.721 [vent.ChannelTriggeredEvent] - hue:0830:0017882e7a2d:5:dimmer_switch_event triggered 17.0
2018-12-29 08:45:06.742 [vent.ItemStateChangedEvent] - TabLiving_lastUpdated changed from 2018-12-29T08:45:04.000+0100 to 2018-12-29T08:45:05.000+0100
2018-12-29 08:45:06.763 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882e7a2d:5' has been updated.
2018-12-29 08:45:07.756 [vent.ChannelTriggeredEvent] - hue:0830:0017882e7a2d:5:dimmer_switch_event triggered 16.0
2018-12-29 08:45:07.776 [vent.ItemStateChangedEvent] - TabLiving_lastUpdated changed from 2018-12-29T08:45:05.000+0100 to 2018-12-29T08:45:07.000+0100
2018-12-29 08:45:07.799 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882e7a2d:5' has been updated.
2018-12-29 08:45:08.840 [vent.ChannelTriggeredEvent] - hue:0830:0017882e7a2d:5:dimmer_switch_event triggered 34.0
2018-12-29 08:45:08.862 [vent.ItemStateChangedEvent] - TabLiving_lastUpdated changed from 2018-12-29T08:45:07.000+0100 to 2018-12-29T08:45:08.000+0100
2018-12-29 08:45:08.883 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882e7a2d:5' has been updated.

What I did notice though: after a while the Things goes offline, but still the channels get state updates when pressing the buttons. As the device does not have a power source to provide any updates to the openHAB system while not in use for a longer period of time I guess this is normal behaviour.
Summary: It is working and a great enhancement for openHAB as you can now use the Tap remote as a gerneral purpose remote. Thanks a lot for that :+1::+1:

Edit: hold on, made a small mistake using the wrong itemtype, update is in progress :sunglasses:
2nd Edit: after using the correct itemtype Number instead of Switch for the tap_switch channel my above statement is still valid: tap_switch channel does not get any state updates.

1 Like

Thank you very much for testing. I will remove the battery channels and figure out why the event state was not updated.

1 Like

If other users want to test, here is a simple rule to catch the events:

rule "Hue Tap Remote"
when
	Channel "hue:0830:yxyxyxyxyxyxyx:5:dimmer_switch_event" triggered
then
	logInfo("EXTRA", "HUE Tap Remote switch event {}", receivedEvent)
	switch(receivedEvent.getEvent()) {
		case "34.0": {
		logInfo("EXTRA","HUE: Button 1 triggered")
			//do other stuff
		}		
		case "16.0": {
		logInfo("EXTRA","HUE: Button 2 triggered")
			//do other stuff
		}
		case "17.0": {
		logInfo("EXTRA","HUE: Button 3 triggered")
			//do other stuff
		}	
		case "18.0": {
		logInfo("EXTRA","HUE: Button 4 triggered")
			//do other stuff
		}
	}
end
1 Like

I tested the binding as well (still with the battery channels included). Discovery:

[el.core.internal.ModelRepositoryImpl] - Loading model 'hue.things'
[g.discovery.internal.PersistentInbox] - Added new thing 'hue:0830:xxxxxxxxxxxx:20' to inbox.
[g.discovery.internal.PersistentInbox] - Added new thing 'hue:0830:xxxxxxxxxxxx:32' to inbox.
[el.core.internal.ModelRepositoryImpl] - Refreshing model 'hue.things'

Pressing the buttons gives the following log entries (using the rules example from @sihui):

[eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:xxxxxxxxxxxx:tap_dining:dimmer_switch_event triggered 16.0
[eclipse.smarthome.model.script.EXTRA] - HUE: Button 2 triggered
[eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:xxxxxxxxxxxx:tap_dining:dimmer_switch_event triggered 34.0
[eclipse.smarthome.model.script.EXTRA] - HUE: Button 1 triggered
[eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:xxxxxxxxxxxx:tap_dining:dimmer_switch_event triggered 18.0
[eclipse.smarthome.model.script.EXTRA] - HUE: Button 4 triggered
[eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:xxxxxxxxxxxx:tap_dining:dimmer_switch_event triggered 17.0
[eclipse.smarthome.model.script.EXTRA] - HUE: Button 3 triggered
[eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:xxxxxxxxxxxx:tap_dining:dimmer_switch_event triggered 18.0
[eclipse.smarthome.model.script.EXTRA] - HUE: Button 4 triggered

As I am not using PaperUI, all configuration was done in .things and .items files.
An example hue.things file entry for on of my Tap’s look like:

Bridge hue:bridge:xxxxxxxxxxxx [ipAddress="192.168.1.98", userName="<secret>", sensorPollingInterval=200, pollingInterval=5 ]
{
    ...
    0830 tap_dining [sensorId="32"]
    ....
}

And my hue.items for this Tap:

// Tap Switch Dining
Switch   TS_DiningSwitch    "Tap Switch Dining room"                                        {channel="hue:0830:xxxxxxxxxxxx:tap_dining:tap_switch"}
DateTime TS_DiningLastUpd   "Detected [%1$tH:%1$tM:%1$tS]"                                  {channel="hue:0830:xxxxxxxxxxxx:tap_dining:last_updated"}

Looks promising. Great job @cweitkamp

I uploaded a new test version here.

One thing you have to change after installing the new test version is the trigger of the event: hue:0830:yxyxyxyxyxyxyx:5:tap_switch_event. It will be named tap_switch_event instead of dimmer_switch_event in the future.

2 Likes

You are the man of the day :grinning::+1:

2018-12-29 13:32:56.468 [vent.ItemStateChangedEvent] - TabLiving_Sw changed from NULL to 34.0
2018-12-29 13:34:27.649 [vent.ItemStateChangedEvent] - TabLiving_Sw changed from 34.0 to 16.0
2018-12-29 13:34:29.300 [vent.ItemStateChangedEvent] - TabLiving_Sw changed from 16.0 to 17.0
2018-12-29 13:34:30.379 [vent.ItemStateChangedEvent] - TabLiving_Sw changed from 17.0 to 18.0
2018-12-29 13:34:32.558 [vent.ItemStateChangedEvent] - TabLiving_Sw changed from 18.0 to 34.0

2018-12-29 13:34:26.734 [vent.ChannelTriggeredEvent] - hue:0830:yxyxyxyxyxyxyx:5:tap_switch_event triggered 34.0
2018-12-29 13:34:27.679 [vent.ChannelTriggeredEvent] - hue:0830:yxyxyxyxyxyxyx:5:tap_switch_event triggered 16.0
2018-12-29 13:34:29.332 [vent.ChannelTriggeredEvent] - hue:0830:yxyxyxyxyxyxyx:5:tap_switch_event triggered 17.0
2018-12-29 13:34:30.560 [vent.ChannelTriggeredEvent] - hue:0830:yxyxyxyxyxyxyx:5:tap_switch_event triggered 18.0



29-Dez-2018 13:34:26.642 [INFO ] [org.eclipse.smarthome.model.script.EXTRA          ] - HUE Tap Remote switch event hue:0830:yxyxyxyxyxyxyx:5:tap_switch_event triggered 34.0
29-Dez-2018 13:34:27.652 [INFO ] [org.eclipse.smarthome.model.script.EXTRA          ] - HUE Tap Remote switch event hue:0830:yxyxyxyxyxyxyx:5:tap_switch_event triggered 16.0
29-Dez-2018 13:34:29.302 [INFO ] [org.eclipse.smarthome.model.script.EXTRA          ] - HUE Tap Remote switch event hue:0830:yxyxyxyxyxyxyx:5:tap_switch_event triggered 17.0
29-Dez-2018 13:34:30.381 [INFO ] [org.eclipse.smarthome.model.script.EXTRA          ] - HUE Tap Remote switch event hue:0830:yxyxyxyxyxyxyx:5:tap_switch_event triggered 18.0

Couldn’t agree more! :grin:
I can confirm that it is working quite well (as far as I can tell from a few tests).

For the record, the events.log, after installing the updated binding (I filtered out messages for Hue lamps and motion sensors):

2018-12-29 13:30:43.472 [hingStatusInfoChangedEvent] - 'hue:bridge:0017882ec5b3' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2018-12-29 13:30:43.511 [hingStatusInfoChangedEvent] - 'hue:0830:0017882ec5b3:tap_dining' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to UNINITIALIZED (BRIDGE_UNINITIALIZED)
2018-12-29 13:30:43.511 [hingStatusInfoChangedEvent] - 'hue:0830:0017882ec5b3:tap_kitchen' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to UNINITIALIZED (BRIDGE_UNINITIALIZED)
2018-12-29 13:30:43.564 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:30:43.564 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_kitchen' has been updated.
2018-12-29 13:30:43.877 [hingStatusInfoChangedEvent] - 'hue:bridge:0017882ec5b3' changed from INITIALIZING to ONLINE
2018-12-29 13:30:43.939 [hingStatusInfoChangedEvent] - 'hue:0830:0017882ec5b3:tap_dining' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2018-12-29 13:30:43.944 [hingStatusInfoChangedEvent] - 'hue:0830:0017882ec5b3:tap_kitchen' changed from INITIALIZING to ONLINE
2018-12-29 13:30:43.945 [hingStatusInfoChangedEvent] - 'hue:0830:0017882ec5b3:tap_kitchen' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2018-12-29 13:30:43.949 [hingStatusInfoChangedEvent] - 'hue:0830:0017882ec5b3:tap_dining' changed from INITIALIZING to ONLINE
2018-12-29 13:30:43.949 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_kitchen' has been updated.
2018-12-29 13:30:43.950 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_kitchen' has been updated.
2018-12-29 13:30:43.950 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_kitchen' has been updated.
2018-12-29 13:30:43.951 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_kitchen' has been updated.
2018-12-29 13:30:43.951 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_kitchen' has been updated.
2018-12-29 13:30:43.951 [hingStatusInfoChangedEvent] - 'hue:0830:0017882ec5b3:tap_kitchen' changed from ONLINE to OFFLINE: Hue bridge reports sensor as not reachable.
2018-12-29 13:30:43.952 [vent.ChannelTriggeredEvent] - hue:0830:0017882ec5b3:tap_kitchen:tap_switch_event triggered 17.0
2018-12-29 13:30:43.952 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_kitchen' has been updated.
2018-12-29 13:30:43.984 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:30:43.985 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:30:43.986 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:30:43.987 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:30:43.988 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:30:43.991 [hingStatusInfoChangedEvent] - 'hue:0830:0017882ec5b3:tap_dining' changed from ONLINE to OFFLINE: Hue bridge reports sensor as not reachable.
2018-12-29 13:30:43.991 [thome.event.ItemStateEvent] - TS_DiningSwitch updated to ON
2018-12-29 13:30:43.992 [vent.ChannelTriggeredEvent] - hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 18.0
2018-12-29 13:30:43.992 [thome.event.ItemStateEvent] - TS_DiningLastUpd updated to 2018-12-29T12:15:36.000+0100
2018-12-29 13:30:43.994 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:30:43.994 [vent.ItemStateChangedEvent] - TS_DiningSwitch changed from NULL to ON
...
2018-12-29 13:33:44.081 [thome.event.ItemStateEvent] - TS_DiningSwitch updated to ON
2018-12-29 13:33:44.082 [vent.ChannelTriggeredEvent] - hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 16.0
2018-12-29 13:33:44.083 [thome.event.ItemStateEvent] - TS_DiningLastUpd updated to 2018-12-29T13:33:44.000+0100
2018-12-29 13:33:44.084 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:33:44.085 [vent.ItemStateChangedEvent] - TS_DiningLastUpd changed from 2018-12-29T12:15:36.000+0100 to 2018-12-29T13:33:44.000+0100
2018-12-29 13:33:45.261 [thome.event.ItemStateEvent] - TS_DiningSwitch updated to ON
2018-12-29 13:33:45.262 [vent.ChannelTriggeredEvent] - hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 34.0
2018-12-29 13:33:45.264 [thome.event.ItemStateEvent] - TS_DiningLastUpd updated to 2018-12-29T13:33:45.000+0100
2018-12-29 13:33:45.265 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:33:45.266 [vent.ItemStateChangedEvent] - TS_DiningLastUpd changed from 2018-12-29T13:33:44.000+0100 to 2018-12-29T13:33:45.000+0100
2018-12-29 13:33:46.577 [thome.event.ItemStateEvent] - TS_DiningSwitch updated to ON
2018-12-29 13:33:46.577 [vent.ChannelTriggeredEvent] - hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 18.0
2018-12-29 13:33:46.579 [thome.event.ItemStateEvent] - TS_DiningLastUpd updated to 2018-12-29T13:33:47.000+0100
2018-12-29 13:33:46.580 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:33:46.581 [vent.ItemStateChangedEvent] - TS_DiningLastUpd changed from 2018-12-29T13:33:45.000+0100 to 2018-12-29T13:33:47.000+0100
2018-12-29 13:33:48.123 [thome.event.ItemStateEvent] - TS_DiningSwitch updated to ON
2018-12-29 13:33:48.124 [vent.ChannelTriggeredEvent] - hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 17.0
2018-12-29 13:33:48.125 [thome.event.ItemStateEvent] - TS_DiningLastUpd updated to 2018-12-29T13:33:48.000+0100
2018-12-29 13:33:48.126 [me.event.ThingUpdatedEvent] - Thing 'hue:0830:0017882ec5b3:tap_dining' has been updated.
2018-12-29 13:33:48.127 [vent.ItemStateChangedEvent] - TS_DiningLastUpd changed from 2018-12-29T13:33:47.000+0100 to 2018-12-29T13:33:48.000+0100

The openhab.log after installing the new binding and updating the test rule:

2018-12-29 13:32:21.598 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'hue.rules'
...
2018-12-29 13:33:44.095 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 16.0
2018-12-29 13:33:44.096 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE: Button 2 triggered
2018-12-29 13:33:45.266 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 34.0
2018-12-29 13:33:45.267 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE: Button 1 triggered
2018-12-29 13:33:46.579 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 18.0
2018-12-29 13:33:46.580 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE: Button 4 triggered
2018-12-29 13:33:48.125 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 17.0
2018-12-29 13:33:48.126 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE: Button 3 triggered
...
2018-12-29 13:54:21.844 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 16.0
2018-12-29 13:54:21.846 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE: Button 2 triggered
2018-12-29 13:54:22.708 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 17.0
2018-12-29 13:54:22.709 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE: Button 3 triggered
2018-12-29 13:54:23.780 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 34.0
2018-12-29 13:54:23.781 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE: Button 1 triggered
2018-12-29 13:54:25.133 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE Tap Remote switch event hue:0830:0017882ec5b3:tap_dining:tap_switch_event triggered 18.0
2018-12-29 13:54:25.135 [INFO ] [eclipse.smarthome.model.script.EXTRA] - HUE: Button 4 triggered

I pressed the Hue Tap switches twice with some time in between and there were no errors or devices going offline as far as I can tell from the logs.

UPDATE: This makes me longing for an update that handles scenes… :innocent::wink:

1 Like

Nice. Sounds good.

May I ask for your use-cases? Now I am eager to make something really smart. Integration of the Hue Tap Switch was straight forward. Now I would like to implement a Profile which can be used with it. Are you already familiar with Profiles? To summarize it: A profile is similar to a rule and a lot faster.

One of my ideas: Use it as a simple remote control for you music / tv / etc.

I have a Kodi instance and a couple of bulbs for ambilght. Press “Button 1” turns ON and OFF the bulbs or starts playing my favorite radio station. Press “Button 3” triggers a PLAY/PAUSE command for Kodi. Press “Button 2” or “Button 4” increases/decreases the volume.

One of my first use cases will be ‘integration’ with my alarm system; e.g. when I press Button 1 the lights will just turn off, but when I press Button 3 the alarm will also be triggered after 60 seconds.

Anoher use case I have in mind is a ‘go to bed’ scenario. I don’t always want to talk to an Echo device, but just press a button to trigger a series of events, like step by step dimming and finally turning off lights, close blinds, turn on the alarm, and turn on the bedroom lights.

I am not yet familiar with profiles. So far, just read about it…

UPDATE: To clarify my use cases a lttle… my Taps are mounted ‘in wall’ behind Busch-Jaeger frames and not stand-alone like they are sold by Philips.

My Hue Tab is already paired with some Hue bulbs. But I would use Button1 to turn on or off another bulb in the same room. All I need is a simple rule that I have already programmed.

Unfortunately I do not know anything about profiles, could you briefly explain them?

For all other simple ON/OFF switching I use “Amazon Dash Buttons”, they are cheaper.

Did you read the documentation behind the link I posted above?

Yes, I read it. And now I read it once again. Could be a good alternative for using rules. Thanks. And the hue binding does not provide profiles, yet?

No, the Hue binding does not have specific profiles yet. The profiles listed in the documentation are system profiles which can be used on any item link you like.

Now my idea is to introduce a Hue specific profile for the Dimmer Switch and Tap Switch. It would allow you to omit the rule but offers a very flexible way to configuring it for your purpose.

2 Likes