@benjamin-perez Thank you Benjamin.
Regards,
Rodrigo
@Rodrigo
Hello Everyone, have you been able to check this issue?
Regards,
Rodrigo
@benjamin-perez Thanks Benjamin, looking forward to know if it's my mistake somewhere or a bug.
I've also asked @MattFox to take a look at this. His thoughts, bug.
Regards,
Rodrigo
@terrypacker
Hi Terry, thank you for answering, there are two problems actually;
the one you mention, a non-superadmin user can't create or modify/save created schedules, even though it has all the permissions. I'm trying this again now, and supposedly the user is able to edit and save the schedule.
A schedule created by a superadmin user works as expected, in the example it starts/stops the virtual device 01
Test 01: Logged as superadmin I'm able to modify and save the schedule, when the schedule time arrives, the Virtual Device 01 is turned on and off. It works.
Test 02: With the same Data source, points, schedule, modify the schedule as superadmin save it and logout. Log in as user and the same schedule does not trigger the Virtual Device and the following event appears.
As per the "full log output" file you're asking, can you please tell me where to find it?
Thanks again,
Rodrigo
@rodrigo @STAFF
I think there's a bug with the permissions. Even though the User has the needed permissions.
The event states "Scheduler failed to initialize because user does not hold the required role/s"
Could someone check this? Below the code for the Data source, handler and scheduler, I have just created a user, give to it the permissions and the scheduler throws the above error.
Data Source
"dataSources":[
{
"xid":"DS01_VDS01",
"name":"01 - VDS 01",
"enabled":true,
"type":"VIRTUAL",
"alarmLevels":{
"POLL_ABORTED":"INFORMATION"
},
"purgeType":"YEARS",
"updatePeriods":5,
"updatePeriodType":"SECONDS",
"polling":true,
"quantize":true,
"useCron":false,
"data":null,
"editPermission":[
],
"purgeOverride":false,
"purgePeriod":1,
"readPermission":[
[
"user"
]
]
}
],
"dataPoints":[
{
"xid":"DP01_Virtual01",
"name":"01 - ON \/ OFF",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"changeType":{
"type":"NO_CHANGE",
"startValue":"true"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"simplifyType":"NONE",
"chartColour":"",
"data":null,
"dataSourceXid":"DS01_VDS01",
"defaultCacheSize":1,
"deviceName":"Virtual Device 01",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"editPermission":[
],
"intervalLoggingPeriod":15,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":[
[
"user"
]
],
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":[
[
"user"
]
],
"tags":{
},
"textRenderer":{
"type":"BINARY",
"oneColour":"rgb(255, 51, 51)",
"oneLabel":"OFF",
"zeroColour":"rgb(0, 214, 0)",
"zeroLabel":"ON"
},
"tolerance":0.0
},
{
"xid":"DP02_Virtual02",
"name":"01 - ON \/ OFF",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"changeType":{
"type":"NO_CHANGE",
"startValue":"true"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"simplifyType":"NONE",
"chartColour":"",
"data":null,
"dataSourceXid":"DS01_VDS01",
"defaultCacheSize":1,
"deviceName":"Virtual Device 02",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"editPermission":[
],
"intervalLoggingPeriod":15,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":[
[
"user"
]
],
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":[
[
"user"
]
],
"tags":{
},
"textRenderer":{
"type":"BINARY",
"oneColour":"rgb(255, 51, 51)",
"oneLabel":"OFF",
"zeroColour":"rgb(0, 214, 0)",
"zeroLabel":"ON"
},
"tolerance":0.0
},
{
"xid":"DP03_Virtual03",
"name":"01 - ON \/ OFF",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"changeType":{
"type":"NO_CHANGE",
"startValue":"true"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"simplifyType":"NONE",
"chartColour":"",
"data":null,
"dataSourceXid":"DS01_VDS01",
"defaultCacheSize":1,
"deviceName":"Virtual Device 03",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"editPermission":[
],
"intervalLoggingPeriod":15,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":[
[
"user"
]
],
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":[
[
"user"
]
],
"tags":{
},
"textRenderer":{
"type":"BINARY",
"oneColour":"rgb(255, 51, 51)",
"oneLabel":"OFF",
"zeroColour":"rgb(0, 214, 0)",
"zeroLabel":"ON"
},
"tolerance":0.0
}
]
}
Event Handler
{
"eventHandlers": [
{
"handlerType": "SET_POINT",
"targetPointId": "DP01_Virtual01",
"scriptRoles": [],
"inactiveValueToSet": "true",
"activeValueToSet": "false",
"eventTypes": [
{
"XID": null,
"sourceType": "ADVANCED_SCHEDULE",
"scheduleEventType": "SCHEDULE_ACTIVE"
}
],
"xid": "EH_test01",
"activeAction": "STATIC_VALUE",
"inactiveAction": "STATIC_VALUE",
"readPermission": [
[
"user"
]
],
"name": "Handler 01",
"disabled": false,
"additionalContext": [],
"editPermission": [
[
"user"
]
]
}
]
}
Scheduler
{
"advancedSchedules": [
{
"xid": "advSch_test01",
"defaultSchedule": {
"dailySchedules": [
{
"changes": []
},
{
"changes": [
"18:30",
"19:55"
]
},
{
"changes": [
"18:30",
"19:55"
]
},
{
"changes": [
"18:30",
"19:55"
]
},
{
"changes": [
"18:30",
"19:55"
]
},
{
"changes": [
"18:30",
"19:55"
]
},
{
"changes": []
}
],
"offsetCount": 10
},
"readPermission": [
[
"user"
]
],
"name": "Scheduler test 01",
"alarmLevel": "INFORMATION",
"errorAlarmLevel": "INFORMATION",
"editPermission": [
[
"user"
]
],
"enabled": true,
"exceptions": []
}
]
}
Thanks!
@rodrigo
I'm guessing is a problem with permissions. I have tried everything I could with the permissions. But with no success.
Hi Guys,
The Scheduler (or the Event Handler) seems to not be working when the user is not a Superadmin.
Does anyone have the same problem?
Mango v4.3.5
Rodrigo
Hi @mattfox are you available for a quick chat?
:)
Thanks, my background is actually electromechanical, so this is like advance chinese translated to esperanto hahaha
I miss DGLux, the combination with Mango was very powerful, at least for my not programmer capacity.
Hi Matt,
With your help and also a little local help (my brother) I have managed to do what I wanted.
One change I did was to move the trigger from the virtual data source to the scripted data source.
Virtual Data Source + Points
{
"dataSources":[
{
"xid":"DS_EdificioA",
"name":"Edificio A",
"enabled":true,
"type":"VIRTUAL",
"alarmLevels":{
"POLL_ABORTED":"URGENT"
},
"purgeType":"YEARS",
"updatePeriods":10,
"updatePeriodType":"SECONDS",
"polling":true,
"quantize":true,
"useCron":false,
"editPermission":"",
"purgeOverride":false,
"purgePeriod":1
}
],
"dataPoints":[
{
"xid":"DP_Equipo01A",
"name":"ON \/ OFF (0 = ON - 1 = OFF )",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"changeType":{
"type":"NO_CHANGE",
"startValue":"true"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"simplifyType":"NONE",
"chartColour":"",
"chartRenderer":{
"type":"TABLE",
"limit":10
},
"dataSourceXid":"DS_EdificioA",
"defaultCacheSize":1,
"deviceName":"Equipo 01 A",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"intervalLoggingPeriod":1,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":"",
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":"",
"tags":{
},
"textRenderer":{
"type":"BINARY",
"oneColour":"rgb(255, 51, 51)",
"oneLabel":"OFF",
"zeroColour":"rgb(102, 255, 102)",
"zeroLabel":"ON"
},
"tolerance":0.0
},
{
"xid":"DP_Equipo02A",
"name":"ON \/ OFF (0 = ON - 1 = OFF )",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"changeType":{
"type":"NO_CHANGE",
"startValue":"true"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"simplifyType":"NONE",
"chartColour":"",
"chartRenderer":{
"type":"TABLE",
"limit":10
},
"dataSourceXid":"DS_EdificioA",
"defaultCacheSize":1,
"deviceName":"Equipo 02 A",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"intervalLoggingPeriod":15,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":"",
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":"",
"tags":{
},
"textRenderer":{
"type":"BINARY",
"oneColour":"rgb(255, 51, 51)",
"oneLabel":"OFF",
"zeroColour":"rgb(102, 255, 102)",
"zeroLabel":"ON"
},
"tolerance":0.0
},
{
"xid":"DP_Equipo03A",
"name":"ON \/ OFF (0 = ON - 1 = OFF )",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"changeType":{
"type":"NO_CHANGE",
"startValue":"true"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"simplifyType":"NONE",
"chartColour":"",
"chartRenderer":{
"type":"TABLE",
"limit":10
},
"dataSourceXid":"DS_EdificioA",
"defaultCacheSize":1,
"deviceName":"Equipo 03 A",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"intervalLoggingPeriod":15,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":"",
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":"",
"tags":{
},
"textRenderer":{
"type":"BINARY",
"oneColour":"rgb(255, 51, 51)",
"oneLabel":"OFF",
"zeroColour":"rgb(102, 255, 102)",
"zeroLabel":"ON"
},
"tolerance":0.0
},
{
"xid":"DP_Equipo04A",
"name":"ON \/ OFF (0 = ON - 1 = OFF )",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"changeType":{
"type":"NO_CHANGE",
"startValue":"true"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"simplifyType":"NONE",
"chartColour":"",
"chartRenderer":{
"type":"TABLE",
"limit":10
},
"dataSourceXid":"DS_EdificioA",
"defaultCacheSize":1,
"deviceName":"Equipo 04 A",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"intervalLoggingPeriod":15,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":"",
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":"",
"tags":{
},
"textRenderer":{
"type":"BINARY",
"oneColour":"rgb(255, 51, 51)",
"oneLabel":"OFF",
"zeroColour":"rgb(102, 255, 102)",
"zeroLabel":"ON"
},
"tolerance":0.0
},
{
"xid":"DP_Equipo05A",
"name":"ON \/ OFF (0 = ON - 1 = OFF )",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"changeType":{
"type":"NO_CHANGE",
"startValue":"true"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"simplifyType":"NONE",
"chartColour":"",
"chartRenderer":{
"type":"TABLE",
"limit":10
},
"dataSourceXid":"DS_EdificioA",
"defaultCacheSize":1,
"deviceName":"Equipo 05 A",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"intervalLoggingPeriod":15,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":"",
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":"",
"tags":{
},
"textRenderer":{
"type":"BINARY",
"oneColour":"rgb(255, 51, 51)",
"oneLabel":"OFF",
"zeroColour":"rgb(102, 255, 102)",
"zeroLabel":"ON"
},
"tolerance":0.0
}
]
}
Scritped Data Source with Trigger Point
{
"dataSources":[
{
"xid":"DS_ScriptEdificioA",
"name":"Script Edificio A",
"enabled":true,
"type":"SCRIPTING",
"alarmLevels":{
"SCRIPT_ERROR":"DO_NOT_LOG",
"CONTEXT_POINT_DISABLED":"DO_NOT_LOG",
"DATA_TYPE_ERROR":"DO_NOT_LOG",
"POLL_ABORTED":"DO_NOT_LOG",
"LOG_ERROR":"DO_NOT_LOG"
},
"purgeType":"YEARS",
"updatePeriods":5,
"updatePeriodType":"SECONDS",
"updateEvent":"UPDATE",
"context":[
{
"varName":"pt01",
"dataPointXid":"DP_Equipo01A",
"updateContext":false
},
{
"varName":"pt02",
"dataPointXid":"DP_Equipo02A",
"updateContext":false
},
{
"varName":"pt03",
"dataPointXid":"DP_Equipo03A",
"updateContext":false
},
{
"varName":"pt04",
"dataPointXid":"DP_Equipo04A",
"updateContext":false
},
{
"varName":"pt05",
"dataPointXid":"DP_Equipo05A",
"updateContext":false
}
],
"logLevel":"NONE",
"scriptPermissions":[
"superadmin"
],
"polling":false,
"executionDelaySeconds":0,
"historicalSetting":false,
"logCount":5,
"logSize":1.0,
"script":"\/\/First: Get triggerA data.\r\nvar triggerPoint = triggerA.getDataPointWrapper();\r\n\r\n\/\/Second: For each point in CONTEXT_POINTS\r\n\/\/For example: Equipo 01 A, Equipo 02 A...\r\nfor (var contextPoint in CONTEXT_POINTS) {\r\n \r\n \/\/Third: Get the data\/status of each point.\r\n \/\/For example: Equipo 01 A data.\r\n var currentPoint = this[contextPoint].getDataPointWrapper();\r\n \r\n var triggerRuntimeValue = triggerPoint.runtime.value;\r\n \r\n if(currentPoint.xid === triggerPoint.xid) {\r\n \/\/Considering that triggerA belongs to CONTEXT_POINTS.\r\n \/\/We have to skip this one to avoid an infinite loop.\r\n continue;\r\n \r\n } else {\r\n \r\n if(triggerRuntimeValue === true) {\r\n currentPoint.runtime.set( false );\r\n \r\n } else if (triggerRuntimeValue === false) {\r\n currentPoint.runtime.set( true );\r\n }\r\n }\r\n }",
"quantize":true,
"useCron":false,
"editPermission":"superadmin",
"purgeOverride":false,
"purgePeriod":1
}
],
"dataPoints":[
{
"xid":"DP_scriptingEdificioA",
"name":"Trigger Edificio A",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"contextUpdate":true,
"settable":true,
"varName":"triggerA"
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"simplifyType":"NONE",
"chartColour":"",
"chartRenderer":{
"type":"TABLE",
"limit":10
},
"dataSourceXid":"DS_ScriptEdificioA",
"defaultCacheSize":1,
"deviceName":"Script Edificio A (Trigger)",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"intervalLoggingPeriod":1,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":"",
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":"",
"tags":{
},
"textRenderer":{
"type":"BINARY",
"oneColour":"rgb(102, 255, 102)",
"oneLabel":"ON",
"zeroColour":"rgb(255, 51, 51)",
"zeroLabel":"OFF"
},
"tolerance":0.0
}
]
}
Worked great!
I wanted to thank you again!
Best,
Rodrigo
Thank a lot Matt! I will be trying it this week and see how it goes.
I really appreciate your help.
Best,
Rodrigo
Hi guys,
I am creating a set point event handler to use with the advanced scheduler, following this video
In the set point settings of the Event Handler there's a field I can not quite understand how to use. the "Target Point"
If the goal is to set several data points, one loads them in the External context points, and set their keys to use in the active and inactive actions scripts.
Now, the target point gives me the option of every point I have in the system and does not allows to leave it blank.
What to put there?
Thanks,
Best,
Rodrigo
@mattfox
Really! Awesome, do not worry about the time, here is 19:21 (March 5) now.
Paraguayan time.
I could read it later tonight or even tomorrow and try to apply it.
Thanks a lot!
thanks Matt, but I am not able to understand how to make it work :(
Hi Matt,
You are alway ready to help! Thanks for that.
I am not bening able to understand how to do this, I have created the Scripting Data Source and added to it, External Context Points (from other Data Sources), this points are the ones that turn devices ON or OFF. Like this
Then, I created the Binary data point with this properties
Would you be so kind of expanding your previous reply a little more with this data?
Thanks in advance.
Best,
Rodrigo
@craigweb
Hello guys, would you be able to provide some more help on how to write this loop?
Thanks,
Rodrigo