Ecowatt Integration: Smart scenarios in Gladys during power grid stress!

Hello everyone!

I set myself a small challenge today given the urgency: publish a complete Ecowatt integration in Gladys in one day, starting from scratch :grimacing:

As you probably know, with current electricity production, RTE is not sure that France produces enough electricity to cover the country’s consumption on the coldest days.

Given current weather forecasts, a first Ecowatt alert could be triggered this Monday due to the incoming cold (Source: Électricité : vers une première alerte orange Ecowatt déclenchée ce lundi selon RTE, doit-on craindre des coupures ? - midilibre.fr )

I think home automation is perfect to help us in this kind of situation.

On the Gladys side, I wanted to propose two things:

  • Be able to visualize Ecowatt forecasts in Gladys
  • In scenes, be able to react to an Ecowatt alert by automatically reducing your electricity consumption + sending you an alert (Telegram, or other)

The result:

The integration is almost finished and will be released during the day, you will be able to view Ecowatt alerts on your dashboard, and this without any configuration (I’ll come back to that later).

In scenes, a new condition appears « Condition on Ecowatt », which allows you to stop/continue a scene only if the power grid is in one of the 3 possible states: « Grid OK » / « Grid Stressed » / « Grid Very Stressed ».

I recommend running a scene every hour:

Set a condition on « Grid Stressed » or « Grid Very Stressed »:

Turn off high-consumption devices in case of a stressed grid:

And send you an alert if the scene is triggered:

You can create an additional scene where you turn your devices back on when the grid returns to the « OK » state.

Why without any configuration?

There is an Ecowatt API offered by RTE, but this API is accessible by creating a developer account and obtaining a client_id and client_secret.

For me, given the urgency, that was too high a barrier to entry, so I wanted to offer a 100% zero-configuration integration.

So I implemented this API on the Gladys Gateway side, and I offer an API for all Gladys users, at no cost.

When will this be ready?

I’ve been working on it since this morning, and it’s normally ready; only deployment remains.

The PR is here:

I’ll merge it fairly quickly and trigger a build very soon.

When I deploy an update of Gladys, it will deploy Gladys based on Node.js 18. There should be no regressions, but you never know.

I count on you to give me feedback as soon as everything is live :folded_hands:

Communication

As soon as it’s live, I’ll start communications on social networks to spread the word about this initiative. I think it’s a good way to showcase home automation and Gladys for these kinds of situations! I count on you to reshare these posts :slight_smile:

12 Likes

Hello
Power outages will not occur before Christmas except maybe a trial run…
So there’s no need to panic before anything happens, and it’s probably not worth putting more pressure on yourself than necessary
Source: Prefecture meeting this week

Otherwise, well done on the initiative and this project

1 Like

Thanks for the feedback, that’s great! :slight_smile:

At least the integration is ready and if there are any small bugs we’ll be able to spot them before there’s really a tense situation in January/February

Wow, very impressive that you took on this challenge and especially that you managed to finish on time!

It’s going to be useful to quite a few people, I think, and that’s clearly the whole point of home automation :blush:

1 Like

Great initiative! I told myself the same thing — I created an account yesterday and thought it was such a shame not to have it easily in gladys. So can I call you Santa Claus?

1 Like

It’s me :santa_claus::wrapped_gift::christmas_tree:

Nice initiative PG, uh, sorry, PN !!

1 Like

I didn’t know about it, hoping it stays green.
Thanks for the integration.
Is there any region management, or not at all?

I can ditch my n8n integration and MQTT virtual devices and I’m very happy about it :smile:

Great initiative that could give Gladys some publicity. Can’t wait to try it :bulb:

Not in the RTE API, it’s nationwide, and that’s normal: Ec

1 Like

Gladys Assistant v4.13 is available with Ecowatt integration !!

Article to read here:

I posted on LinkedIn, this kind of topic can give visibility to the project, any like/share is welcome :smiley:

Changelog on GitHub:

3 Likes

Thank you @pierre-gilles, the issue of registration is a barrier I wouldn’t have overcome, because I believe that such a service provided by RTE should not be subject to any constraints.

1 Like

hello @pierre-gilles ,
version 4.13 has just been installed on my Gladys a moment ago!
it seems to be working well, Ecowatt started.
Ecowatt menu integrated into my dashboard without any problem!
now just have to wait for my request for max on the graphs to be taken into account :wink:

1 Like

I love this kind of initiative, thanks Pierre-Gilles!!

Integrated without any problem into my Electricity Consumption Dashboard:

3 Likes

Nice dashboard!!

2 Likes

I like it too ^^

I know that in the long run, depending on online promotions, I’d like to add more smart plugs / smart circuit breakers that report the power consumption. To actually see what it looks like for:
Washing machine / Dryer / Dishwasher / Water heater / Air conditioning

Hello,
In the same style, it would be interesting to have a box with the days of the EDF « Tempo » contract using RTE’s API: Catalogue API - API Data RTE

2 Likes

Are you on a Tempo contract? Why not — although it would probably overlap quite a bit

I have already put my washing machine on an outlet with energy consumption monitoring.
I’m waiting for them for my air conditioners.

1 Like

I just released Gladys Assistant v4.13.1 — I just added a small error message in case the RTE API (API RTE) returns an error :smile: (Small oversight — that’s what happens when you code in one day!)

For information, there are 2 levels of cache so as not to hit the rate limits on the RTE API (API RTE):

  • 1st level local cache, 30 minutes of cache (this allows the dashboard display to remain smooth if you quickly change tabs in Gladys)
  • 2nd level cache, 1 hour of cache on the Gladys Gateway side, to avoid bombarding the RTE API. I cache in Redis so it’s blazing fast :zap:

Note that these caches do not affect the display or your scenes, because the API returns 4 days of forecasts at once, and is refreshed only once or twice a day, if I recall.

If the RTE API (API RTE) ever starts returning errors, and both caches have expired, you will see a message like this (hopefully not):

4 Likes