I am struggeling with setting up a fibaro smart plug. I am using the FibaroGatway, that has a REST-API to read the state and change the state.
Unfortunately, the current state is defined as:
“value”.“true” ← means on
"value:“false” ← means off
so no problem, I use the onValue/offValue attributes
The part that I am struggling with is how to switch the state. it is done by the url /action/turnOn (and /action/turnOff)
- id: Eingeschaltet
I tried using MAP transformation in the Link as well as in the channel settings and I tried replacing the onValues with true /false and I tried to use the commandExtension with /action/turn%2$s I haven’t figured out how to do it.
I don’t want to write a rule for this…
Can you help?
I am using:
buildString: Milestone Build
the http binding from SmartHomeJ
266 │ Active │ 80 │ 184.108.40.206104290318 │ SmartHome/J Add-ons :: Bundles :: HTTP Binding
Did you try using the MAP Transformation as commandTransformation?
onValue/offValue are “bidirectional” so of no use where you have different ins and outs.
You could make separate read-only and write-only channels, each with appropriate onValue/offValue, and link them both to the same Item.
Or, with no onValue/offValue at all, use both stateTransformation and commandTransformation. You could use the same MAP file for both lookup jobs.
I don’t think %2$s helps you, as it will substitute ON/OFF not On/Off
I didn‘t try, but I think that. MAP transformation of the outgoing value (command transformation)
true → On
false → Off
together with %2$s should do the trick. If it‘s not a bug, this should first use
true as value for an
ON command and then transform it to
On and insert that as command in the outgoing request.
Thanks @J-N-K . It seems that I missed this constellation while trying all my possibilities last night.
- id: Eingeschaltet
using a transformatoin like this:
does the job.
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.