Help pulling out Status from HTTP request

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.

Switch CameraMotion “Camera Motion” { http=">[ON:GET:http://ip:7999/1/detection/start] >[OFF:GET:http://ip:7999/1/detection/pause] " }

This will pull the status of the camera every 10 seconds

String CameraStatus “Camera Motion” { http="<[ON:GET:http://ip:7999/1/detection/start:10000:REGEX(.*status (.*))] " }

Thank you for your help!

You’re welcome
Did that work?
If yes, then please mark the thread as solved. Thanks

Just got home and tried it out, no bueno :frowning_face: 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

Sitemap
Text item= CameraStatus

Item
String CameraStatus “Camera Motion Status” { http="<[ON:GET:http://192.168.1.50:7999/1/detection/start:10000:REGEX(.status (.))] " }

My mistake.
I kept you item and mage my changes, the http binding is like this:

String CameraStatus “Camera Motion Status” { http="<[http://192.168.1.50:7999/1/detection/start:10000:REGEX(.*status (.*)] " }

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]```

This is the webpage (if that means anything)

<!DOCTYPE html>
<html>
<head><title>Motion 4.1.1</title></head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<body>
<a href=/1/detection>&lt;&ndash; back</a><br><br><b>Camera 1</b> Detection status ACTIVE
</body>
</html>

I forgot a bracket at the end:

String CameraStatus “Camera Motion Status” { http="<[http://192.168.1.50:7999/1/detection/start:10000:REGEX(.*status (.*))] " }