Map battery level to %

Looks like you got the answers but I’ll reiterate.

  1. The rule will never trigger unless you explicitely send a command to Group_Netatmo_Battery. Commands send to members of Group_Netatmo_Battery only generate updates to Group_Netatmo_Battery.

  2. Even if the trigger worked, triggeringItem would be set to Group_Netatmo_Battery, not the member of the Group that caused the Rule to trigger (see the new Member of trigger in the link from Josar below)

  3. As Josar indicates, in this case you might be able to get away without using the proxy Item but it will be really easy to run into problems if you ever have any other rules that trigger on updates.

Personally, I think this is really a job for a JS transform rather than a Rule. Leave the Items as is and use

(function(i) {
    if(isNaN(i) return "NA";
    return i*20;
})(input)

Then the label becomes “Battery status [JS(battery.js):%s %]” or something like that. No proxies, no rules.

1 Like