Great info! I took your findings and put together an AppDaemon app.
import appdaemon.plugins.hass.hassapi as hass
#
#
# SETUP
# https://community.home-assistant.io/t/ge-14294-and-jasco-equivilant-zwave-dimmer-double-tap-event-on-associaton-group-3-need-config-help/29469/17
#
# Forward double-tap events to your controller. In the Z-Wave configuration panel of HA:
# Select the node for the light switch you want to enable double-tap on.
# Under Node group associations select Group 3.
# Under Node to control select your Z-Wave USB stick (or whatever Z-Wave controller you use).
# Hit Add to Group
#
#
# Args:
# entities:
# - entity: Zwave entity to monitor for double tap.
# events:
# - tap_up: List of actions to fire on double tap up.
# - action_entity: Entity to perform action on. Ex: light.living_room_light
# action: Action to perform. 'on' or 'off'
# - tap_down: List of actions to fire on double tap down.
# - action_entity: Entity to perform action on. Ex: light.living_room_light
# action: Action to perform. 'on' or 'off'
#
# NOTE: the triggering entity does not turn on by default and will need to be added as an action_entity if you would like it to.
#
#
# FULL EXAMPLE
#
# Double Tap Switch:
# class: zwave_double_tap
# module: zwave_double_tap
# entities:
# - entity: zwave.island_lights
# events:
# - tap_up:
# - action_entity: light.living_room_light_level
# action: 'on'
# - action_entity: light.living_room_lamp_level
# action: 'on'
# - tap_down:
# - action_entity: light.living_room_light_level
# action: 'off'
#
#
# Version 1.0:
# Initial Version
class zwave_double_tap(hass.Hass):
def initialize(self):
self.utils = self.get_app('utils')
if "entities" in self.args:
for item in self.args["entities"]:
entity = item["entity"]
if "events" in item:
self.log("Monitoring {} for double tap.".format(
self.friendly_name(entity)), "INFO")
events = item["events"]
self.listen_event(
self.zwave_event, "zwave.node_event", entity_id=entity, events=events)
def zwave_event(self, event_name, data, kwargs):
basic_level = data["basic_level"]
events = kwargs["events"]
for event in events:
if "tap_up" in event and basic_level == 255:
direction = "Up"
msg = "{} event fired. ".format(direction)
for item in event["tap_up"]:
action_entity = item["action_entity"]
action = item["action"]
msg += "{} will be turned {}. ".format(
self.friendly_name(action_entity), action)
domain, entity = self.split_entity(action_entity)
if "fan" in domain:
fan_speed = self.get_state(action_entity, attribute="speed")
new_speed = self.utils.increment_fan_speed(fan_speed)
self.call_service("fan/set_speed", entity_id=action_entity, speed=new_speed)
else:
service = "{}/turn_{}".format(domain, action)
if action == "on" and domain == "light":
self.call_service(
service, entity_id=action_entity, brightness_pct="100")
else:
self.call_service(service, entity_id=action_entity)
self.log(msg, "INFO")
if "tap_down" in event and basic_level == 0:
direction = "Down"
msg = "{} event fired. ".format(direction)
for item in event["tap_down"]:
action_entity = item["action_entity"]
action = item["action"]
msg += "{} will be turned {}. ".format(
self.friendly_name(action_entity), action)
domain, entity = self.split_entity(action_entity)
if "fan" in domain:
fan_speed = self.get_state(action_entity, attribute="speed")
new_speed = self.utils.decrement_fan_speed(fan_speed)
self.call_service("fan/set_speed", entity_id=action_entity, speed=new_speed)
else:
service = "{}/turn_{}".format(domain, action)
if action == "on" and domain == "light":
self.call_service(
service, entity_id=action_entity, brightness_pct="100")
else:
self.call_service(service, entity_id=action_entity)
self.log(msg, "INFO")
In its current state this supports domains that work with the turn_on/turn_off service.
UPDATE: Support for stepping fan speed.
Requires utils.py
with the following functions:
class utils(hass.Hass):
def initialize(self):
self.log("initialized utils")
def increment_fan_speed(self, fan_speed):
"""
Increment fan speed one step.
"""
return {
'off': 'low',
'low': 'medium',
'medium': 'high'
}.get(fan_speed, 'high')
def decrement_fan_speed(self, fan_speed):
"""
Decrement fan speed one step.
"""
return {
'high': 'medium',
'medium': 'low',
'low': 'off'
}.get(fan_speed, 'off')
and an updated apps.yaml
entry:
Double Tap Switch:
class: zwave_double_tap
module: zwave_double_tap
dependencies: utils
entities:
## Step Fan Speed
- entity: zwave.living_room_fan
events:
- tap_up:
- action_entity: fan.living_room_fan_level
action: 'on'
- tap_down:
- action_entity: fan.living_room_fan_level
action: 'off'