Voltage monitoring script not working in ROS v7

Hi guys,
I have a voltage monitoring script that has been working great on version 6.
I cannot get it to work on version 7.
I am really clueless when it come to scripting. The script basically monitors the high & low voltage, and sends an email to me.
I would really appreciate some help here please.

This is my current script:

#set lowvoltalarm to desired alarm voltage in tenths of a volt. 125 = 12.5v
:global lowvoltalarm 225
:global highvoltalarm 290
:global highvolt
:global lowvolt
:global starttime
:global hivolttime
:global lovolttime
:global vh
:local thisbox [/system identity get name]
:global voltage [/system health get voltage]
:local thistime [/system clock get time]
:local thisdate [/system clock get date]
:local thishour [:pick $thistime 0 2]
:local emessage ($thisbox . " voltage is: " . [:pick $voltage 0 2] . "." . [:pick $voltage 2 3])
:if ([:len $lowvolt] < 1) do={:set lowvolt 999; :set highvolt 0}

set your email address in the next line

:if ($voltage <= $lowvoltalarm) do={/tool e-mail send to="email@example.com" subject="$thisbox Voltage Statistics" body=$emessage}
:if ($voltage <= $lowvoltalarm) do={/tool e-mail send to="email@example.com" subject="$thisbox Voltage Statistics" body=$emessage}
:if ($voltage >= $highvoltalarm) do={/tool e-mail send to="email@example.com" subject="$thisbox Voltage Statistics" body=$emessage}
:if ($voltage >= $highvoltalarm) do={/tool e-mail send to="email@example.com" subject="$thisbox Voltage Statistics" body=$emessage}
:if ($voltage > $highvolt) do={:set highvolt $voltage; :set hivolttime ($thistime . " " . $thisdate)}
:if ($voltage < $lowvolt) do={:set lowvolt $voltage; :set lovolttime ($thistime . " " . $thisdate)}
:if ([:len $vh] > 0) do={:set vh ([:toarray $voltage] + $vh)} else={:set vh [:toarray $voltage]}
:if ([:len $starttime] < 1) do={:set starttime ($thistime . " " . $thisdate)}

Find on the forum other topics about new health system on v7, there are dozens of already opened topic for health monitoring.

Ok I have managed to find something very basic.
Its not really what I want but I guess it going to have to do.

The script I found is:

:local voltage ([/system health get [find where name=“voltage”]]->“value”)
:if ($voltage < 23) do={
:log info “Sending email alert…”
/tool e-mail send to=email@example.com subject=([/system identity get name] . " - Low Voltage Alert!") body=("Low voltage alert! Current voltage is: " . $voltage)
} else={
#:log info “Voltage is ok.”
}

The email looks as follows:

Low voltage alert! Current voltage is: 22.1

I would like it to display as follows:

Low voltage alert!
Current voltage at “Highsite name” is: 22.1

I have tried editing this line to the following but its not working:

/tool e-mail send to=email@example.com subject=([/system identity get name] . " - Low Voltage Alert!") body=("Low voltage alert! Current voltage at([/system identity get name] is: " . $voltage)

Can someone please help correct this line for me?

Clive.

I think it is a matter of (double) quotes.
The dot means “concatenate” (same as - to give you an example - & in Excel formulas), text and variable(s) needs to be separated.
And seemingly you missed a closing round bracket (or maybe they are not needed.
Your test:

/tool e-mail send to=email@example.com subject=([/system identity get name] . " - Low Voltage Alert!") body=("Low voltage alert! Current voltage at([/system identity get name] is: " . $voltage)

Try:

/tool e-mail send to=email@example.com subject=([/system identity get name] . " - Low Voltage Alert!") body=("Low voltage alert! Current voltage at " .([/system identity get name]) . "is:"  . $voltage)

or:

/tool e-mail send to=email@example.com subject=([/system identity get name] . " - Low Voltage Alert!") body=("Low voltage alert! Current voltage at " .[/system identity get name] . "is:"  . $voltage)

the board code parser seemingly does a good work.

Thanks very much for your time. It’s working well.