Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

  • Change a data point with condition

    2
    0 Votes
    2 Posts
    522 Views
    MattFoxM
    @tungthanh500 get rid of the runtime sleep call. Set the context point related to the data point you are validating and set the script to trigger from one of them for a start. Alternatively use a cron timer setting set to 15 seconds. Fox
  • Invoke shell commands from a Scripting environment?

    8
    0 Votes
    8 Posts
    3k Views
    MattFoxM
    @Jdiaz-co MA_JAVA_OPTS="$MA_JAVA_OPTS -Dnashorn.args=-scripting" will be the ticket then I see they've changed it a fair bit since then, I'm not near an install right this minute to compare Fox
  • How to Calculate kWh from kW

    3
    0 Votes
    3 Posts
    3k Views
    T
    @nino-kurtalj New link is here: https://docs-v4.radixiot.com/script-examples
  • 0 Votes
    9 Posts
    2k Views
    raylatbasixR
    @MattFox Thanks for posting this Fox!! And thank you again for all your help! Your an invaluable asset to this forum! Note: For others that try to access this data from the DegreeDays.net API as shown above, you may need to adjust the CRON polling time to something a little later than 12:30AM as listed above. Some weather stations do not fully update yesterdays available Heating Degree Data until a couple hours or so after midnight, so experiment with the CRON polling time accordingly.
  • <script> tag not working in Mango V4?

    6
    0 Votes
    6 Posts
    2k Views
    R
    @jared-wiltshire Hi Jared. Is there a better solution for this as i am struggling to create the script as the entry point under User modules? Or perhaps if you can give me quick point as to how to go about this?
  • Audible Alarm with silence

    2
    0 Votes
    2 Posts
    1k Views
    Jared WiltshireJ
    @tungthanh500 have you seen the UI settings at /ui/administration/ui-settings which allow you to choose an audio file? There's no provision to loop an audio file as far as I remember, you would need to create a custom component for this.
  • Which Point Called Event Handler?

    4
    0 Votes
    4 Posts
    1k Views
    terrypackerT
    @marganellim the script I gave you is for the "script" section of the email event handler. That is the only place the "model" is included in the script context as it is normally used to modify the model that is used to generate the Email via the FTL template but you can do anything you want in that script. The script you use will depend on the type of Event Handler you choose. If you want to use a "Script" Event Handler then this would work: /** * This script implements com.serotonin.m2m2.rt.event.handlers.EventHandlerInterface * Add this script to a "Script" type event handler and choose the Graal.js or Nashorn engine. */ /** * Called when the Mango event is raised. * You must implement this method. * * @param event */ function eventRaised(event) { console.log('Raised', event); console.log('test xid: ' + event.getContext().get('point').getXid()); } /** * Called when the Mango event is acknowledged (the event may still be active). * Supported as of Mango v4.0.0-beta.14, you are not required to implement this method. * * @param event */ function eventAcknowledged(event) { console.log('Acknowledged', event); } /** * Called when the Mango event returns to normal or is deactivated (e.g. on shutdown). * You must implement this method. * * @param event */ function eventInactive(event) { console.log('Inactive', event); }
  • PointValueQuery using where conditions

    mangojavascript pointvaluequery
    1
    0 Votes
    1 Posts
    804 Views
    No one has replied
  • IGVault Ways to Make Madden Coins in Madden NFL 21

    1
    0 Votes
    1 Posts
    672 Views
    No one has replied
  • Getting value at specific time using metadata scripting

    2
    0 Votes
    2 Posts
    1k Views
    ThomasEinastoT
    Have you read https://docs-v3.mango-os.com/about-mango-java-script ? Look at Statistical objects section. Hint, there is a delta in statistical object.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Advanced Schedule Present Value in Scripting by XID

    1
    0 Votes
    1 Posts
    584 Views
    No one has replied
  • Forcasted Data: Purge existing data before writing updated values

    13
    0 Votes
    13 Posts
    3k Views
    MattFoxM
    Congrats!
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • Design pattern to modify an epoch timestamp on modbus tcp

    2
    0 Votes
    2 Posts
    1k Views
    E
    Using a Meta Data Source I think could be possible to format the date as I need but how I can then map to an epoch as required when the user for example change the hour?
  • Email Last Day's Events

    4
    0 Votes
    4 Posts
    2k Views
    MattFoxM
    I think you are confusing a scripted datasource ftl script with the email mailing list. Unless you are talking about using the email recipients, then yes they are stored as strings in an array. Fox
  • Its possible load a jsp file from meta data source script?

    1
    0 Votes
    1 Posts
    770 Views
    No one has replied
  • why can't i use setTimeout in scripts ?

    1
    0 Votes
    1 Posts
    843 Views
    No one has replied
  • meta data scripting - execution and setting

    5
    0 Votes
    5 Posts
    2k Views
    MattFoxM
    No under events, there are different options when an event is triggered. Email, set point value, run external process,excel report, report -> Set to Set point [image: ZKTo6ba.png] Then add the same context points you use in your meta data source script, the target point being what you normally send data down via your meta point -> your bacnet point [image: iHqHCwj.png] Set to scripted action: [image: 0LOAKgC.png] [image: PDRa4UW.png] Input the same code you would for your meta datapoint script and return the value that the bacnet point should receive. This will then fire when the event is triggered.