I believe that the Form Property resource available only for PRODUCTS would help in this case.
I have been studying this same issue.
Define operating states for the device Manual, Automatic… And relay states (off/on).
Apparently, the way is to develop a form linked to a device/Product property. I have already achieved this successfully. It remains to test the consistency of this approach with the command to turn the relays on and off via the device API in a consistent and reliable way.