2021-07-18 21:28:00.718 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘e292f18d18’ failed: ReferenceError: “now” is not defined in at line number 6
2021-07-18 21:28:00.911 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘ad860ef9ee’ failed: :3:97 Expected ) but found as
When I first started ECMA scripts I used the design with blockly option and wrote the code with it. I saved the blockly code and then click on the code tab of the rule and the ECMA script code is there.
I used that method to get the syntax and code structure. I am still not an expert but that got me started. I don’t use DSL rules anymore.
For simple rules I just use the UI for example below:
For everything else I just copy and past from example codes etc.
PS: To get the hour you have to do this:
var datetoday = new Date();
var hour_now = datetoday.getHours();
Good luck with ECMA. I have been using it for about 6 months.