Newbie help with hive motion sensor

@aaiyar That is actually the code I've been playing with but I just can't seem to get active to register. I did find a driver for the Iris IL071 that dose return the active register but no reset to inactive. I used the reset code from the Xiaomi driver but can only get the manual reset to work so I've used rule machine to check when the sensor is active then wait 20 secs then it resets motion to inactive. its hacky i know but for some one who doesn't know much about coding to get it working I'm pretty chuffed with myself

if some one could help with a bit of code for me to get the reset done in code instead of using rule machine would be very much appreciated

Ross