Remote Controls

This plugin supports several remote controls. And the number will grow in the near future as more devices come available. If you have a remote control that is not yet known by the plugin, let the author know and give him as much information as possible on the new sensor.
You can start a scan for new sensors on the configuration page of the plugin. Once pressed, you need to reset the remote control sensor to be be recognised by the bridge or gateway. A remote control sensor can come preconfigured for a set of lights. In that case first follow the brands usage guide for a complete reset of the sensor before trying to connect it to the bridge or gateway. when using a remote control sensor on the Philips bridge, respons is slower compared to having the remote control sensor on a RaspBee/ConBee gateway. This is because the Philips Hue bridge needs to be polled before the plugin can see the change, where te gateways forward the change directly to the plugin when a change happens.
The supported remote controls known to the plugin are:

  • Dimmer Switch
  • IKEA Tradfri Remote
  • Hue Tap
  • Xiaomi Mi Smart Cube

Dimmer Switch

This remote is recognised by the plugin and creates several possible button values for the devices. Each button has 3 possible values:

  1. Button standard like On
  2. Button longer press like On holding
  3. Button release like On released - but seems to be missed often

With these values you can be creative with the events, more then you'd expect!

IKEA Tradfri Remote

This remote is recognised by the plugin and creates several possible button values for the devices. Each button, except the center button, has 3 possible values:

  1. Button standard like Dim up
  2. Button longer press like Dim up holding
  3. Button release like Dim up released

With these values you can be creative with the events, more then you'd expect!

The center button is a toggle button for on/off like actions, which comes with only one value.

Xiaomi Mi Smart Cube

Seen from the outside, teh Xiamomi Mi smart cube hardly looks like a remote. But this device listens to gestures. Rotate it, shift it a bit, shake it, double tap or just move another side up. Each action sends a reaction to the plugin. 38 known statusses and the rotation in a seperate device (360 degrees to - 360 degrees) can be used as triggers.

Play it! You might like it.

Hue Tap

If the plugin finds a tap connected to a bridge, a device will be created that will show the last known buttonpress of the device
In a previous version of the plugin it was possible to create rules for the Tap with some special functions like switching a scene off when the same button was pressed. This has been removed. This is also possible with the following sample script and event.
With this script an “on”event will be triggerd on a button press. Is another button pressed, then the “on” event is triggered. Is the same button then pressed again, the “off” event will be triggered. Of course the events do not necessary have to perform on or off, they can be any event really.
For this event to work properly, you have to make sure te disable the dreadfull device option “Do not update device last change time if device value does not change”. Otherwise a second press on a button won't trigger…

The events I am using are created in a way that they trigger other events based on daytime and nighttimes or dark or light. This enables me to trigger many different events based on wat you need (even or odd days?, Holiday or normal day, etc).

Copy the below script and save it as CheckTap.vb in the scripts directory of your HS3 instalation. You could remove the line with hs.writelog if you do not want this.

Imports System.Collections.Generic
 
Sub Main(Parms As Object)
    Dim Tap As String = Parms
    Dim DevValues As New dictionary(Of String, String) From {
        {34, 1}, {16, 2}, {17, 3}, {18, 4}}
    Dim TapDevice As String = hs.GetINISetting("Taps", Tap, "Error!!", "Taps.ini")
    Dim Currentvalue As Integer = hs.devicevaluebyname(TapDevice)
    Dim VarError As String = hs.CreateVar(Tap)
    If VarError = "" Then hs.SaveVar(Tap, "0") ' Variable has been new created, fill with not set value
    Dim LastTap As String = hs.GetVar(Tap)
    Dim Selection As String = If(Currentvalue = LastTap, "_off", "_on")
    Dim Button As String = "Button" & DevValues(Currentvalue)
 
    hs.triggerevent(hs.getinisetting(Button, Tap & Selection, "", "taps.ini"))
    hs.writelog("Check Tap", TapDevice & " triggered " & hs.getinisetting(Button, Tap & Selection, "", "taps.ini"))
    hs.savevar(Tap, If(Currentvalue = LastTap, "0", Currentvalue))
End Sub

Copy the below text to an INI file named “taps.ini” and place it in the config direcotry of your HS3 installation. Make sure you replace the name of the tap with the name you are using in your system, as well as the correct eventnames. You can add as many taps as you like.


[Taps]
; in taps add a descriptive name as key... this is the parameter you need to use in the event calling this script
TAP1=JowiHue JowiHue Wims Tapje

[Button1]
; in this section put the name of each event you want to trigger when  button 1 is pressed
; the key name should be the name of the key used in section Taps with _on or _off added to it.
TAP1_on=Painting on Color
TAP1_off=Painting Color off

[Button2]
; in this section put the name of each event you want to trigger when  button 2 is pressed
; the key name should be the name of the key used in section Taps with _on or _off added to it.
TAP1_on=Beyond Evening
TAP1_off=Beyond off

[Button3]
; in this section put the name of each event you want to trigger when  button 3 is pressed
; the key name should be the name of the key used in section Taps with _on or _off added to it.
TAP1_on=Ganglamp aan
TAP1_off=Ganglamp uit

[Button4]
; in this section put the name of each event you want to trigger when  button 4 is pressed
; the key name should be the name of the key used in section Taps with _on or _off added to it.
TAP1_on=Hallway Go Color
TAP1_on=Hallway Go off

And create one event per tap like this: