The value isn’t needed and looking at the json message the ison doesn’t contain a string (and quotes). If this doesn’t work maybe try to post the error in the openhab.log. Usually this helps to identify the error.
When the transformation returns the full string, it indicates an error in the transform. I would expect to see something in the logs.
In this case, I don’t think the .value is right. Shouldn’t it be just json.ison?
Also, in JavaScript I believe when you have an operation as the condition, you need to put it in parens.
return (json.ison == true) ? "ON" : "OFF"
But, like @supersjel notices, in the JSON string the boolean isn’t in quotes so it should be a boolean in the parsed json Object
return json.ison ? "ON" : "OFF"
This is a simple JSON string without arrays so the JSONPATH transformation might be more appropriate. Then the definition of the transform exists inline instead of needing to exist in another file.
JSONPATH:$.ison
You can using the onValue/offValue parameters to map the true/false to ON/OFF.
Ok, maybe a step back. To use jsonpath and js transformations you have to install some add-ons if I remember well. Long time ago, you tend to forget these things. Ring a bell?
No, you’ve now have onValue and offValue defined twice.
Correct. You need to replace the properties that are there, not define them again.
This is why I hate .things files. So much time spent chasing syntax errors that are impossible to make through the UI.
A lot of these errors should show up in the logs as errors. Loading your .things file should show errors because of the duplicate properties. The JS Transform should have shown errors because of the .value.
Also, on some bindings you have to restart OH to pick up changes to .things files. Are you certain you are even running with these changes?