How to get persistence recording offline status

Ok, now I get it.

Rich’s and pointers from the others has enabled me to find this post

Customising it for my setup gives me…

rule "Detect Hall Study light Online/Offline"
	when 
		Thing "hue:0220:00178829dcaf:7" changed
	then
		var status = ThingAction.getThingStatusInfo("hue:0220:00178829dcaf:7").getStatus()
		//logError("Debug", "Library Rules | " + status)
		
		if (status.toString() == 'OFFLINE')
		{
			//logError("Debug", "Attempting to turn off light")
			HallStudy_Brightness.sendCommand(OFF)			
		}
		else {
			HallStudy_Brightness.sendCommand(100)
		}
	end

Which works fine as MySQL now shows the persistence that I need.

Thank you to all, it’s now fixed.

All I’ve got to do now is work out why the Hue Bridge keeps going offline, but that’s for another question!

Cheers to all

Archaic