• 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

  • @bmanos Can you post your email template?

  • Hello again
    This is the default email template

    <!DOCTYPE html>
      <style>body {font-size: 12px;}</style>
        <b>Dear User,</b>
        <br>There is a rule triggered for you!
          <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>
        <br>-- Powered by <a href='http://www.MyController.org'>www.MyController.org</a>

    Thanks, Emmanuel

  • @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.

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

  • @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?

  • @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).

  • thanks @jkandasa

Suggested Topics