Hi - Background. I have a tilt sensor on my garage. I am trying to have the outdoor lights come on when either the tilt is set to open OR motion is on the camera. Unfortunately, each light automation I try (either motion or open tilt sensor), it turns off the light when its closed. The problem this causes is at night, my outdoor lights are ON and if the garage door is opened and then closed, they remain off the rest of the night. I tried the following settings
Turn off lights when motion stops, still turns off right when garage door closes (which I have setup to start recording / motion on camera when opened)
I tried the turn off after x minutes, doesnât solve the problem of turning off the lights if its past hours
I tried the rule hours, but it seems not work - does it all the time.
Please show us screenshots of the automations youâre having trouble with.
Also, what are the brands and models of the various devices?
You may need to set up a separate automation for each of your conditions since itâs an âorâ anyway, correct? So one automation for the camera and the other automation for the tilt sensor.
Hi Thank you. Few responses to the questions and also added in screenshots. One additional point, if I remove this lighting routine, the drive way lights donât come on or off upon tilt. Also, the strange part - this lighting routine has turn off after 5 minutes AND only do the rule if the drive way light is âoffâ, neither is working!
Hi @itzfry! Have you checked the new Rules API? Even though is a bit more complex, it also allows you to create more complex rules as well, I recommend you to check the Rules Breakdown, and if it fits what you are looking for, we might help you over here to accomplish your goal!
Cheers!
Cool - will do. I have been waiting to take this more complicated step but honestly, it seems like it will be an easy rule once I get the hang of it. Will take a look is there a video or walkthrough for someone to quickly get started with using the APIs - where to set it up, tokens, etc. Video would be nice!
As this is a new API, there arenât much videos yet, but I can recommend you the check this, which is the presentation of the Rules API at SDC.
The Engineering team has created a tool, to work with rules easily: Rules Manager, which allows you to sign into your account, and avoid the tokens and all that.
To start, you can check at the Rules Breakdown I mentioned above, which has clear examples as well.
Donât hesitate on posting over here when you get stuck with your rules, so the community can help you!
OK! Had time to check this out. I did a few things, but encountering a few problems so questions below.
Hooked up POSTMAN and did some basic GET commands to understand the device IDs, etc.
When submitting rules through POSTMAN, I didnât get a response. Not sure whatâs up here. However, it does show me a couple of errors I corrected (red X on a line) that was helpful to move the code to the RULE MANAGER
Used RULE MANAGER. Works sporadically but got me further, see below.
Questions
SUBMITTING A RULE sometimes doesnât work - no progress bar, no results, no error, just click submit and it stays there.
I did get a rule to work, so perhaps there is something wrong with my JSON on the new rule I am working on and that is the reason its not working? Is this normal behavior without an error code, etc?
For the rule I did get to work, I want to delete it - it was only a test. To delete a rule, I need a rule ID. Not sure what value this is. Thoughts?
PLEASE SEE PREVIOUS REPLY FOR INFO. However here is my sample code. I think one issue may be my reference to CONTACTSENSOR and OPEN. I havenât found a good resource that shows how to denote the type of device and available references to the attribute or commands. Possibly an issue here?