External integration - Ecojoko

Description

Hello,

I just acquired Gladys Assistant, I am gradually integrating my various connected objects before launching into scenes.

I have a small Ecojoko screen that informs the whole family about the electrical consumption or solar production of our house.

I would like to integrate it into Gladys via an API (it exists on HA). I’m terrible at computers…

Could someone create this integration?

Hi Pat,

Good news: I’ve started developing an ecojoko integration for Gladys, as an external integration (those that install from the store in one click). The code is here: GitHub - guim31/gladys-ecojoko · GitHub
You’ll find it on the store in the next hour.

As you noted, ecojoko does not publish an official API. The integration relies on the same interface as the web application service.ecojoko.com, just like the Home Assistant community integration (little_monkey). You just need to enter your ecojoko account email and password. Nothing is written to the account, everything is read-only.

What it brings to Gladys:

  • the instantaneous power (W), refreshed every 30 seconds by default;
  • the day’s consumption (kWh), and a value per tariff period if your tariff declares it (HC/HP, Tempo colors);
  • the solar surplus injected for the day, if ecojoko measures it at your place (you mentioned production, so this should interest you);
  • the indoor/outdoor temperature and humidity of the display, in a second device;
  • a cumulative index in kWh, made from the daily totals, so that Gladys’s energy dashboard (consumption per half-hour, contract cost) works with ecojoko.

There’s a catch: I’m not equipped with ecojoko, so I’ve never been able to run it on a real account. The response format is taken from the Home Assistant integration, and everything else is tested in white. If you’re willing to be a tester, that would help me a lot!

To test: in Gladys, Integrations → search for « ecojoko » → Install, then enter your credentials and click on « Test the connection ». The message under the button indicates what the integration has found (gateway, current power, tariff periods, surplus, ambient sensor). Then, the Devices tab to add the ecojoko device (and ecojoko (ambiance) if it appears).

What I’m interested in, here or in a GitHub issue:

  • the message from the « Test the connection » button, or the error displayed;
  • the displayed values compared to the ecojoko application (power, kWh of the day);
  • if something is missing or seems wrong, the integration logs (Logs button on its configuration page).

Thanks in advance, and don’t hesitate if you have any questions!!

Hi guim31,

That’s awesome.

I’ll test it following your process this evening.

Stay tuned

guim31,

Sorry, but I can’t find ecojoko in integration!

So I can’t test it.

Best,

Pat

Integration has been available since 17:04

Yes, it took longer than expected to be added to the store, I don’t know why :person_shrugging:

Yes, it’s done, I’ve integrated and tested.

Below is a copy of the message.

However, the button is missing in the devices.

To follow :wink:

Can you tell me more about the « missing button »? Which button are we talking about?
As I told you, I don’t have this equipment, so for me it’s abstract ^^

Don’t hesitate to send me (copy/paste) the integration logs :+1: they are visible on the integration view.

Pardon, I misspoke.

I can’t find ecojoko in the Gladys device tab, so I can’t go any further.

Hello
That’s really great because I had looked a while ago and nothing was possible.

I took the opportunity to change the topic title.

I’m sorry @Pat, I’m having trouble understanding what you’re saying.

If all else fails, take a screenshot of the screen where you want to see a device but it’s not there.

Because when you say « the device tab of Gladys » I don’t know if you’re talking about the device section when adding a widget to a dashboard, or the Device tab of the external integration itself.

Send me some nice images and I’ll do my best to answer you!! :grinning_face: :+1:

Hihi, we’ll get through this.

I’m talking about the device section when you add a widget to a dashboard:

Hi @Pat, I think you missed a step.

Have you correctly configured the integration and added your device in Gladys from the integration? If you haven’t, then the device won’t be visible in the page you showed us!

Oh yes, that’s it… :sweat_smile:

Here’s what it looks like.

A power gauge could be interesting.

I’ll check tomorrow what it says when I generate electricity.

Good evening everyone and thanks for all this info

Cool, I’ll look forward to reading from you tomorrow :wink:

Hello,

Here is the display when I am in overproduction.

The figures are correct.

What is the refresh rate of the « power » widget? Is it possible to see the power information in the form of a gauge (green in overproduction, red in consumption)?

Have a nice day

Hi @Pat

Thanks a lot for this feedback, it’s invaluable: it’s the very first time that the integration runs on a real ecojoko account. Knowing that the numbers match your application validates the entire reverse engineering part, including production and the off-peak/peak hour splitting.

Your screenshot actually highlighted a real flaw, which your question about the gauge made blocking. I’ll answer in order.

The refresh. Two speeds, both adjustable in the integration configuration:

  • the instantaneous power, every 30 seconds by default, adjustable from 5 to 300 seconds;
  • the day’s consumption, the index and the ambient sensors, every 5 minutes, adjustable from 1 to 60 minutes.

The dashboard thumbnail, however, does not poll: it updates instantly as soon as a value arrives. What you see is therefore the rhythm chosen above. No need to go too low, each reading is a request to the ecojoko cloud and the display itself is not faster.

The gauge. Yes, it’s possible, and without waiting for anything from me: Gladys has a native Gauge box.
But in your situation it wouldn’t have worked, and it’s my fault. I declared the power as a consumption, therefore bounded to zero, while your sensor returns a negative value in surplus. The gauge positions its needle based on these limits: your overproduction would have been out of scale.

It’s fixed. Power becomes a network exchange, signed: positive when drawing, negative when injecting, on a scale from −12,000 to +12,000 W. Zero therefore falls right in the middle of the gauge. Once the new version is installed:

  1. on the integration page, once updated, Discovered Devices tab, the device will offer an Update button. A click applies the new definition, your history is preserved;
  2. on your dashboard, add a Gauge widget, choose the Instantaneous Power feature and activate custom colors;
  3. low threshold at 0 with the low color in green: any negative value, therefore any overproduction, turns green. High threshold at the power you consider high, 3,000 W for example, high color in red. The intermediate color applies between the two, set it to orange to clearly distinguish the three areas.

The « 30-minute Cost » without a recent value. This is normal and it’s not the integration that calculates it: Gladys derives it itself from the consumption index. It needs two things, an electricity contract entered in the energy settings, and at least thirty minutes of index returned for a first difference to exist. If after that the thumbnail remains empty, let me know.

A lead, if you’re interested. As you are a producer: today I return your daily production, but not a cumulative production index. Yet this is the only format from which Gladys feeds its 30-minute production tracking. I can add it, it’s the same mechanism as for consumption. Let me know if you want it, you are the best placed to test it.

Have a good day, and thanks again.

Hi guim31,

So, update done, gauge installed. Maybe I’m doing something wrong.

The gauge is red when I consume and green when I send to the grid (overproduction).

Is there a gauge where zero is in the middle at the top, consumption in red to the right after zero, and overproduction to the left in green? That would be awesome.

This is already good, but I’m still asking the question, right? :blush:

:heart:

  • I’m definitely interested in daily production (well, I imagine from Ecojoko, what I’ve sent to the grid)!

Hi Pat,

No, you’re not doing anything wrong, you’ve hit a limit of Gladys.

For the gauge, what you describe is not possible today. I went to read the component: it fills an arc from its beginning, with a single value brought back as a percentage between the minimum and maximum of the feature. The thresholds you set only change the colors, never the position of the needle. There is no mode « zero in the center, injection on the left, consumption on the right ».

Your idea is interesting and it goes beyond ecojoko: anyone with solar would want this gauge. The best would be for you to open a feature request on the forum for the Gauge box, with your screenshot. A divergent gauge, centered on zero, speaks immediately. If you post it, I’ll support it :wink: .

In the meantime, two workarounds that look good:

  • keep your gauge as it is and just add next to it a graph of the power over a few hours. The curve visually goes below zero when you inject, and that’s where you read the alternation best;
  • if you want a clear reference in a glance, a gauge with a very low high threshold, like 100 W, gives you a red light as soon as you go back to drawing.

For production, it’s done, you have it in version 1.0.2. And yes, you guessed right: it’s what ecojoko counts as sent to the grid, so your surplus, not the total production of your panels. Ecojoko only measures what passes through the meter.

You get two sensors:

  • Daily solar surplus injected, reset each night, the one you already had;
  • Index of injected production, new, a cumulative counter that never goes down. It starts at zero the day you add it and then climbs, exactly like the consumption index.

Same gesture as last time to get it: update the integration, then Discovered Devices tab, Update button on the ecojoko device. The new sensor appears, your history is preserved.

A precision to avoid disappointment: this index will not immediately light up a half-hour production tracking in the energy dashboard. Gladys can do it for consumption, but not yet automatically for production, and it’s in the core, not in the integration. The index, however, is already usable: you can put it in a graph, see your cumulative, use it in scenes. And the day the core completes the production part, it will plug in all by itself.

Thanks again!!

Wow, thanks for your quick response!

I’ll look into all of this and propose a feature request.

I won’t be able to take care of this by the weekend—I’m traveling for two days and won’t have much time.

I’ll repost as soon as possible.

Have a great day.

Pat