Nebri is the easiest way to write rules for home automation AND other software/machines. Here's an example to accomplish the light shutoff:
class high_temp_shutdown(NebriOS):
listens_to == ['shared.pebble_location']
def check(self):
# if pebble dongle is out or room, return true
return shared.pebble_location > 3 # in meters
def action(self):
smartthings.lights(2,"off")
It's a perfect tool for automating your house since you can pip install existing libraries for use in your script. Nest, SmartThings, Sen.se and so on. It's just Python!
And for a fuller explanation of why Python isn't a rules engine by itself, see this article. Just because Python itself can execute rules, you don't have a rules engine on your hands. It's a huge architectural shift in fact.