JS Rule catch error

It depends on your keyboard and operating system. It’s in the description in the UI so I usually just copy and paste it from there as I create the Thing in the UI.

It’s the standard math intersection character so it’s part of unicode (U+2229 to be precise).

Since you were not using it before, that isn’t the cause of the warning.

I have now the following in my config

Thing http:url:deye "Deye Inverter" [
    baseURL="http://user:pasword@[ip]/status.html",
    headers="",
    authMode = "BASIC",
    ignoreSSLErrors = true,
    delay=0,
    stateMethod= "GET",
    refresh= 60,
    commandMethod= "GET",
    timeout= 3000,
    bufferSize= 2048,
    refresh=15] {
        Channels:
         Type number : energyTotal "Energy Total" [ mode="READONLY", stateTransformation="REGEX:(.webdata_total_e.)∩REGEX:.*var webdata_total_e = \"([0-9]+[\\.][0-9]+).*∩JS: |>
         Type number : currentPower "current Power" [ mode="READONLY", stateTransformation="REGEX:.*var webdata_now_p = \"([0-9]+).*"]
}

but still getting this error

2024-06-08 21:23:50.347 [WARN ] [penhab.core.config.core.ConfigParser] - Conversion of value '' with type 'class java.lang.String' to 'class java.util.ArrayList' failed. Returning null

It’s a warning, not an error so probably not something you have to fix.

It’s saying you have an empty string where an array is expected.

@rlkoshak is there a way if the parsing return a ‘0’ that this value will not be used?

I don’t know. I don’t use .things files and don’t support them. I would guess if it’s not used you should not include it but :man_shrugging: .

Sorry for missunderstanding and also miss explaning from my side…

The value energyTotal should only considered if it is bigger than ‘0’ of it’s smaller or even ‘0’ the value should not be updatet.

this is my current syntax

Type number : energyTotal "Energy Total" [ mode="READONLY", stateTransformation="REGEX:(.webdata_total_e.)∩REGEX:.*var webdata_total_e = \"([0-9]+[\\.][0-9]+).*∩JS: |> 0) ? input : 0"]

Where did you get the syntax for this? There a whole bunch wrong with it. It’s not valid JS code. Something like the following might work:

JS:| (parseFloat(input) > 0) ? input : 0

The original was basically unparsable (no open parens, nothing to the left of “>”) and logically incorrect (input is a String so “2” > “10” because “2” comes later alphabetically.

I tried this

REGEX:.*var webdata_total_e = \"([0-9]+[\.][0-9]+).* ∩ JS:| (parseFloat(input) > 0) ? input : 0

But still it’s 0 if the inverter goes offline

If you want to avoid the Item being updated at all you are out of luck. There is no transformation that will prevent the update from flowing through to the Item. You can change that update through a transform but you cannot prevent the update from occurring at all.

All you can do is if the value doesn’t make sense or there is some other error value convert that to something else (e.g. 0, UNDEF, NULL, the current state of the Item, etc.).

If the Thing itself goes offline you’ll need some external rule to change the state of the Item.

If you need an Item that doesn’t update at all, you’ll need to use a rule and a Proxy Item.