Netatmo API linked to Workflow

Hi there, I hope that there is someone who can help me with this problem I want to solve.

I want to link my Netatmo Weather Sensor with Siri, whilst I have done this in the past through Homebridge, I wanted to try it with Workflow/Shortcuts ability to operate with Siri now. I also thought unlike the Homebridge method, it could retreive the rain and wind sensor I have.
I would imagine two methods to getting this would be through Workflow’s IFTTT integration but I would prefer it if it was done through Workflow’s native API ability. I also want to share it with everyone else on this forum.

Thank you if you can help me out with the heads up

1 Like

I hope this goes somewhere, I also have a Netatmo station I love. :slight_smile:

1 Like

I hope so too, I have looked at how the Netatmo API works, I can understand that but do not know the next leap to transition it to Workflow, can someone give me a quick run down of how Workflow uses web API’s?

Have you read through the help topic on it?

2 Likes

I suggest checking out the documentation that @sylumer linked to – it’s Apple’s new version of the Workflow documentation, but here’s the archived version I wrote originally as well.

Here’s the link to the Netatmo Smart Home API documentation too.

Services like theirs are usually geared towards developers building tools for other users, so they utilize OAuth 2 (which doesn’t work with Workflow/Shortcuts as there’s nothing engineered to store tokens for third-party apps to hook into). However it may be possible once you sign up to use a developer’s access token, but I can’t tell from it so far.

Here are the initial instructions, for reference:

  • Create an app with your developer account (Netatmo account owning the app).
  • Request for each of your users an access_token associated with the scope your app requires
  • Users will grant your app access to their Netatmo account for the specified scopes

If you get into this and post where you get stuck, I might be able to help you along!

1 Like

Thanks so much for the links @sylumer and @matthewcassinelli That you shared, they got me a lot further down the track than I expected. I have now gotten to a stage where I am getting stat from my weather station. The next step is to analyse the large data set it gives me and cut it down to something that Siri can say back to the user. I will share the workflow once I get to that stage which shouldn’t be too long now!

1 Like

Exciting news, I have now made it to a stage where the workflow is complete. It now receives my weather station data and Siri now speaks it back to me. I am so happy to have it up to this stage, however, I have not been able to link my other sensors such as the outdoor one and the wind/rain ones. I have discovered that this is due to the JSON tree having layers named the same that are within the same encompassing layer. I do not understand how to choose the second layer within workflow with the Get Dictionary command. Could someone please help me with this (@matthewcassinelli)? I am happy to work with someone again to get through this JSON file. Once there, I will share the workflow with the community here.

3 Likes

A dictionary can contain a dictionary, so retrieve the element which is the sub level of data and treat it as a dictionary object.

This JSON example workflow might help explain this.

There we are, I have made the workflow and here is the link to it. There is a lot of optimisations left to do with my variables to turn them into magic variables but it’s done. The only thing that bugs me with it which doesnt make it quite compatible with Siri in the Shortcuts Beta is that the Get dictionary within the loop part requires manually tapping of the dictionaries which Siri does not support so the shortcut leaves out that data. I will also share another version of it that has the rain and wind sensor omitted from it so that those people without the extra modules can use it as well. I am more than happy for someone to help with that dictionary issue as I do not understand what is happening and why it manually asks for it. But have a go and hope this helps other people out there. :grinning:Workflow link

That’s great!
I don’t have the wind or rain sensor (yet), but I do have an extra indoor sensor, so I did some reworking: Netatmo V2.

This does several things:

  • Makes it easier to set up for the user (you fill in text boxes, vs recreating the authentication parameters).
  • No device ID required.
  • Takes the name of the indoor (sensors) and uses those.
  • Makes each module except the main optional.
  • Uses magic variables, I didn’t completely rework it, but I did do some reworking!

Give it a whirl and see if it still works for you :slight_smile:

2 Likes

Rosemary, where did you get the Client ID and Client Secret?

From dev.netatmo.com - you can sign up and “create an app” there :slight_smile:

1 Like

Perfect, I see, thanks!

1 Like

Thanks for that Rosemary, it is definitely a lot neater than mine and clearer as well. However, I have had some issues with using it on my account. It has not been finding any of my external modules besides the indoor one I have. I believe the issue is due to the Dictionary Calls not going to the right selection of the JSON File. I have been using this JSON Tree visualisation to help me navigate the file and whilst it doesn’t show it directly here, the sensors data is in another section. Can you help me with pointing your workflow to these sections? My problem is trying to get Workflow to loop to the same place on seperate occaisons despite the sections being named the same, hopefully someone else in this thread could help with that

Devices in my account lists everything and from the documentation the outdoor modules should be included. I’ll have a look after work and see if I can figure out why.

Hi Rosemary! This is an incredible shortcut/workflow. I also like speedmaster are only get a read out for my main module not my additional sensors. I have gone through many things and can’t work it out. Ideally I would like to create several of these, one for each sensor so I can have a separate Siri phrase for each read out :). Appreciate your incredible efforts, just seeing what we both need to do to get the other modules working rather than just the main base station? Thanks :slight_smile:

I also forgot to mention my station is setup as follows:
Main module (living room), outdoor module, rain gauge, wind metre and additional indoor sensors in main bedroom and spare bedroom.

Anyone had any further luck?

Ideally this is my aim:
-Shortcut for living room (main module)
-Shortcut for outdoor module
-Shortcut for wind module
-Shortcut for rain module
-Shortcut for bedroom module (additional indoor module)
-Shortcut for spare room module (additional indoor module).

Hi there,

Sorry I have been silent on this, school has gotten the better of me with end of year exams approaching, I have finalised the shortcut learning from everything in this thread and the helpful comments from these people in the forum. The shortcut has worked perfectly for me for the past week without issue and now I can share it. This is still a master one as such where it gets all the data and provides a weather report from: Rain, Wind, Main Indoor and Outdoor sensors. However I could see it easily being split up into smaller Shortcuts as the first part of this shortcut is authentication, the 2nd about pointing the shortcut to the right part of the JSON file to readings and the last part to get the numerous weather data you may want such as wind speed, rain amount and temperature. I want to do the same as you @IslandSandMan and will do so in the next 7 days but have fun with this shortcut for the time being and see what you can do with it too

2 Likes

This is absolutely awesome Leighton! Can’t wait to give it a whirl when I get home from work. The dream is coming true :heart_eyes:. Appreciate your incredible efforts, and I will see what I can do with it too :blush:. - ps: love how simple you made it for novices like me.