# External integration: Stock pellets

**URL:** <https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907>\
**Category:** Développement\
**Tags:** integration-externe\
**Created:** [September 25, 2026, 10:21pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907 "2026-09-25T22:21:59Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [September 25, 2026, 10:21pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/1 "2026-09-25T22:21:59Z")

</div>

I heat with a pellet stove, and I was tired of going to the garage to count the bags to know if I needed to reorder. So I developed an external integration for Gladys: Pellet Stock.

It tracks your pellet stock: deliveries, consumption, average daily consumption, remaining autonomy, and if you indicate the price of a pallet, the stock value and the monthly cost. There is no hardware to install or online account to create. The integration simply keeps a record of bag movements and calculates the rest from there.

Everything happens in a widget on the dashboard. You can see your stock (green, then orange below the low stock threshold, red at zero), your autonomy in days, the date to reorder, and a graph of the stock evolution or bags used per day. On a daily basis, you just need to press «&nbsp;−1 bag&nbsp;» each time you refill the stove and «&nbsp;Pallet delivered&nbsp;» each time a delivery is made.

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/f/0/f04369f119a64357811cc47fd7d5a03be2fea943.jpeg)

The integration is also used in scenes. For example, a Zigbee button placed next to the stove can remove a bag with each press, and Gladys can send you a message when the stock is low. If you have a second home, you can track multiple stocks separately.

Scene Actions

- Use pellet bags: removes bags from stock. For example, a Zigbee button next to the stove removes a bag with each press.
- Add pellet bags: adds bags, for a delivery or bags purchased individually.
- Correct pellet stock: replaces the stock with the number of bags you have counted.
- Read pellet stock: does not modify anything and passes the figures to the rest of the scene, for example for a weekly message.

Each action passes the remaining bags, autonomy, bags per day, days before ordering, and remaining weight to the next actions.

Triggers

- Low pellet stock: the stock reaches the low stock threshold. It triggers once, at the moment the stock passes the threshold, and not with each bag below.
- Pellet stock exhausted: the last bag has been used.
- Pellet pallet delivered: a delivery of multiple bags has been recorded.

Don’t hesitate if you have feedback or ideas!

---

<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:** [September 27, 2026, 8:05pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/2 "2026-09-27T20:05:10Z")

</div>

Super @Will_71, that’s exactly what I was looking for 🤩  
And I even installed it before you mentioned it, seeing it in the new features 😉  
Question about the cost: if you set a price, does it apply to your stock?  
If you add another pallet with a different price, how is it managed: does the price apply only to this new addition or to the entire stock? (connect + new)

What I want to know is, once a pallet at price A is finished, does it automatically switch to the second pallet with its price B?  
🤨 Not sure if I’m very clear, let me know if you need me to rephrase.

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [September 27, 2026, 8:30pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/3 "2026-09-27T20:30:02Z")

</div>

Yes, I had a makeshift thing on my side, so when the widgets appeared, it was time to switch and do the integration.

For the cost, for now, if you change the price, it applies to the entire stock. It wasn’t my priority for now, so I haven’t developed it much, but it’s a point to improve. I also wanted to be able to set a price per bag, but I’m stuck with the decimals in the form.

Now, I’m finishing the PR on the thermostat and I’ll make changes to improve cost management.

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [October 3, 2026, 11:43am UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/4 "2026-10-03T11:43:22Z")

</div>

@mutmut, I’ve been thinking about updating the pallet price and so far I haven’t found a solution that I like. If you have any ideas.

Calculating the price is no problem, but it’s about displaying the pallet price. For the price per bag, we need to modify the forms because I can’t enter decimals.

What bothers me right now is that I can’t put a form in the widget to indicate the new price and go into the settings to change the price before clicking the button provided on the widget. I find that rather annoying.

If you have any ideas, I’m all ears.

---

<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:** [October 4, 2026, 4:26pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/5 "2026-10-04T16:26:06Z")

</div>

I’ll think about it this week, didn’t have time this weekend.

---

<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:** [October 6, 2026, 3:29pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/6 "2026-10-06T15:29:22Z")

</div>

Hi @Will_71,

I saw that you made progress on the [«&nbsp;form&nbsp;» button](https://community.gladysassistant.com/t/amelioration-integration-externes/10952/9?u=mutmut) that PG set up on the dev, I really like it and that’s a bit what I had in mind.

I saw the remaining stock and weight values, that’s good.  
We could also have the number of remaining bags.  
However, we would need an additional variable which is the weight of a bag during a delivery:

- number of bags (or loose per truck for those who have wood boilers with continuous feeding)
- weight of a bag (15kg, 8kg, other…) or of the delivery (loose with 3 tonnes for example)
- delivery cost  
 → This would allow us to have the cost per kg or per bag

After that, could we do a cost analysis over a period?  
My need: from 1/10/26 to 1/06/27, I want to know the cost of my heating knowing that I used 40 bags at a cost X bought in 2025 and that I added 60 bags at a rate Y.  
Do you think it’s possible?  
In my mind it’s assigning a cost to each bag but the solution might be much simpler (Claude, Claude, are you there? 😂 ).

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [October 6, 2026, 4:23pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/7 "2026-10-06T16:23:23Z")

</div>

Yes, your remarks are relevant. For the weight of the bag, it’s planned, but since there was a bug with the decimals, that’s why I had put the weight of the pallet for now. But I will add it, it’s mandatory.

For the price management, for now, I don’t yet know exactly how I will handle this.

I will ask Claude how to best manage this. I will keep you informed.

---

<div class="post-metadata">

**Author:** ![Steph38230](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@Steph38230](https://community.gladysassistant.com/u/Steph38230)\
**Post date:** [October 6, 2026, 7:12pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/8 "2026-10-06T19:12:45Z")

</div>

Thanks Will for this integration, it’s exactly what I wanted to cobble together in Excel 😉

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [October 12, 2026, 10:53pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/9 "2026-10-12T22:53:10Z")

</div>

Version **1.3.0** of the Pellet Stock integration is available. It incorporates many of your feedback, including that of @mutmut on prices and bag weights.

**What’s New**

- **Delivery with its price** : “Delivered Pallet” opens a form with the number of bags, the price paid, and the weight of a bag. “Add bag(s)” asks for the price per bag.
- **First In, First Out Cost** : Each bag used costs the price at which it was purchased. The widget displays the season’s cost, and the “Analyze Cost” action provides the bags, kg, and cost over a period (e.g., from 01/10/2026 to 01/06/2027).
- **One Stock per House** : “Add a Stock” offers Gladys houses, and “Set a Stock” gives a stock its own settings (e.g., 10 kg bags at the chalet).
- **Bulk Pellet Silo** , counted in kg, with its widget (delivery, level reading in kg or %) and its device.
- **German and Spanish** , in addition to French and English, and a “Device Name Language” setting for the names suggested in the Discovery tab.
- Both widgets refresh as soon as a stock or device is added.

**Required Actions**

- **Gladys 5.2.0 minimum** (instead of 5.1.0): the widget button forms and the list of houses require it. On Gladys 5.1, the integration remains at 1.2.0 and the update will not be offered.
- No devices to recreate: existing devices, history, scenes, and widgets remain as they are.
- If you had added a stock with a name, you can attach it to a house with “Attach a Stock to a House”. It keeps its device and history.
- The device names suggested in Discovery remain in English until you choose another language in the configuration.

The new version will appear in the store later today, pending indexing.

> **For feedback or a bug**
>
> An issue on GitHub ([Issues · William-De71/gladys-pellet-stock · GitHub](https://github.com/William-De71/gladys-pellet-stock/issues)) or a reply here, with:
> 
> - the version of Gladys and that of the integration;
> - the logs of the integration container, ideally with the environment variable `DEBUG=gladys-integration-sdk`.

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [October 12, 2026, 10:53pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/10 "2026-10-12T22:53:45Z")

</div>

Version **1.4.0** of the Pellet Stock integration is available.

**What’s New**

- **New « Pellet Price » widget** , for a bag stock or a silo (in € per ton):
  - the last price paid and its evolution over a year (orange if it rises, green if it falls);
  - the price curve per bag from one delivery to the next, over 1, 3, or 5 years;
  - one line per heating season, up to five seasons, to compare year over year: the cost of the bags used (first in, first out), their number, and the average price per bag. The season starts in October by default, which is adjustable in the widget.

- **Device names in your language** : Gladys only provides the user’s language to an integration when they display a widget. By default, the names suggested in the Discovery tab therefore follow the language of the last user who displayed a widget from the integration. The « Device Name Language » setting still allows you to enforce a language.
- The documentation now shows widgets in the four languages (illustrations generated from the integration’s code).

**Required Actions**

- None: nothing to recreate, existing devices, history, scenes, and widgets remain as they are.
- The « Pellet Price » widget is added like the others (edit the dashboard → add a box). It only shows numbers once at least one delivery has been entered with its price.
- If you had saved the configuration in 1.3.0, the language setting remained on « English »: choose « User Language » to take advantage of it.

Gladys 5.2.0 minimum, as for 1.3.0. The new version will appear in the store later today, pending indexing.

> **For feedback or a bug**
>
> An issue on GitHub ([Issues · William-De71/gladys-pellet-stock · GitHub](https://github.com/William-De71/gladys-pellet-stock/issues)) or a reply here, with:
> 
> - the version of Gladys and that of the integration;
> - the logs of the integration container, ideally with the environment variable `DEBUG=gladys-integration-sdk`.

---

<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:** [November 2, 2026, 9:33pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/11 "2026-11-02T21:33:27Z")

</div>

Hi @Will_71, winter season has started and I’ve also begun with your integration ☺🥶

I don’t know if it’s a rounding issue, but the season cost of 11€ doesn’t match 2x5.45€ which makes 10.90€

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/a/1/a1e0e4a74f0d26235ffd47d7125d6a15db610f9d.png)

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [November 2, 2026, 10:03pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/12 "2026-11-02T22:03:02Z")

</div>

I think it’s a rounding issue. I’ll look into it as soon as possible.

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [November 2, 2026, 10:23pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/13 "2026-11-02T22:23:19Z")

</div>

Well spotted, thanks! The calculation was correct, it was the display that rounded to the euro.

In the next version, amounts will be displayed to the cent (€10.90). The same goes for the total stock value

I took the opportunity to shorten the « Stock Value » line, which was cut off: it now only displays the value and the price per bag.

---

<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:** [November 3, 2026, 7:51pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/14 "2026-11-03T19:51:49Z")

</div>

Thanks @Will_71 👌

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/4/5/45598c81fc875c5be0c0a234a6183a2a5824cc58.png)

Just a note on the term „bag“: for me, a bag is only 15kg, maybe others do a mix of 8 and 15.  
Let’s see if there are requests to add additional information.  
In any case, I’m fine with it like this 🙂

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [November 3, 2026, 8:23pm UTC](https://community.gladysassistant.com/t/integration-externe-stock-pellets/10907/15 "2026-11-03T20:23:18Z")

</div>

> [@mutmut](#):
>
> a mix of 8 and 15

Yeah, that’s not a bad idea but it’s a pain to manage. I’ll note it down.
