Cannot use advanced triggers

16 views
Skip to first unread message

chadgw...@gmail.com

unread,
Jan 21, 2018, 5:38:00 AM1/21/18
to ImSmart.tech
I created my own connected but I cannot use it with advanced (coding triggers) per your blog. I even tried the example to use IFTTT and it failed. 

For example, if all I had on my trigger was:
ImSmart.import('IFTTT');
var maker = new Maker(1);   // create Maker object with IFTTT key #1
maker.call('your_event');

When I run it through the simulator, I get the following error:

Trigger OpenGarage_status_logging: Action script error: Error: The best overloaded method match for 'ImSmart.BusinessObjects.SmartScript.access(string, string, string)' has some invalid arguments at ImSmart.access (Script Document:1:174) -> this.ImSmart = {}; (function() { this.ImSmart.import = function(name) { _ImSmart.import(name); }; this.ImSmart.access = function(name, paramName, N) { return _ImSmart.access(name, paramName, N); }; this.ImSmart.http = function(url, _async) { if (_async === undefined) _async = false; return _ImSmart.http(url, _async); }; this.ImSmart.localTime = function() { return new Date(_ImSmart.localTime()); }; this.ImSmart.log = function(message) { return _ImSmart.log(message.toString()); }; Object.defineProperty(this.ImSmart, "fromSimulation", { enumerable: true, get: function() { return true; } }); Object.defineProperty(this.ImSmart, "fromEvent", { enumerable: true, get: function() { return false; } }); }()); at MakerCall (Script Document [6] [temp]:8:23) at Script Document [5] [temp]:5:7

chadgw...@gmail.com

unread,
Jan 21, 2018, 5:52:03 AM1/21/18
to ImSmart.tech
I also want to add that accessing ImSmart variables (not locally defined in the script) doesn’t seem to work correctly. For example, I cannot get a string match on a variable value (tested in the simulator) using .match or even ==.
Furthermore, calling ImSmart.log doesn’t log (at least shown in the Simulator) unless it’s called in the connector. This makes it impossible to debug a programmatic trigger.

Paul Dubé

unread,
Jan 21, 2018, 12:39:50 PM1/21/18
to ImSmart.tech
Hi Chad,

I'll look into this and get back to you.

Paul

Paul Dubé

unread,
Jan 22, 2018, 2:55:14 PM1/22/18
to ImSmart.tech
Hi Chad,

The following 2 errors were fixed:
  • Issue fix: importing a connector in an advanced trigger (using ImSmart.import) resulted in an error.
  • Issue fix: calling ImSmart.log in an advanced trigger did not show log in Simulator.
I could not find any issue on the match on a variable value. Maybe the issue 1 prevented you from getting any further. Try again and let me know.

Paul

chadgw...@gmail.com

unread,
Jan 23, 2018, 12:40:13 AM1/23/18
to ImSmart.tech
Thanks Paul. I confirmed the two issues you mentioned have been fixed.
In relation to the variable access: This could be a bug in the simulator. Regardless of what I set the variable to in the simulator (which will correctly trigger the triggers), the logging in the trigger says the variable is set to its default value of "reset".
This prevents my logic in the trigger from working (at least when testing via the simulator). 

Paul Dubé

unread,
Jan 23, 2018, 9:07:38 AM1/23/18
to ImSmart.tech
OK. I see what you mean. I'll work on this.

Paul

ImSmart.tech

unread,
Jan 30, 2018, 10:01:23 PM1/30/18
to ImSmart.tech
Version 2.0.5 fixes the issue. Advanced trigger script in simulation now sends correct variable values in back-end and updates are sent back to the interface.

Paul

chadgw...@gmail.com

unread,
Feb 3, 2018, 4:53:08 AM2/3/18
to ImSmart.tech
Thank you. I confirmed that this works. 
Reply all
Reply to author
Forward
0 new messages