[SOLVED] Display global variable on Habpanel

variables
habpanel
global
Tags: #<Tag:0x00007fd3110e4110> #<Tag:0x00007fd3110e3f80> #<Tag:0x00007fd3110e3df0>

(Tomax Me) #1

I stored data into global variable (one for string, one for numbers).
Now I’d like to display that data from global variable to Habpanel.

I’ve created new items:

String BatteryStatus "Battery Bank Status"
Number BatteryValue "Battery Bank Value"

In the rule, I tried to make these items to see the stored data:

BatteryStatus = status  //status - is the global var
BatteryValue = value    //value - is the global var

Error log:

2018-07-11 12:10:40.919 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'battery bank status': An error occurred during the script execution: Cannot assign a value in null context.

Where I’m wrong, please?


(Vincent Regaud) #2
BatteryStatus.postUpdate(status)  //status - is the global var
BatteryValue.postUpdate(value)    //value - is the global var

(Tomax Me) #3

Great! Thanks, Vincent!