Notification Forwarding

Jason7 years ago

I've been playing around with event forwarding, but the amount of data is simply too great for my application.
Has anyone created a way of sending plain text notifications to a socket?
ie. "Device 1 is offline" instead of:

{"event":{"id":1,"attributes":{},"deviceId":1,"type":"deviceOffline","serverTime":"2018-08-06T15:56:43.331+0000","positionId":0,"geofenceId":0,"maintenanceId":0},"device":{"id":1,"attributes":{},"groupId":0,"name":"Device 1","uniqueId":"338045","status":"online","lastUpdate":null,"positionId":0,"geofenceIds":[],"phone":"","model":"","contact":"","category":null,"disabled":false},"users":[{"id":1,"attributes":{},"name":"admin","login":null,"email":"admin","phone":null,"readonly":false,"administrator":true,"map":null,"latitude":0.0,"longitude":0.0,"zoom":0,"twelveHourFormat":false,"coordinateFormat":null,"disabled":false,"expirationTime":null,"deviceLimit":-1,"userLimit":0,"deviceReadonly":false,"token":null,"limitCommands":false,"poiLayer":null,"password":null}]}
Peter Flower7 years ago

That's JSON dude, that's perfect! Only take the index that you want.

Jason7 years ago

Yeah the problem is there's no index thats formatted like a notification. If one of them was "Device 1 is offline" it would work really well.