Automation not Triggering From Motion Sensor

I have automation to turn on wemo plug when a Smartthings Motion sensor detects motion. The badge on screen and history log the event so I know the zigbee is sensing he change. Manually clicking Trigger also works as expect. Should I change from ‘off’ to ‘on’ to from ‘Clear’ to ‘Detect’ ?? Any other ideas

  • id: ‘1549588824265’
    alias: auto_DeskLight_On_Motion1
    trigger:
    • entity_id: sensor.samjin_motion_01024543_1_1
      from: ‘off’
      platform: state
      to: ‘on’
      condition: []
      action:
    • data:
      entity_id: switch.xmastree1
      service: switch.turn_on

First, always format YAML code according to the instructions at the top of the page.

What are the states of sensor.samjin_motion_01024543_1_1? Look only on the States page. Other pages tend to change what they look like in various ways. Also, letter case is important.

Sorry I did hit the format do you do this after or b4 pasting? I will check the verbage on the status for the Samsung Smartthing Zigee Motion Sensor as well check the case shown

You paste the code, select it, then hit that button. But for it to work (and what the instructions don’t say), if you have any text preceding it, the block to be formatted has to be separated from the previous lines by a blank line.

The other way to do it is to type a line before it with three “back ticks”, and a line after it with three “back ticks” (and then don’t hit the button.) It will look like this:

```
- id: blah_blah_blah
```

I find it easier to do it that way (and you don’t need blank lines before or after the formatted block.) The “back tick” character is typically to the left of the number 1 key.

BTW, in case you don’t know, the “States page” I was referring to is accessed here:

image

That page updates dynamically as the entities change. So, if you cause motion to be detected, you should be able to see what the exact state string is before and after detection.

Thanks. By double checking everything I noticed it was checking one of the other items on the sensor ( this sensor does ( Battery, Temp and Motion ). The case needed to be all lower case ex. on

Ah, ok, makes sense. Glad you worked it out.

1 Like

Yea I had the states page thing down no Problem. Thanks for the further explanation on the pasting that will help a lot

1 Like