Disable Motion Sensor At Night

I have a GE Z-Wave Plus Smart Lighting Control Motion Sensor Dimmer Switch, In-Wall, Vacancy / Occupancy Sensor 26933 that I want to install in my Master Bath. I need to be be able to disable the motion sensor and/or light during the night as I don’t want/need the light to come on when I get up in the middle of the night to use the bathroom (I have a night light). Is there an easy way to add a time condition to my Zwave config to simply disable the light say between 21:00-4:00?

Yes, there probably is.

And if you share the code you’re using at the moment somebody might actually be able to tell you how to achieve it.

Without the code it would be a huge stab in the dark.

  • alias: Disable Motion
    trigger:
    - platform: time
    at: ‘21:00:00’
    action:
    service: zwave.set_config_parameter
    data_template: {
    “node_id”: 5,
    “parameter”: 6, <6: Enable/Disable Motion Sensor>
    “value”: “Disable”
    }

     One line in the zwave log is:   Info, Node005, Received Alarm report: type=0, level=0, sensorSrcID=0, type:Burglar event:8, status=255
    

I’m guessing this is when motion is sensed? I added the sensor.burglar to the data template thinking it would identify which sensor it is (this device has 8 sensors on my States page, 2 of everything which seems strange) but it still doesn’t disable the light when there’s motion.

Can you please format the code properly - see the blue box at the top of the page.

P.S.:
Does your data_template work in the template editor of the /dev-template tab?

I had someone tell me I didn’t need a data_template for what I was trying to accomplish so I currently am using:

- alias: Disable Motion
trigger:
  - platform: time
    at: '07:25:00'
action:
  service: zwave.set_config_parameter
  data:
    node_id: 5
    parameter: 6
    value: disabled
    size: 1

The time is random for testing
Parameter 6 is Enable/Disable Motion Sensor
For value I have tried 0 too.
This doesn’t work though
After walking into the Pretty Room (light comes on) my logbook looks like:

January 13, 2019
1:17 PM
Pretty Room Light Level 2 turned on
1:17 PM
Pretty Room Burglar changed to 8
1:17 PM
Pretty Room SourcenodeID changed to 0
1:17 PM
Pretty Room Alarm Level 2 changed to 0
1:17 PM
Pretty Room Alarm Type 2 changed to 0

In Z-Wave Node Management I can choose Node 5, under node config options choose 6: Enable/Disable Motion Sensor, and under config value choose disabled, click on set config parameter and it calls the zwave.set_config_parameter and wah-lah it works. I’m unable to add my time conditions this way however.

I was asking if your template works because you could use that string to
a) test it in the Template Editor to see if it throws an error:
image

b) in the /dev-service tab to see, if it triggers the correct action there:

This is much quicker than having to change the code and reload it every time - but you got it working already, in principle at least, anyway - so :+1:

In terms of ‘time condition’ I’d say you only need 2 automations; one that disables the motion sensor at 21h and another one that enables it again at 4 o’clock.

I assume you have an automation that uses the motion sensor to turn on the lights. You want to disable that automation at certain hours.

So add a condition so that the motion sensor automation does not operate within those hours.

This is the automation I have to turn it off but it doesn’t work. Obviously I have something wrong although it does pays the config test.

- alias: Disable Motion
trigger:
  - platform: time
    at: '21:00:00'
action:
  service: zwave.set_config_parameter
  data:
    node_id: 5
    parameter: 6
    value: disabled
    size: 1

For value I’ve tried 0 in the place of disabled but still doesn’t work. Can you show me what I’m missing? I understand I’ll still need to add an enable automation too. Thanks for your help.

I really don’t know what you are trying to do, but I am pretty sure your indentation is way out.

Also please post your automation that turns the light on when motion is detected.

So I have no automation that turns the light on when motion is detected. That happens through the switch as it is a combo switch/motion sensor (GE/Jasco 26933) All I really want to do is disable the sensor from 9pm to 4am. I can disable the sensor via the Z-wave Node Management page but then it is always disabled.
I can call the zwave.set_config_parameter through services using this service data:
{
“node_id”: 5,
“parameter”: 6,
“value”: 0,
“size”: 1
}

and while it calls for the service it never disables the sensor. I think the config for my Z-wave setup is in the zwcfg_0xedb62b09.xml file located in the config folder. Maybe a time condition can be added there?

OK I see now, perhaps I was being dense.

Something I am not quite clear about - does calling the service manually (ie not through an automation) work?

It calls the service, but it doesn’t actually disable the sensor. The only way to disable it so far is through Z-wave Node Management which on the front end appears to be doing the same thing. Here is the OWZ log when I disable it that way:

2019-01-14 17:33:30.302 Info, Node005, Value::Set - COMMAND_CLASS_CONFIGURATION - Enable/Disable Motion Sensor - 6 - 1 - Disabled
2019-01-14 17:33:30.302 Info, Node005, Configuration::Set - Parameter=6, Value=0 Size=1
2019-01-14 17:33:30.302 Detail, Node005, Queuing (Send) ConfigurationCmd_Set (Node=5): 0x01, 0x0c, 0x00, 0x13, 0x05, 0x05, 0x70, 0x04, 0x06, 0x01, 0x00, 0x25, 0x2e, 0x98
2019-01-14 17:33:30.302 Detail, Node005, Queuing (Send) ConfigurationCmd_Get (Node=5): 0x01, 0x0a, 0x00, 0x13, 0x05, 0x03, 0x70, 0x05, 0x06, 0x25, 0x2f, 0x99
2019-01-14 17:33:30.302 Detail,
2019-01-14 17:33:30.302 Info, Node005, Sending (Send) message (Callback ID=0x2e, Expected Reply=0x13) - ConfigurationCmd_Set (Node=5): 0x01, 0x0c, 0x00, 0x13, 0x05, 0x05, 0x70, 0x04, 0x06, 0x01, 0x00, 0x25, 0x2e, 0x98
2019-01-14 17:33:30.330 Detail, Node005, Received: 0x01, 0x04, 0x01, 0x13, 0x01, 0xe8
2019-01-14 17:33:30.331 Detail, Node005, ZW_SEND_DATA delivered to Z-Wave stack
2019-01-14 17:33:30.344 Detail, Node005, Received: 0x01, 0x05, 0x00, 0x13, 0x2e, 0x00, 0xc7
2019-01-14 17:33:30.344 Detail, Node005, ZW_SEND_DATA Request with callback ID 0x2e received (expected 0x2e)
2019-01-14 17:33:30.344 Info, Node005, Request RTT 41 Average Request RTT 34
2019-01-14 17:33:30.344 Detail, Expected callbackId was received
2019-01-14 17:33:30.344 Detail, Expected reply was received
2019-01-14 17:33:30.344 Detail, Message transaction complete
2019-01-14 17:33:30.344 Detail,
2019-01-14 17:33:30.344 Detail, Node005, Removing current message
2019-01-14 17:33:30.344 Detail,
2019-01-14 17:33:30.344 Info, Node005, Sending (Send) message (Callback ID=0x2f, Expected Reply=0x04) - ConfigurationCmd_Get (Node=5): 0x01, 0x0a, 0x00, 0x13, 0x05, 0x03, 0x70, 0x05, 0x06, 0x25, 0x2f, 0x99
2019-01-14 17:33:30.353 Detail, Node005, Received: 0x01, 0x04, 0x01, 0x13, 0x01, 0xe8
2019-01-14 17:33:30.353 Detail, Node005, ZW_SEND_DATA delivered to Z-Wave stack
2019-01-14 17:33:30.367 Detail, Node005, Received: 0x01, 0x05, 0x00, 0x13, 0x2f, 0x00, 0xc6
2019-01-14 17:33:30.367 Detail, Node005, ZW_SEND_DATA Request with callback ID 0x2f received (expected 0x2f)
2019-01-14 17:33:30.367 Info, Node005, Request RTT 23 Average Request RTT 28
2019-01-14 17:33:30.367 Detail, Expected callbackId was received
2019-01-14 17:33:30.378 Detail, Node005, Received: 0x01, 0x0b, 0x00, 0x04, 0x00, 0x05, 0x05, 0x70, 0x06, 0x06, 0x01, 0x00, 0x81
2019-01-14 17:33:30.378 Detail,
2019-01-14 17:33:30.378 Info, Node005, Response RTT 33 Average Response RTT 35
2019-01-14 17:33:30.378 Detail, Node005, Refreshed Value: old value=1, new value=0, type=list
2019-01-14 17:33:30.378 Detail, Node005, Changes to this value are not verified
2019-01-14 17:33:30.378 Info, Node005, Received Configuration report: Parameter=6, Value=0
2019-01-14 17:33:30.378 Detail, Node005, Expected reply and command class was received
2019-01-14 17:33:30.378 Detail, Node005, Message transaction complete
2019-01-14 17:33:30.378 Detail,
2019-01-14 17:33:30.378 Detail, Node005, Removing current message
2019-01-14 17:33:30.378 Detail, Node005, Notification: ValueChanged

I am no z-wave expert. However I wonder if you need to change the node_id to 005 or even Node005 to match what you see in the log? (This is a wild guess, but worth a try perhaps?)

Hey i just found this:

I saw that too but was unsure how to do a time condition instead of a state condition.

I tried that. Said invalid Json so put it in quotes which made it valid but still didn’t work.

@jwelvaert did you ever find a solution to this? I am trying to do the same thing and am getting the exact same error.

That was a long time ago and I ended up doing something different in my bathroom. I do however use this switch in several rooms including my bedroom. Here is the YAML -

- alias: Master Bedroom Light Disable Motion
  initial_state: true
  trigger:
    - platform: state
      entity_id: binary_sensor.sleepnumber_sleep_number_lygea_is_in_bed
      to: "on"
    - platform: state
      entity_id: binary_sensor.sleepnumber_sleep_number_jeff_is_in_bed
      to: "on"
  condition:
    condition: or
    conditions:
      - condition: state
        entity_id: sun.sun
        state: below_horizon
      - condition: time
        after: "18:30:00"
        before: 03:25:00
  action:
    - service: zwave_js.set_config_parameter
      target:
        entity_id: light.master_bedroom_level
      data:
        parameter: 6
        value: Disabled

To enable the motion sensor -

  action:
    - service: zwave_js.set_config_parameter
      target:
        entity_id: light.master_bedroom_level
      data:
        parameter: 6
        value: Enabled

@jwelvaert - this was just the thing I needed for our laundry room overhead light.

One thing I found was that if HA restarted during the time the “disable” action was triggered, you had to manually enable the motion sensor for the switch, run the automation manually or wait for the next scheduled time.

Had to recently add the Binary Switch setting too (command class 37) as the light was getting turned on when the automation ran.

I added a few conditions to address this and here is my sanitized YAML -

alias: Night Time Laundry Room
description: >-
  Disable Motion Sensor At Night
  https://community.home-assistant.io/t/disable-motion-sensor-at-night/91041/14
trigger:
  - platform: homeassistant
    event: start
  - platform: time
    at: '06:00:00'
  - platform: time
    at: '21:00:00'
condition: []
action:
  - if:
      - condition: time
        after: "21:00:00"
        before: "06:00:00"
    then:
      - service: zwave_js.set_config_parameter
        data:
          parameter: "6"
          value: Disabled
        target:
          device_id: your.device.id.here
      - device_id: your.device.id.here
        domain: zwave_js
        type: set_value
        command_class: 37
        property: targetValue
        value: "false"
        endpoint: "1"
    else:
      - service: zwave_js.set_config_parameter
        data:
          parameter: "6"
          value: Enabled
        target:
          device_id: your.device.id.here
mode: single

I wish I had stumbled upon this excellent explanation of the features and settings of the GE / Jasco Motion Dimmer Switch long ago. It would have made creating the automation easier. The only problem is it gives me lots of ideas of other places I can install them and numerous ways to configure their settings.

Jasco Motion Dimmer Explained – DrZWave