Closed dilyanpalauzov closed 1 month ago
Recently some PR’s were merged. The documentation has been adapted. Both ways should be possible, could you re-test with 4.3.0 M1 ?
I switched to OpenHAB 4.3.0.M2 and in one .thing file changed
Type number :termo "T" [stateTopic="a/b", transformationPattern="JSONPATH:$.AM2301.Temperature", unit="°C"]
with
Type number :termo "T" [stateTopic="a/b", transformationPattern="JSONPATH($.AM2301.Temperature)", unit="°C"]
It works!
The documentation has been adapted.
How is the documentation supposed to spell the delimiter between transformation name and formula? https://next.openhab.org/docs/configuration/transformations.html uses brackets, https://next.openhab.org/docs/configuration/transformations.html uses colon.
The documentation has been adapted.
How is the documentation supposed to spell the delimiter between transformation name and formula? https://next.openhab.org/docs/configuration/transformations.html uses brackets, https://next.openhab.org/docs/configuration/transformations.html uses colon.
Not sure if i underrstand your question, as the links lead to the page, not to a specific paragraph. Both syntax are supported. Maybe @jimtng added a PR to make the delimiter configurable. Please raise a new issue if you think this should be further adapted.
The syntax is not configurable.
https://next.openhab.org/docs/configuration/transformations.html uses colon.
Can you copy paste or take a screenshot of where it uses colon?
The documentation has been adapted.
I tried to find this adaptation, but could not. I also do not see where it is spelled, that both syntax can be used. (Yes, both forms can be used!, but this is not articulated.)
Not sure if I underrstand your question, as the links lead to the page, not to a specific paragraph.
At https://next.openhab.org/docs/configuration/transformations.html I mean e.g. this line in the Usage section:
Number Kitchen_Temperature_C "Temperature [JSONPATH($.temperature):%s °C]" {/Some Binding/}
and the other link was supposed to be https://next.openhab.org/docs/configuration/things.html in Defining Bridges Using Files section with:
Type string : Version [stateTopic="stat/sonoff_dual/STATUS2", transformationPattern="JSONPATH:$.StatusFWR.Version"]
According to https://www.openhab.org/docs/configuration/transformations.html to have a transformation one types the name of the transformation and then in brackets the content of the transformations, like
But after
transformationPattern=
andtransformationPatternOut=
using bracket after the transformation name is an error:So the .thing file has to use colon instead of bracket, e.g.
transformationPattern="REGEX:(.*POWER.*)"
. This is implied by the examples at https://www.openhab.org/addons/bindings/mqtt.generic/ .The problem report is that the spelling of the transformation formulae in openHAB is inconsistent: at some places one has to use brackets
DSL(…)
, on others colonDSL:
. This inconsistency is source of errors.transformationPattern=
andtransformationPatternOut=
to accept between the transformation name and the transformation code brackets, as documented at https://www.openhab.org/docs/configuration/transformations.html.I use openHAB 4, but with OpenHAB 3.4 this discrepancy was also present.