Add the unit m³/s (cubic meters per second) for watercourse flow rates

Hello,

I am using the external integration Vigicrues (via the Gladys SDK), which retrieves data from the Hub’Eau API. It creates a « Flow (m³/s) » feature for the Montjean-sur-Loire station, but the unit does not display in Gladys.

Technical observation (from /api/v1/device):

  • category: water-valve
  • type: flow
  • unit: null
  • external_id: ext:ext-guim31-gladys-vigicrues:station:M530001010:flow

Cause: the water-valve category currently only accepts cubic-meter-per-hour (m³/h). However, river flows, such as those published by Hub’Eau and Vigicrues, are expressed in m³/s. The integration cannot therefore declare the correct unit.

Request (at the maintainer’s discretion):

  1. Add cubic-meter-per-second (m³/s) to the units of water-valve / type flow, or
  2. Create a dedicated category for rivers (flow, water height), with the units m³/s and m.

Interest: all integrations that follow rivers (floods, hydrometry) could display a correct unit instead of a unitless value.

Thanks in advance!

@guim31: for information, the « Flow (m³/s) » feature of the Vigicrues integration is currently sent with unit: null. Once Gladys accepts m³/s for this category, it may be necessary to declare the unit on the integration side.

Hi @XDECO, thanks for the request, it’s very clear!

Regarding Vigicrues, this is intentional for now: Gladys doesn’t have a m³/s unit, so with the setting Flow rate unit = m³/s, the feature runs without a unit (its name, « Flow rate (m³/s) », gives it away). If you want a unit displayed right now, switch this setting back to m³/h (the default choice): the value is converted (1 m³/s = 3,600 m³/h).

As soon as the core accepts m³/s, I’ll add it to the integration :slight_smile:

PR ouverte sur Gladys
feat(device): add the cubic meter per second (m³/s) flow unit by William-De71 · Pull Request #3297 · GladysAssistant/Gladys · GitHub

et sur le SDK:

As promised @XDECO: Gladys 5.3.2 now accepts m³/s (thanks @Will_71!), and the 1.3.0 version of Vigicrues declares it. With the setting Flow rate unit = m³/s, the flow rate and forecasted flow rates are finally displayed with their unit.

To take advantage of this:

  1. Gladys 5.3.2 minimum, then update Vigicrues from Gladys.
  2. For an already added station, open the Discovery tab of Vigicrues and click Update on the station: the unit appears, without losing the history or the scenes.

Nothing changes if you are in m³/h :slight_smile:

Thanks for this update!

In the discovery tab, I am not offered the option to “update” the station (F468000102).

The unit remains in meters.

Hi @Damien, this is normal for your station: the Seine in Ablon-sur-Seine (F468000102) only publishes water height, not flow rate. I checked on Hub’Eau: no flow rate measurement for this station. The integration therefore does not create a „Flow Rate“ feature, and there is nothing to update.

The meters you see are for water height, that’s the correct unit :wink: m³/s only applies to stations that also measure flow rate.

@guim31 @Will_71 @pierre-gilles

A huge thank you to the whole team for adding this new category: rivers and streams now display the correct unit (m³/s)! :raising_hands:

It works perfectly, see the screenshots below.

Thanks for your responsiveness and your work on Gladys! :waving_hand: