But this keeps the value as a String. Ideally I would like to transform it to a Number and not a String, so that it can be persisted and graphed by rrd4j. I don’t see any easy way to do this.
rule "Tesla State String to Number"
when
Item TeslaNumberState changed
then
if (TeslaNumberState.state == "online"){
TeslaState_num.postUpdate (2)
return;
}
if (TeslaNumberState.state == "asleep"){
TeslaState_num.postUpdate (0)
return;
}
end
I didn’t test it, but I think it should work.
1 Like
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
3
You’re reliant on the binding supplying channels suitable for Items of this type or that type. Some bindings provide many choices, some few/none.
The new profile feature allows some manipulation between channel and Item, but I do not think it (yet) provides for this kind of mapping or transformation.