Help with Attributes vs Capabilities? (Grovestreams + Netatmo)

[quote=“RobR, post:22, topic:39987”]
I made the changes to the netatmo-rain.groovy and published it for me as a Device Handler,
[/quote] That’s how I would have done it, but I’ve never worked with a multi-file device type before so I can’t say for sure.

As long as you also added the subscribe line in the initialize method and the new rain handler method to the Grovestreams code, that SmartApp should detect whenever that rain attribute changes and write it to the live logging. If the value gets written to the log, but it doesn’t get sent to the Grovestream service, the sendValue line will need to be adjusted.

Thanks, both to you @krlaframboise and you @tgauchat - I now have it all working, but unfortunately I’m realizing that the Netatmo (Connect) device isn’t sending everything reliably. The thing I can’t figure out is where in @Dianoga 's code it actually knows how to do the OAuth, connect to the device, etc. The posted files are just for the tiles. As such, I can’t play around with what might be causing the errors.

1 Like

[quote=“RobR, post:24, topic:39987”]
The thing I can’t figure out is where in @Dianoga 's code it actually knows how to do the OAuth, connect to the device, etc.
[/quote]I’ve never worked with a cloud based device, but based on the documentation it looks like that part is handled in the Service Manager instead of the Device Handler.

I believe the service manager for this device is the Netatmo Connect SmartApp, but the code is not available through the IDE so I’m not sure.

What kinds of errors are you getting?

1 Like

Nate from ST Support helped me find the actual service code - it’s here.

Figured out the issue - @Dianoga used the /api/devicelist method for Netatmo which is actually deprecated now. It gives the LAST rain measure. His code is scheduled to poll ever 5 mins, but what happens is the Netatmo device will transmit data sporadically. When it does this, sometimes it sends in up to 3 pieces of rain data. That means you’ll only get one of them (I believe) with the current smartapp. Netatmo changed their API and the /api/gettmeasure method lets you state the last time you checked and get all measurements since then.

Given we now have the code, it could (relatively) easily be changed. Unfortunately I’m not much good at groovy beyond copy/paste/modify. A few sections need to be rewritten and have to parse different JSON from the new method.

I’d like to learn more about this type of app so I would take a stab at it, but I usually figure things out through trial and error. I’m assuming I would need an actual device to test it with and I don’t have one so I really can’t help with these changes.

Did you ever get this changed and working by chance?