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

Text item= CameraStatus

String CameraStatus “Camera Motion Status” { http="<[ON:GET: (.))] " }

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

String CameraStatus “Camera Motion Status” { http="<[*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
	at java.util.regex.Pattern.error( [?:?]
	at java.util.regex.Pattern.accept( [?:?]
	at java.util.regex.Pattern.group0( [?:?]
	at java.util.regex.Pattern.sequence( [?:?]
	at java.util.regex.Pattern.expr( [?:?]
	at java.util.regex.Pattern.compile( [?:?]
	at java.util.regex.Pattern.<init>( [?:?]
	at java.util.regex.Pattern.compile( [?:?]
	at org.eclipse.smarthome.transform.regex.internal.RegExTransformationService.transform( [213:org.eclipse.smarthome.transform.regex:0.10.0.oh230]
	at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform( [195:org.openhab.core.compat1x:2.3.0]
	at org.openhab.binding.http.internal.HttpBinding.execute( [223:org.openhab.binding.http:1.12.0]
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute( [195:org.openhab.core.compat1x:2.3.0]
	at org.openhab.core.service.AbstractActiveService$ [195:org.openhab.core.compat1x:2.3.0]```

This is the webpage (if that means anything)

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

I forgot a bracket at the end:

String CameraStatus “Camera Motion Status” { http="<[*status (.*))] " }