I’ve read that level=255 is double tap up, and level=0 is double tap down.
I’m hopeful that someone can help with syntax for an automation to use the attribute.
I assume platform: state is correct, but how do I point to the “level” being presented?
The below was my first attempt, but it fails a config check:
automation:
- alias: 'Basement DBLTap Up'
trigger:
- platform: state
entity_id: states.zwave.basement_light.attributes["level"] <-- Not sure what to use to get the "level" attribute.
to: '255'
action:
- service: homeassistant.turn_on
entity_id: group.basement_lights
- alias: 'Basement DBLTap Down'
trigger:
- platform: state
entity_id: states.zwave.basement_light.level <-- Not sure what to use to get the "level" attribute.
to: '0'
action:
- service: homeassistant.turn_off
entity_id: group.basement_lights
I have double tap working on these switches in SmartThings via the nuttytree device handler:
I dug into that DTH to determine that it uses association group 3, and that level 255 = up and 0 = down… I just don’t know how to get an automation to read the event in hass.
Once fixed, I can move my GE dimmers from MQTT through ST over to native hass.
Check to see if any of your something.basement_light entities change when you double tap. From what @sephtin said, I suspect you need to go into the Z-Wave control panel (under Configuration) and associate group 3 with your controller (under Node group associations) before any entities will change.
@Tinkerer
Spoke to you on Discord, per our conversation… I did associate the controller to the switch on Group3. Before I did that double tapping didn’t show up in the logs at all. After associating the controller, I get the following in the OZW_Log file:
The “level=255” is double tap up and double tap down results in “level=0”. I believe the suggestion you had, was that because I can see it in the logs but no state changes show in the device in hass.under dev -> States, that a change to the zwcfg file will be required… is that correct?
Are there docs on how to determine what needs to be added to pass the event received and shown in the logs to a state?
Just making sure I"m not missing something…
Edit:
The link you sent me was helpful:
But I would need some details to get started (or a pointer to where I can find such details).
What command class would this fall under? If I knew what command class, I’d give a shot to setting a variable for the “level” that’s being passed.
Based on the log capture in the first post you should be triggering on the zwave.node_event in home assistant. Look at the docs defintion here: https://home-assistant.io/docs/z-wave/events/
Here’s an example using node_event in an automation:
- alias: "Control living room lights from switch - Day On"
trigger:
platform: event
event_type: zwave.node_event
event_data:
object_id: "zwave.node_11"
action:
- service: light.turn_on
data:
entity_id: light.lvlights_10
brightness: 255
That works great! I was also able to differentiate the double tap up and double tap down events by adding “basic_level: 255” for up or “basic_level: 0” for down in the event_data portion of the trigger.
Is it possible to differentiate the node events from single-tap vs. double-tap? In my experience, if you have both Association Groups configured to communicate to HASS, the events look identical. A single-tap up would send basic_level: 255, and a double-tap up would send basic_level: 255 - they would trigger the same automations. What if you want them to trigger different automations?
Is there any way to include the Association Group as a condition in a trigger?? Perhaps this is a feature request?
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.
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 like zwave.kitchen_light. The basic_level will 255 when the top of the switch is double-tapped, and will be 0 when the bottom is double-tapped. An example:
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 use object_id).
If you want to see the event data, including the entity ID, set your logger level to debug in configuration.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')
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.