Removal of Undocumented Device Type Data Storage Option - 1/19/2017

Could you elaborate on this feature please. How does one capture this event

It also emits an event to inform clients that a new image is available.

There arenā€™t any examples I can find where this is happening, but you should be able to bind to the emitted events like this:
subscribe(<cameraDevice>, 'image', <imageEventHandler>)

1 Like

Follow up question. How does one delete pictures from the cloud or set an expiration date ? If not possible whatā€™s the timeout for the same?

1 Like

Mature companies can give you one without the other.

ā€œIā€™ll take a week of inconvenience in the name of security any dayā€¦ā€

Especially the week of inconvenienceā€¦ :wink:

Hang on just noticed something vis-a-vis your original post. Couple of questions:

  1. storeImage still works - will this continue to work? (I hope so because itā€™s being used for cameras with non local images being returned through httpGet)
  2. You spoke about getTemporaryImage(String key) but that doesnā€™t seem to work, it throws an error

Error: groovy.lang.MissingMethodException: No signature of method: script14855936530701998199908.getTemporaryImage() is applicable for argument types: (java.lang.String)

So how does one access that image? I need to process the image before uploading it via storeImage. I was doing it earlier through the old method but how do I do that now?

Thanks! Its working very well.

2 Likes

Thank you for getting an alternative pushed out so quickly.

2 Likes

Sorry I have limited access to Internet this week, Iā€™m out of country.

I ended up removing the getTemporaryImage method based on the reasoning that you can access and modify images once it is in the collection stored by the device (i.e. getImage and storeImage)

Do you need to modify the image before it is emitted to ST clients?

1 Like

No but I need access to the raw byte data for analysis. Didnā€™t know about getImage. Do you have the API template for it?

I have tried to update a device handler but I am getting the following error when calling the storeTemporaryImage method

ā€œThe specified key does not existā€

The error seems to imply the key returned by the event isnā€™t correct

Does anyone have any ideas?

Which handler have you been using? Posting your code would probably help.

I am using a slightly modified version of the Foscam handler posted by ST earlier in the thread.

What shows in your simulator log when testing? The parse method logs the value received from the device response, mine looks something like

418f5d1a-df5f-49a7-ad3d-e9243945bd4f ā€Ž12ā€Ž:ā€Ž13ā€Ž:ā€Ž06ā€Ž ā€ŽPM: debug Parsing 'index:17, mac:0080F0B6BA9C, ip:C0A801FB, port:0050, requestId:6e23ed4c-d143-4dd2-93c1-e36947846f5c, bucket:smartthings-device-conn-temp, key:534aadcb-ec08-4931-945c-d7b3b24c8612'

But the code I stole parses that string using a custom function, not the stringToMap function. I think stringToMap might expect JSON?

This is what I am getting back, its successfully parsed into an array and everything seems complete.

'index:17, mac:E8ABFA6BBD78, ip:C0A80203, port:0058, requestId:d3b63da0-effe-4614-968e-76f14add0a40, bucket:smartthings-device-conn-temp, key:546a7c13-3de4-40d2-b4ab-057a46c7d9bc'

Is mapped into this

[index:17, mac:E8ABFA6BBD78, ip:C0A80203, port:0058, requestId:d3b63da0-effe-4614-968e-76f14add0a40, bucket:smartthings-device-conn-temp, key:546a7c13-3de4-40d2-b4ab-057a46c7d9bc]

Same error with getImage() also, somethingā€™s mixed up with the bucket/key mapping those APIā€™s @gausnes

error com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: F47DFCB9AE713EE6), S3 Extended Request ID: UBu+wgIP26NOVTb153pCl0CQ0bW/xEhgeH3wKhn7RdB2FZ/BVTukX5mZVH/xLQl7GZ1jAzWgeO0=

Weird, mineā€™s still fine. That error text definitely appears to be from S3. I wonder if the firmware update scheduled for today is the difference. Iā€™m still on 000.016.00011.

storeTemporaryImage() is working, getImage() isnā€™t

I am on firmware version 000.016.00013 if that helps anyone

Thatā€™s not the problem, Iā€™m on v 16.13 now and cameras are still working.