FerventGeek Posted December 7, 2022 Posted December 7, 2022 I'm looking at the Portal API in case I have to move away from MobiLink with a shift to IoP on Polisy. Does the UD Portal support REST subscriptions? https://wiki.universal-devices.com/index.php?title=ISY_Developers:API:REST_Interface#Subscriptions_(Web_Sockets)
bmercier Posted December 7, 2022 Posted December 7, 2022 11 hours ago, FerventGeek said: I'm looking at the Portal API in case I have to move away from MobiLink with a shift to IoP on Polisy. Does the UD Portal support REST subscriptions? https://wiki.universal-devices.com/index.php?title=ISY_Developers:API:REST_Interface#Subscriptions_(Web_Sockets) Portal does not support websockets. You can however get a subscription using a web service. You have to make a POST /services (using preferred ISY) or POST /<isyKey>/services This should get you started: const customHeader = { SOAPACTION : '"urn:udi-com:service:X_Insteon_Lighting_Service:1#Subscribe"' } const body = new Buffer.from('<s:Envelope><s:Body><u:Subscribe xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><reportURL></reportURL><duration>infinite</duration></u:Subscribe></s:Body></s:Envelope>') Benoit 2
FerventGeek Posted December 7, 2022 Author Posted December 7, 2022 1 hour ago, bmercier said: Portal does not support websockets. You can however get a subscription using a web service. You have to make a POST /services (using preferred ISY) or POST /<isyKey>/services This should get you started: const customHeader = { SOAPACTION : '"urn:udi-com:service:X_Insteon_Lighting_Service:1#Subscribe"' } const body = new Buffer.from('<s:Envelope><s:Body><u:Subscribe xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><reportURL></reportURL><duration>infinite</duration></u:Subscribe></s:Body></s:Envelope>') Thanks. I already built something like that- golang subscriber pushing to AWS SNS. Still hoping it will eventually be built into a portal. The old SOAP wrappers have all the magic.
Recommended Posts