New Netatmo integration

Don’t know, I have two thermostats and 3 valves, they sometimes become unavailable in HA, but it usually come back online without doing anything.
However, even when everything is working, the sync between HA and Netatmo cloud is very slow. In example, it takes one minute for the OFF command in HA to be applied in the Netatmo app and to the thermostat.

The sync between Ha and Net is slow, can take 5/10 mins.

Issuing commands (off, frost guard etc) is pretty much instant with me when things are back to normal, Just tried it.
The feedback after adjustments from Netatmo to HA can take a while.

I’ve come from SmartThings a year ago and the Netatmo integration there was a pain! It did work so much better on HA…a month or two ago that is.

The reason for the slow sync is because the webhook gets blocked by Netatmo almost instantly. We’ve discussed possible solutions with them but none has been put into place yet. That’s why I recommend using individual Netatmo dev accounts. Webhook events improve the responsiveness dramatically.

Interesting…
I’ve been toying with SmartThings and Netatmo to check things and to rule out any restrictions my end.
I know this is a cloud to cloud service but it is working perfectly on ST now and the account link service is the same as HA.
Amendment in ST are shown within 5 seconds, but amendments on local devices to show in ST app is the same 5/10 mins. Data retrieved and what can be managed in ST are very limited compared to HA.

Well, probably because SmartThings provide a singular endpoint for the webhook contrary to how things are handled with HA. With HA you roll your own endpoint for the webhook. But since all use the same Netatmo API account when using the cloud linking a single erroneous endpoint will cause the webhook being banned. Hopefully Netatmo will eventually end up banning only individual IPs rather than banning it for all.

1 Like

Thought I’d give an update here regarding this. Updated my hardware to use the X86 platform - more reliable/faster then the PI and Netatmo loads every time now after a reboot of HA.

However if Internet/wifi drops off, the Netatmo integration will NOT recover unless a reboot is done.

On my system I tried to use a Netatmo developer account as mentioned earlier by @cgtobi and now the Netatmo cloud, the devices and HA all sync almost instantly. Since I did it, I never faced any unavailability issue of the Netatmo entities in HA.
I followed the tutorial in the integration documentation :

1 Like

@adrien.b Thank you.

I have done like you said again - still no recovery.
Have you tried disconnecting relay from network or wifi disconnect until HA entities are unavailable and then restore to see if things come back to life?

What works best for me is using the Configuration.yaml setup via ‘add integration’, then ‘Reload’ works fine without the restart HA prompt.
Net_conf

My work around for entity revival is to make an automation when devices become ‘unavailable’ for over 5 mins, then reload automatically. :))

That’s a good idea…I tend to just reload the integration manually if Climate not there after a restart…any chance you would share the code for your automation?

Sure no probs…

The Automation was quick to do and to get things started.

Getting the Reload feature to work takes some effort. Basically calling an script after option selection to fire a rest command.

alias: (System) Reload Integration Netatmo if Hall unavailable
description: ''
trigger:
  - platform: state
    to: unavailable
    for: '00:05:00'
    entity_id: climate.netatmo_hall
condition: []
action:
  - service: input_select.select_option
    data:
      option: Netatmo
    target:
      entity_id: input_select.select_integration
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - service: script.reload_integration
  - service: notify.pushover
    data:
      target: stephen
      title: Netatmo integration just reloaded
      message: Netatmo reloaded due to Hall stat Unavailability
mode: single

Go here for instructions for Reloading integrations of your choice.

https://community.home-assistant.io/t/add-service-integration-reload/231940

The config.yaml REST command setup that works for me.

rest_command:
  reload_integration:
    url: !secret reload_integration_url # http://192.168.x.xx:xxxx/api/config/config_entries/entry/{{entity_id}}/reload
    method: POST
    headers:
      authorization: !secret api_bearer_token
      content-type: application/json
    payload: >
      {{entry_id}}
1 Like

Cheers Stephen, that’s great.
Out of curiosity (and to stop me digging where I don’t have to :slight_smile: ) why are you using the REST command in your automation and not an action like this in your setup…

action:
  - service: homeassistant.reload_config_entry
    target:
      entity_id:
        - climate.netatmo_downstairs

Your welcome.
Its a setup I have from way back and it works for lovelace and automations.
Reload of config entry doesn’t do a full Reload like when hitting the reload option. Just double checked via Developer tools.
Does it with you?

If it does work, then yes use that instead. :slightly_smiling_face:

1 Like

Yeah it works that way…that’s how I’ve been reloading manually…well that and sometimes via the Integrations page.
Just curious as why you use one way vs the other…the age thing makes sense. As HA gets more mature there’s always a quicker way to do something :slight_smile:
Thanks again :+1:

1 Like

Cool.
Yes, great HA is evolving so quick. One reason I had to come away from the RaspPI…so much going on now regarding IO.
And I like to over complicate things. :joy:

edit: just made devices go unavailable. Built in reload does work. Thanks Gav_in. :+1:

1 Like

Great that you found a workaround until I find the time to properly fix this. Sorry for the inconvenience.

3 Likes

My Netatmo system became unavailable 3 hours ago. Saw that once back at home. Tried your automation, but it didn’t work, maybe because the integration has no “Reload” option in the menu. I think it’s linked to the fact I’m using a developer account and the integration is set by the configuration.yaml providing the client I’d and keys.

Funny.
All my Netatmo devices went unavailable at about 13:00 UK time and for some reason my auto reload didn’t work (reload function wasn’t in menu).
Restart of HA solved. Could of been a Netatmo outage.

I’m using the config.yaml install and normally it would work fine.

Do a test by disabling/enable relay to make entities unavailable, then reload after connection - it should work.

Yes, may be related, I checked and the Reload option is back in the menu on the Netatmo integration panel.

There is currently a message on the Netatmo support page..

Hi,
Anyone can explain me why I can’t obtain debug logs of NETATMO?

I added the follow line:

homeassistant.components.netatmo: debug
homeassistant.components.netatmo.webhooks: netatmo