How can i convert the output of a HTTP request to a simple on/off (where ACTIVE=ON, PAUSE=OFF)
REQUEST: http://ip:7999/1/detection/status
OUTPUT: Camera 1 Detection status ACTIVE
I have set up an item to control motion detection on motioneye (switch below), the toggling works fine but i would like to monitor the state, is that possible? thank you.
Just got home and tried it out, no bueno any ideas?
Here is the log:
2018-10-08 17:15:18.946 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item ‘CameraStatus’ for widget org.eclipse.smarthome.model.sitemap.Text
Still no luck, im getting this message. Thank you for your help, not to worry i dont desperately need it!
2018-10-08 18:26:57.019 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread HTTP Refresh Service
java.util.regex.PatternSyntaxException: Unclosed group near index 13
^.*status(.*$
^
at java.util.regex.Pattern.error(Pattern.java:1957) [?:?]
at java.util.regex.Pattern.accept(Pattern.java:1815) [?:?]
at java.util.regex.Pattern.group0(Pattern.java:2910) [?:?]
at java.util.regex.Pattern.sequence(Pattern.java:2053) [?:?]
at java.util.regex.Pattern.expr(Pattern.java:1998) [?:?]
at java.util.regex.Pattern.compile(Pattern.java:1698) [?:?]
at java.util.regex.Pattern.<init>(Pattern.java:1351) [?:?]
at java.util.regex.Pattern.compile(Pattern.java:1054) [?:?]
at org.eclipse.smarthome.transform.regex.internal.RegExTransformationService.transform(RegExTransformationService.java:67) [213:org.eclipse.smarthome.transform.regex:0.10.0.oh230]
at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:65) [195:org.openhab.core.compat1x:2.3.0]
at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:194) [223:org.openhab.binding.http:1.12.0]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144) [195:org.openhab.core.compat1x:2.3.0]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166) [195:org.openhab.core.compat1x:2.3.0]```