It’s not a REST solution, but I’ve had success with the MQTT module.
My IoT device sends a MQTT message, and my Mendix app subscribes to receive these messages. This works in near real time, so could solve your 20 second issue.
As I was writing my own code on the microcontroller, it was easy for me to link it all together. If you don’t control the code on your microcontroller / IoT device, then this may not be an option.
Good luck!