Hi, i’m a beginner with OH v3 but have some experience with OH v1. Now try to slowly migrate to v3, and had a stop with simple question - how i can send command with http binding?
I have video recorder that run record with command “http://localhost:874/avreg-cgi/operator/rec.cgi?camera=4&do=start”, i made a thing with http binding and specify base_url as "http://localhost:874/avreg-cgi/operator/rec.cgi?", made a channel (string) and specify Command URL Extension as “camera=4&do=”, and … uuups, my brain is stopping What i need to configure that adding “start/stop” ending to the final url?
I understand that i need to configure switch (may be string) item and rule with sending command to this item, but how to transform ON command to “start” ending of the url - i cant figure out. Help pls
Also, i’m configure state channel with State URL Extension as “camera=4&do=status” and it’s work fine.
yes, i can’t undestand how to configure parameter “commandTransformation” for transformation command On (OpenHab) to Start (value that need to be added to baseURL + commandExtension), and i can’t find any example.
did not work, most likely there is not enough experience to implement
it turned out and works successfully, thank you very much
for information, why it did not work for me right away - it was necessary to add to the “%2$s” to the commandExtension,
“rec.cgi?camera=4&do=” - wrong string
“rec.cgi?camera=4&do=%2$s” - correct string
Well, %2$s is substituted with the status of the Item (after replaced with onValue or offValue). When setting up an extension, you have to define the position of the substitution. It could also be on the beginning of the extension or somewhere in the middle…