val jsonString = JSON_SMA.state.toString
if (jsonString != null) {
number_SMA_DCVermogenA.postUpdate(transform("JSONPATH","$.result.XXXX-XXXXXXXX.XXXX_XXXXXXXX.1.0.val", jsonString))
}
2018-03-18 08:09:37.300 [INFO ] [.eclipse.smarthome.model.script.RULE] - JSON from SMA inverter changed!
2018-03-18 08:09:37.301 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'Process JSON from SMA Inverter': The argument 'state' must not be null or empty.
jsonString is not āā, thatās what we proved by outputting them to the log here, no?
So I checked if it really was empty or null, which it isnāt. Iām outputting both the item defined in the items file to the log and the jsonString val object and they both return the JSON in the log fileā¦
If I comment out the number_SMAā¦ transform rule, the error disappears in the logging. Additional strange thing is that I have multiple of these code-lines (vermogen means power in Dutch, so I have power,amperage,voltage etc) but Iām seeing the error only once though I would expect to see it the amount of times I have defined a statement to process a valueā¦
The empty rule log line is coming from the
logInfo("RULE", tester)
And tester should contain the transformed value but something is going wrong there I think, or am I misunderstanding you?
And just to tease you a bit, please try to get used to code fences. It increases the readability a lot. There are buttons for that above the textfiled, or just type the trippled quote.
Everything has been working fine but for the last couple of days the logging suddenly stops. Itās not a session issue because when I use the URL used in the HTTP binding it responds with the JSON but after a restart of OpenHAB everything starts working again.
Openhab.log shows nothing apart from just suddenly stopping with processing the ruleā¦
@hyperbart could you post up your working thing please, Iām having the same problem with libcurl not supporting and I want to check my formatting against your solution. Thanks in advance
@hyperbart Could you post your solution (things, rules, etc) as an example or PM this to me? I am working on getting the info from my Diehl inverter in the same way as you did for your SMA inverter.
@hyperbart Similar like @flagg wrote before, I work on the same solution for reading out and accessing a heat pump by cURL commands with the HTTP binding. The returns are JSON data. This works fine with POSTMAN. Now I want to transfer this into my openHAB.
Would you please post your complete solution as example?