Yes, right but I was looking in the wrong way. I needed to simply add a call to libhal_ctx_set_device_condition() and all works as expected. Thanks for your help!