Automation with Z-Wave output

I am a fairly new user (consider almost virgin) and I have Home Assistant running on a RPi 3b. It works well for the most part, and the more I learn the better it gets. I have just added an AEON Labs ZW096 Smart Switch 6 and it connected without any problems. I have set my system up to poll a few of the entities every 30 seconds and they work fine.

So I decided to create an automation using the data from the switch. Specifically the sensor.aeon_labs_zw096_smart_switch_6_current entity. Here is my automation:

- id: '1580840875204'
  alias: 'Coffee - Done: Lights On'
  description: Turn on lights when coffee has percolated
  trigger:
  - entity_id: sensor.aeon_labs_zw096_smart_switch_6_current
    for: 00:00:01
    from: '7.72'
    platform: state
    to: '0.41'
  condition: []
  action:
  - data:
      brightness_pct: 40
      color_name: linen
    entity_id: light.notification
    service: light.turn_on

So I measure the current and when it drops (changes) I want to turn a light on. This works if I manually refresh the node and the automation fires. However, when I do not intercede with manual refreshes, and even though the entity is reporting changes accurately (I can share the OZW_Log.txt if needed) and every 30 seconds, my automation doesn’t fire.

Is there a step I am missing to make the automation respond to the changes that the switch provides? Is there a better way to do this? Do I need to add a “condition”? If so, what should it be?

Thank you so much for any help or guidance you may provide.

You have a very specific condition to fire.

It has to go from exactly 7.72A to exactly 0.41A. I don’t think this is a likely thing to happen! It’s possible, but even if it goes from 7.71 to 0.41, it won’t fire. Or maybe it measures in between and goes from 7.71 to 3.11 to 0.41…this won’t fire either as you’ve told it “only from exactly X to exactly Y, nothing else”.

I would instead do above or below for the triggers.

- id: '1580840875204'
  alias: 'Coffee - Done: Lights On'
  description: Turn on lights when coffee has percolated
  trigger:
  - entity_id: sensor.aeon_labs_zw096_smart_switch_6_current
    platform: numeric_state
    below: 7.0
    for: "00:00:01"

This will only trigger when the sensor goes from above 7.0 to below 7.0 for 1 second. It will not fire every update if it is less than 7.0. It will only trigger when it goes from above to below the threshold!

This should give you the needed measurement tolerances to have it trigger.

Thank you! What you say makes a lot of sense. I will try your solution and see what happens.

Jim,

Thank you for the suggestion, it works better in that the automation turns on the light, but it does it as soon as the automation fires. Perhaps I will try using 6.0 as there could be flux at the 7.0 point. I will let you know

Yeah, and I would update the “for” time to be longer.

Maybe if it’s below 6 for 2 polling intervals, whatever you have that set to…though I’m not sure why this is a polling service. It should update right away, right?

I’d say “below 6.0 for 5 seconds” would probably be a safe way to determine that it is in fact, done.

1 Like

Thanks for your feedback. I set it to 5 with 1 polling interval for 1 second. In my test it worked, now we will see if it works tomorrow morning with my coffee!

Thank you so much for your help. I couldn’t have done it without your input

Yikes. Be careful setting such an aggressive polling interval. If you start noticing problems with your Z-Wave network, that’s going to be the first thing to consider.

Instead of polling, you might consider turning on notification reports instead. It looks like by default they are disabled. You would want to modify Parameter #101 to send the desired meter reports to Group 1 (the controller). I’m not sure if those are time based or not.

There is also parameter 90, which is off by default. If it set to on, then the device should send reports when the wattage changes by 25W or 5% (default values).

The manual is here, which explains the config parameters. The Z-Wave control panel also has help text.

1 Like

Thank you! My latest configuration did not work, so I am still looking for a workable solution. I will work with your suggestions and see if that will do it. Also, the link you provided does not work.

Again, thank you

It’ll be listed here then:

Spectacular. Thank you!

Ok, still not working. I have tried all the recommendations listed so far. The OZW_Log.txt shows it all working as it is supposed to. Reporting the values for the automation to find. That being said I get this error in my Home Assistant Log when I restart:

2020-02-06 12:14:30 WARNING (MainThread) [homeassistant.helpers.condition] 
Value cannot be processed as a number: <state
 switch.aeon_labs_zw096_smart_switch_6_switch_3=off; node_id=13, 
value_index=0, value_instance=1, value_id=72057594260832256, 
power_consumption=0.0, 
friendly_name=ZWave Switch 03 @ 2020-02-06T
12:14:30.058066-07:00> (Offending entity: off)

The value I entered is the range below in the Automation. It says I can use numbers (I used below 100), but I am wondering should I use Hexidecimal? Any other suggestions from anyone?

*edit the error information to appear without scrolling to the right

Have you posted the entire automation? The entity ID in the error message does not match anything listed so far.

First, thank you for your patience, advice and guidance. I truly appreciate it. Here is where I am at:
I turned on parameter 90 and parameter 101. Both seem to be working fine. I tried your suggestion to use numeric_state, but that held no joy. Most recently (after scouring the web) I used Device with the Power component being identified. Here is my automation:

- id: '1580840875204'
  alias: 'Coffee - Done: Lights On'
  description: Turn on lights when coffee has percolated
  trigger:
  - below: 100
    device_id: b3ab58bf36e8463781631ff4e0d77281
    domain: sensor
    entity_id: sensor.aeon_labs_zw096_smart_switch_6_power_3
    for:
      hours: 0
      minutes: 0
      seconds: 1
    platform: device
    type: value
  condition: []
  action:
  - data:
      brightness_pct: 40
      color_name: red
    entity_id: light.notification
    service: light.turn_on

This hasn’t worked either. The interesting thing is that when I restart Home Assistant the light comes on!

Just a thought, could the error be caused by the automation.yaml checking the validity of the process and finding an error because ZWave has not spooled up yet?

Let me answer my own query. No, that is not the cause. I reloaded automations after ZWave network was working and still got the error

Eureka! It worked. Thank you so much @freshcoast and @jocnnor! If it wasn’t for your help I would still be pulling my hair out.

For information in case anyone else tries this: I set parameter 90 to allow the data and set parameter 101. Automation that worked:

- id: '1580840875204'
  alias: 'Coffee - Done: Lights On'
  description: Turn on lights when coffee has percolated
  trigger:
  - below: 100
    device_id: b3ab58bf36e8463781631ff4e0d77281
    domain: sensor
    entity_id: sensor.aeon_labs_zw096_smart_switch_6_power_3
    for:
      hours: 0
      minutes: 0
      seconds: 1
    platform: device
    type: value
  condition: []
  action:
  - data:
      brightness_pct: 40
      color_name: red
    entity_id: light.notification
    service: light.turn_on

Also, I re-added my zwave devices to clear anything that may have been remaining from all my trials and errors.

1 Like