If you are using a custom device handler, or can work with a copy of a standard handler, then yes it can be done if you have set up the CLI.
That was the requirement John Constantelo had for his handler for a Xiaomi/Lumi sensor: