Is there a way to add in comments into a JSON rule? I know it’s not strictly allowed by the JSON standard, but for these hand-jammed rule files, it would make updates and maintenance so much easier. Comments could be ignored on the ST parser side, but that is disabled, as is the other workaround of having “_comment”: “this is a comment” fields, where unrecognized fields are not ignored.
I just tackled my first rule to tie in my Eufy Doorbell (via Alexa) to SmartThings. Eufy sends a motion-detected event to Alexa just fine, but the “no motion detected for X minutes” option in Alexa never fires, so I created a virtual switch to pass the event to SmartThings and created a rule to add in some logic:
if(motionDetected) motionDetected - Off if(between Sunset/Sunrise) Outside - 100% Entrance - On Wait 5 mins Entrance - Off if(before 2200) Outside 30% (lights are on a simple sunset-2200 schedule) else Outside - Off
Works great, but 11 lines of pseudo-code ends up being 196 lines of ugly JSON. If I modify it in the future, not having comments and having to cross reference deviceIds against another JSON file just to figure out what’s going on is going to be quite the headache. I can just imagine what more complicated rules will look like.