• P
    PaulW08

    Hi Phil,

    I seem to get error message 'Script error: TypeError: date.getHour is not a function in <eval>'.
    Similarly I get this error message 'Script error: ReferenceError: "HOURS" is not defined in <eval> at line number 7 in <eval> at line number 7'
    0_1554413227384_e8e877b1-34b2-427b-8dfd-7987d9bccdcf-image.png

    Is there an internal variable/function I need to declare in the script?

    Thanks,
    Paul

    posted in How-To read more
  • P
    PaulW08

    Hi Phil,
    Thanks for your reply and useful pointers.
    I think I am on the right track as I have produced something similar during testing (if you forgive me for the print statements). See the picture below
    0_1554403518349_50af382f-d46c-4b1e-b7b6-2b0288fe3471-image.png
    I am curious- what is the purpose of the 'return UNCHANGED;' ?

    If I need to return the daily value do I just use CRON '0 0 23 * * ?' and use 'return p48.past(15, HOURS).integral;' instead of 'return UNCHANGED;'?

    Also the data being collected is already a kWh value, therefore I guess I just need to change the rollup to Integral as suggested.

    Further question-
    I may need to produce a daily value using something like CRON '0 30 23 * * ?' to run daily at 23:30. My reason to run at 23:30 is that the data been collected may get delayed through sigfox transmission and processing so in order to retrieve last reading I may need the delay (which is unpredictable). This would raise the question that need to change the >=23 to something like >23:15. This is another complication to resolve. Maybe a trigger event might work here. Any suggestions?

    Appreciate your support,
    Paul

    posted in How-To read more
  • P
    PaulW08

    Hi,
    I want to separate the data being logged from an energy meter into daytime and night-time. For example I want the meter to log data for time period 08:00 to 22:59 as daytime, and then from time 23:00 to 07:59 as night-time. I then want to obtain an accumulated energy usage value for a chosen date range picker for the daytime usage and the night-time usage. This way I can distinguish energy usage by daytime and by night-time and then report this.
    What is the best way to achieve this? Maybe setup a meta data point, use a script and then a CRON pattern...
    Have you any pointers of how to achieve this or maybe this has been done before and there are examples I can follow?
    Thanks,
    Paul

    posted in How-To read more
  • P
    PaulW08

    Hi Phil,
    Thanks for the quick reply.

    1. I now have the Mango login screen displaying on the cloud server. I resolved this by creating a firewall rule to allow traffic through to port 8080 (so effectively port forward). I may need to change to port 80 to lose the port from the URL in the future- thanks for that tip!
    2. The echo $JAVA_HOME. I did log out of ssh session so I think it should work. I need to look into this further but the issue right now may be my lack of linux use. I may need to add JAVA_HOME to the profile file instead.
    3. The java.net.UnknownHostException message at the stack trace- I got this message prior to creating the firewall rule so I need to check for this message when I restart Mango (I can only do this next week so I will keep you posted)
      Great software and great support- much appreciated
      Paul

    posted in User help read more