# Energy monitoring: Adding a new contract

**URL:** <https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924>\
**Category:** Développement\
**Created:** [January 18, 2026, 5:41pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924 "2026-01-18T17:41:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jparbel](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jparbel](https://community.gladysassistant.com/u/jparbel)\
**Post date:** [January 18, 2026, 5:41pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/1 "2026-01-18T17:41:36Z")

</div>

Since December I subscribed to a new Peak Hours / Off-Peak Hours contract with Octopus.

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [January 18, 2026, 7:00pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/2 "2026-01-18T19:00:09Z")

</div>

hi @jparbel  
I can already tell you that it’s not that simple since I’ve already done this for Electricité de Strasbourg.  
In fact you need to recreate a new octopus directory.  
Then you copy the peak-off-peak folder from EDF (for example) and there you can rename:  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/9/19fde5b54ff6ab2213f59f132ebf2b456f793536.png)  
Then you modify the CSV file with the information you have (well that’s what I did; @prohand did it differently for Alpiq).  
After that you need to run the scripts process.js and process.test.js:  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/8/c/8c448f6d94d20d4cc56d5bc27c5ff0051e563f27.png)

---

<div class="post-metadata">

**Author:** ![jparbel](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jparbel](https://community.gladysassistant.com/u/jparbel)\
**Post date:** [January 18, 2026, 7:40pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/3 "2026-01-18T19:40:44Z")

</div>

Thanks @mutmut but my question is about being able to identify a special contract (fixed prices) compared to Octopus’s “normal” contract.

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [January 18, 2026, 7:42pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/4 "2026-01-18T19:42:53Z")

</div>

Indeed, I’ll let @pierre-gilles respond to you because I have no idea.  
In any case, you must not rename anything inside contract.json

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 19, 2026, 8:01am UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/5 "2026-01-19T08:01:50Z")

</div>

> [@jparbel](#):
>
> Can I replace in contract.json «&nbsp;peak-off-peak&nbsp;» with «&nbsp;Energie-moins-chere-ensemble-2025&nbsp;» to account for this specificity?

No, you must not modify the «&nbsp;contract&nbsp;» field which must be exactly «&nbsp;base&nbsp;» or «&nbsp;peak-off-peak&nbsp;» or «&nbsp;edf-tempo&nbsp;».

The contract name is the folder name!

---

<div class="post-metadata">

**Author:** ![jparbel](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jparbel](https://community.gladysassistant.com/u/jparbel)\
**Post date:** [January 19, 2026, 9:25am UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/6 "2026-01-19T09:25:22Z")

</div>

Thanks @pierre-gilles I have noted

---

<div class="post-metadata">

**Author:** ![jparbel](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jparbel](https://community.gladysassistant.com/u/jparbel)\
**Post date:** [January 19, 2026, 6:19pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/7 "2026-01-19T18:19:57Z")

</div>

@pierre-gilles I’ve made a PR “ mise-a-jour-tarifs-octopus” I don’t know if it’s okay, it’s my first!

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 20, 2026, 7:42am UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/8 "2026-01-20T07:42:04Z")

</div>

I think you probably didn’t create the PR, there’s nothing in the repo:

[https://github.com/GladysAssistant/energy-contracts/pulls](https://github.com/GladysAssistant/energy-contracts/pulls)

---

<div class="post-metadata">

**Author:** ![jparbel](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jparbel](https://community.gladysassistant.com/u/jparbel)\
**Post date:** [January 20, 2026, 2:04pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/9 "2026-01-20T14:04:34Z")

</div>

> [@pierre-gilles](#):
>
> [Pull requests · GladysAssistant/energy-contracts · GitHub](https://github.com/GladysAssistant/energy-contracts/pulls)

@pierre-gilles I just recreated the PR, I don’t understand why the first one disappeared, everything seemed to be going well though — can you check again? Thanks

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 21, 2026, 7:48am UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/10 "2026-01-21T07:48:24Z")

</div>

It’s good this time!

Heads up, there’s a spelling mistake in the folder name — you wrote «&nbsp;noins-cher&nbsp;» instead of «&nbsp;moins-cher&nbsp;» 🙂

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 23, 2026, 1:33pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/11 "2026-01-23T13:33:25Z")

</div>

@jparbel with your latest changes, the tests are failing ( [Mise a jour tarifs octopus · GladysAssistant/energy-contracts@e43b9dd · GitHub](https://github.com/GladysAssistant/energy-contracts/actions/runs/21242522179/job/61273550621?pr=8) )

The message:

```auto
❌ TEST FAILED:
octopus-eco-conso-fixe-peak-off-peak[6]: Missing subscription price for date range 2024-06-01|2025-01-14

```

Data is missing!

---

<div class="post-metadata">

**Author:** ![jparbel](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jparbel](https://community.gladysassistant.com/u/jparbel)\
**Post date:** [January 23, 2026, 5:03pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/12 "2026-01-23T17:03:30Z")

</div>

@pierre-gilles

Sorry, I think it should be fine now. My tests were fine before the push, but it pushed the wrong file — probably a beginner mistake.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 24, 2026, 7:32am UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/13 "2026-01-24T07:32:22Z")

</div>

Thanks for the push!

I don’t know if it’s a good idea to have folder names with a percentage («&nbsp;octopus-eco-conso-fixe-12%&nbsp;»), could we have a name that’s alphanumeric-only with «&nbsp;-&nbsp;» and without special characters?

---

<div class="post-metadata">

**Author:** ![jparbel](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jparbel](https://community.gladysassistant.com/u/jparbel)\
**Post date:** [January 24, 2026, 8:20am UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/14 "2026-01-24T08:20:29Z")

</div>

> [@pierre-gilles](#):
>
> I don’t know if it’s a good idea to have folder names with a percentage (« octopus-eco-conso-fixe-12% »), could we have a name that’s alphanumeric-only with « - » and without special characters?

Modification completed.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 24, 2026, 1:20pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/15 "2026-01-24T13:20:50Z")

</div>

Actually I feel like you’ve mixed up the contract name and the supplier name!

You should have a folder «&nbsp;supplier&nbsp;».

In your case:

- «&nbsp;octopus&nbsp;»
- «&nbsp;mint&nbsp;»

And inside that folder, you create a folder per contract:

- «&nbsp;online-et-green-peak-off-peak&nbsp;» for example

---

<div class="post-metadata">

**Author:** ![jparbel](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jparbel](https://community.gladysassistant.com/u/jparbel)\
**Post date:** [January 24, 2026, 5:39pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/17 "2026-01-24T17:39:41Z")

</div>

Ah OK, so you want, for example, the following hierarchy :  
[octopus]

. [eco-conso-fixe]

. [base]  
. contract.json  
. ………  
. [peek-off-peek]  
. contract.json  
. …….…

. [energie-moins-chere-ensemble-2025]  
etc…

Is that right?

I can’t get my post to indent correctly

---

<div class="post-metadata">

**Author:** ![jparbel](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jparbel](https://community.gladysassistant.com/u/jparbel)\
**Post date:** [January 24, 2026, 9:17pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/18 "2026-01-24T21:17:29Z")

</div>

@pierre-gilles I just recreated a PR, does this structure work for you?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 25, 2026, 1:13pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/19 "2026-01-25T13:13:51Z")

</div>

Thanks!

No, that’s not it 😃

Look at the structure of the other folders, there are only 2 levels, not 3 levels.

Use the «&nbsp;electricite-de-strasbourg&nbsp;» folder as inspiration; it’s close to what you want to do.

**Level 1, the suppliers:**

![Screenshot 2026-01-25 at 14.12.56](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/0/5/05058f74d40e03917aea139fab636c7211870c72.png)

**Level 2, the contracts:**

![Screenshot 2026-01-25 at 14.13.03|638x298](upload://hfV3Q4R4IvDOiTkEI0Z

---

<div class="post-metadata">

**Author:** ![jparbel](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jparbel](https://community.gladysassistant.com/u/jparbel)\
**Post date:** [January 25, 2026, 7:09pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/20 "2026-01-25T19:09:29Z")

</div>

@pierre-gilles New PR tonight 😀 I think this should work for you now, sorry for the back-and-forth!

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 26, 2026, 7:27pm UTC](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924/21 "2026-01-26T19:27:00Z")

</div>

Thanks for your feedback, it’s better but there’s one last small detail to change!

If we want the contract type (base, peak-off-peak, tempo) to be translated in the interface, the contract name in the folder name must end with «&nbsp;base&nbsp;» or «&nbsp;peak-off-peak&nbsp;» or «&nbsp;tempo&nbsp;»

In your case, you did it the other way around 🙂

[Next page](https://community.gladysassistant.com/t/suivi-energie-ajout-dun-nouveau-contrat/9924.md?page=2)
