Reading PIR / Door Sensor Status In CoRE

Hi,

I have a PIR that thinks it’s a door sensor and therefore reports Opened & Closed. (but that’s not the problem). In Smartthings using Notify Me When, all works fine, I can use ‘Contact Opens’ and get Smartthings to do something. I’m trying to write a CoRE Piston to do the same type of thing however cannot figure out what comparison to use and what value to check for. Opened & Closed don’t work and return False. I’m sure this is very simple, I’m sure someone knows what value I should be checking for.

Thanks

Conrad.

what type of PIR?

1 Like

Hi Jimmy,

It’s unbranded from Alibaba but is z wave and works fine. Not sure that helps any.

Thanks

Conrad.

do you have a link/picture? a lot of devices are the same thing and sold under many brands.

The Smartthings Hub picks up the sensor and as I mentioned the off-the-shelf SmartApps like ‘Notify Me When’ pick up it changing state ok so it isn’t doing anything unusual it’s more of understanding how CoRE sees the messages coming from it via the Smart Hub.

This is a link to what it looks like

https://szkpl.en.alibaba.com/product/60698567923-803415788/mini_ble_nluetooth_long_range_wireless_types_of_pir_sensor.html?spm=a2700.8304367.prewdfa4cf.22.529dec7fMpNueF

Thanks

Conrad.

it look the same as the KPL and Be Sense motion detectors. What device type did it assign in the IDE when you paired it?

It came in as a Sensor not a motion detector but I can live with that.

When I look at it in ‘Things’ and then in ‘Recently’ it is shown switching between ‘closed’ and ‘opened’ so Smarthings is happy with it.

The issue for me is how I get a CoRE Piston to see the status. In a ‘Condition’ I can set a ‘Capability’ of ‘Sensor’, the PIR appears in the list and I can select it. It’s when I get to ‘Comparison’. I can select ‘Is’ but if I give it a ‘Value’ of either ‘opened’ or ‘closed’ it always returns the Boolean value of ‘False’. The PIR is most likely sending out either 0 or 1 but I can’t figure out what CoRE is doing with that and therefore how to test it. As I mentioned before, the device works fine with ‘Alert Me When’ so it’s not the device or Smartthings.

Any help with CoRE gratefully received.

fixing it in core is a bandaid. you need to get the correct device handler so it actually reports motion events. When you login to the ide and go to the device page, what does it say for Type?

Hi Jimmy,

Thanks for your support. I managed to ‘fix’ this in CoRE. I changed the ‘Capability’ from ‘Sensor’ to ‘Contact Sensor’. Using a ‘Comparison’ of '‘IS’ CoRE then gave me 2 pre-populated ‘Value’ options of ‘open’ and ‘closed’ and the Piston then started to work. Sometimes it’s the simple stuff that catches me out (and I’m, in the dim and distant past, a qualified programmer!)

Thanks again

Conrad.

lol, its still a bandaid. it still won’t work with any other app looking for motion copability. It takes 2 minutes to go into the IDE, find the device and look at the type. most likely it is assigned the wrong type