Typically, single tap would control the light and as a result send an event on the appropriate command class, not a node event. Node event is the fallback for when the class isn’t available/defined.
Do you see this being an enhancement for HASS or OpenZwave, or is this a device firmware issue? If the latter, I’ll reach out to Jasco to ask them about their implementation and if they are planning any updates (these are Zwave Plus after all).
Likely not a firmware issue. If openzwave has the data available it would be a fairly easy change to add it into HASS, if not you’d need to get it added into openzwave first. A good start would be to up the openzwave logging level to debug and go through the switch options to see what kind of traffic is being recognized/handled by openzwave.
(Using 0.60.0) Wanted to correct one small thing: the object_id
isn’t a part of the event_data
. Instead you’ll want to use something like entity_id: zwave.kitchen_light
.
The full event data looks something like this:
{"event_type": "zwave.node_event", "data": {"entity_id": "zwave.kitchen_light", "node_id": 16, "basic_level": 255}, "origin": "LOCAL", "time_fired": "2017-12-30T03:21:22.616072+00:00"}
Wanted to summarize this whole process for future readers. In short this works great using HA as-is and there’s no need for any modifications of the OpenZWave or HA software. Also worth noting is that if you have an add-on switch it will also properly work for double-tap if the main switch is configured for double-tap.
- 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
- Add an automation that triggers on the double-tap event. The
entity_id
will be something likezwave.kitchen_light
. Thebasic_level
will255
when the top of the switch is double-tapped, and will be0
when the bottom is double-tapped. An example:
- id: notify_on_double_tap_on_of_kitchen_lights
alias: Kitchen lights double-tapped on
trigger:
# Trigger on double-tap of kitchen lights
- platform: event
event_type: zwave.node_event
event_data:
entity_id: zwave.kitchen_light
basic_level: 255
action:
- service: notify.john_doe
data:
message: 'Kitchen light switch double tapped on'
Pitfalls and debugging:
- If you only see
Group 1
in your associate groups then you either aren’t using the new Z-Wave Plus version of the GE light switches, or you have some of the earlier versions of the Z-Wave Plus switches (same model #) which have an earlier firmware. Unfortunately there doesn’t appear to be a way to update this firmware as of now. - If double tap works, but one switch triggers multiple double-tap automations, double check your
entity_id
matches properly (and make sure not to useobject_id
). - If you want to see the event data, including the entity ID, set your logger level to
debug
inconfiguration.yaml
and double-tap the switch. Search the home-assistant.log for"zwave.node_event"
- If you’re not seeing double-tap events in the OpenZWave log (OZW_Log.txt) then make sure your controller is properly associated with Group 3 for the switch you’re trying to double tap (see (1) above).
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'
Just add to this, I have some of the 26933 Smart Motion Dimmer switches and this works with these as well.
Awesome work guys. Question: above it says that the double-tap should work with an add-on switch. I have this working great at the master switch but a double-tap on the add-on in a two-way doesn’t work.
Am I missing something?
- id: turn_off_basement_stairs_light_double_tap_turn_off_basement_lights
alias: Basement Stairs lights double-tapped off
trigger:
# Trigger off double-tap of basement stairs lights
- platform: event
event_type: zwave.node_event
event_data:
entity_id: zwave.basement_stairs_light
basic_level: 0
action:
- service: homeassistant.turn_off
entity_id: group.basement_lights
Noone else has run into this? Or does it just not function with the addon switch? It’s a 12723 if that matters.
Yep, same thing for me. I have a 14291 on/off switch with a 12723 add-on switch. The double tap works on the 14291 but not on it’s 12723 add-on partner.
Same here. Was really hoping to make the double-tap work for all of my n-way setups.
My Appdaemon app works for me with add-on switches. I basically duplicated the automation code into appdaemon so I don’t know why it wouldn’t work for you guys.
Man I really don’t want to go down the AppDaemon rabbit hole to get this working!
To top it off my double-tap scenes just up and quit working as a few days ago. First one stopped and then the other stopped a day or so later.
Tried re-associating but so far no dice. Don’t even see the automation being triggered in the log.
I have mine working using the standard YAML (no AppDaemon). The main switches have two variants as mentioned, and the older ones don’t support double-tap. I wonder if that’s also true of the add-on switches. If you have a another add-on switch, you might try swapping to see if that helps,.
Anybody doing this with node-red yet? I’m trying to figure out where to find the zwave.node_event trigger is.
Found it. Had to use the events: all node instead of the events: state node. Only trouble is the node receives all HomeAssistant events and you have to filter the specific one you want.
Edit: For some reason I can’t filter the zwave.node_event topic, or any other topics for that matter, i.e. using a switch node where msg.topic == zwave.node_event
Edit2: Working. Honestly don’t know what happened, but a restart solved it.
Can you share your JSON code for Node Red? This is one of my last automations in YAML and I’d love to get it moved over.
Here you go. I hope it helps:
[{"id":"c8a9938a.b2c3c8","type":"server-events","z":"6bbf42c0.fcb1bc","name":"","server":"f053f2ed.c5201","x":140,"y":1560,"wires":[["41a7bf5f.caabb"]]},{"id":"41a7bf5f.caabb","type":"switch","z":"6bbf42c0.fcb1bc","name":"filter for zwave.node_event","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"zwave.node_event","vt":"str"}],"checkall":"true","outputs":1,"x":400,"y":1560,"wires":[["2077efae.d1576","35a4e8f5.b44d08","2d873e53.5a1b9a","11133c3a.c66fa4","d4bb3fdc.7b4ed","2a192cf8.f099e4","732cae.5e6a3b54","d801f370.236218","1b2bc1af.bc9be6","ed45ded4.a4692","1c722e53.39c442","7aba61ba.e73ce8","959c4661.6e6418","599cf7c6.872f78"]]},{"id":"d801f370.236218","type":"switch","z":"6bbf42c0.fcb1bc","name":"filter bedroom_north_back_bedroom","property":"payload.entity_id","propertyType":"msg","rules":[{"t":"eq","v":"zwave.bedroom_north_back_bedroom","vt":"str"}],"checkall":"true","outputs":1,"x":770,"y":1560,"wires":[["76ffe05c.bfa"]]},{"id":"76ffe05c.bfa","type":"api-current-state","z":"6bbf42c0.fcb1bc","name":"Bedroom north back bedroom light on?","server":"f053f2ed.c5201","halt_if":"off","entity_id":"light.bedroom_north_back_bedroom_level","x":1136,"y":1560,"wires":[["da27bc4c.794f38"]]},{"id":"da27bc4c.794f38","type":"api-call-service","z":"6bbf42c0.fcb1bc","name":"Turn light on to lowest dim","server":"f053f2ed.c5201","service_domain":"light","service":"turn_on","data":"{\"entity_id\": \"light.bedroom_north_back_bedroom_level\", \"brightness\": \"30\"}","x":1469,"y":1560,"wires":[]},{"id":"732cae.5e6a3b54","type":"switch","z":"6bbf42c0.fcb1bc","name":"filter bedroom_north_middle_bedroom","property":"payload.entity_id","propertyType":"msg","rules":[{"t":"eq","v":"zwave.bedroom_north_middle_bedroom","vt":"str"}],"checkall":"true","outputs":1,"x":770,"y":1500,"wires":[["96f58b00.97426"]]},{"id":"96f58b00.97426","type":"api-current-state","z":"6bbf42c0.fcb1bc","name":"Bedroom north middle bedroom light on?","server":"f053f2ed.c5201","halt_if":"off","entity_id":"light.bedroom_north_middle_bedroom_level","x":1136,"y":1500,"wires":[["f1146d5f.3be7a"]]},{"id":"f1146d5f.3be7a","type":"api-call-service","z":"6bbf42c0.fcb1bc","name":"Turn light on to lowest dim","server":"f053f2ed.c5201","service_domain":"light","service":"turn_on","data":"{\"entity_id\": \"light.bedroom_north_middle_bedroom_level\", \"brightness\": \"30\"}","x":1469,"y":1500,"wires":[]},{"id":"f053f2ed.c5201","type":"server","z":"","name":"Home Assistant","url":"http://10.0.3.1:8123","pass":"admin13667"}]
Is there another automation for the actual double-tap detection and actions?
You have to configure the switch in zwave config first. The above flow starts with a node that listens for all HomeAssistant events. It filters the double tap event then creates an automation for the switch to turn the light on to the lowest dim for nightlight use.