• Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login
  • Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login

Battery level error on email

Scheduled Pinned Locked Moved General Discussion
8 Posts 2 Posters 1.3k Views 1 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    bmanos
    last edited by 3 Mar 2018, 17:40

    Hello
    I am using the js battery script I set it up using those instructions (https://forum.mycontroller.org/topic/77/battery-level-in-rules-or-chart-script-rule-to-check-battery-level) and make my alert to send an email
    This is what I get when the condition is met

    Exception: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
    ==> notification.actualValue [in template "unknown" at line 13, column 42]

    Tip: It's the step after the last dot that caused this error, not those before it.

    Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??


    FTL stack trace ("~" means nesting-related):
    - Failed at: ${notification.actualValue} [in template "unknown" at line 13, column 40]

    Any idea what is going wrong
    Thanks, Emmanuel

    J 1 Reply Last reply 4 Mar 2018, 07:25 Reply Quote 0
    • J Offline
      jkandasa @bmanos
      last edited by 4 Mar 2018, 07:25

      @bmanos Can you post your email template?

      1 Reply Last reply Reply Quote 0
      • B Offline
        bmanos
        last edited by 4 Mar 2018, 08:24

        Hello again
        This is the default email template

        <!DOCTYPE html>
        <html>
          <style>body {font-size: 12px;}</style>
          <body>
            <b>Dear User,</b>
            <br>
            <br>There is a rule triggered for you!
            <br>
            <br>
              <table border='0'>
                <tr><td>Rule definition name</td><td>: ${notification.ruleName}</td> <tr>
                <tr><td>Condition</td><td>: ${notification.ruleCondition}</td><tr>
                <tr><td>Actual value</td><td>: ${notification.actualValue}</td><tr>
                <tr><td>Triggered at</td><td>: ${notification.triggeredAt}</td><tr>
              </table>
            <br>
            <br>-- Powered by <a href='http://www.MyController.org'>www.MyController.org</a>
          </body>
        </html>
        
        

        Thanks, Emmanuel

        J 1 Reply Last reply 4 Mar 2018, 13:46 Reply Quote 0
        • J Offline
          jkandasa @bmanos
          last edited by 4 Mar 2018, 13:46

          @bmanos Thanks for the template. This condition executed via script, hence rule definition doesn't know the actual value.

          You should create a new email template for this purpose without notification.actualValue.

          B 1 Reply Last reply 4 Mar 2018, 16:29 Reply Quote 0
          • B Offline
            bmanos @jkandasa
            last edited by 4 Mar 2018, 16:29

            @jkandasa thanks for your reply I will make an new template without the value and let you know.

            B 1 Reply Last reply 4 Mar 2018, 18:12 Reply Quote 0
            • B Offline
              bmanos @bmanos
              last edited by 4 Mar 2018, 18:12

              @bmanos said in Battery level error on email:

              @jkandasa thanks for your reply I will make an new template without the value and let you know.

              Tested everything works fine thanks again
              If I want to display the battery value in the email how can I do this?

              J 1 Reply Last reply 5 Mar 2018, 05:05 Reply Quote 0
              • J Offline
                jkandasa @bmanos
                last edited by 5 Mar 2018, 05:05

                @bmanos, For now, you can not send this way. You can use Execute script on the operation and send an email via script(email template won't support here. you have to use plain body message).

                B 1 Reply Last reply 5 Mar 2018, 09:22 Reply Quote 0
                • B Offline
                  bmanos @jkandasa
                  last edited by 5 Mar 2018, 09:22

                  thanks @jkandasa

                  1 Reply Last reply Reply Quote 0
                  8 out of 8
                  • First post
                    8/8
                    Last post

                  1

                  Online

                  590

                  Users

                  529

                  Topics

                  3.4k

                  Posts
                  Copyright © 2015-2025 MyController.org | Contributors | Localization