Guide: Integrate WES server into Home Assistant for consumption monitoring

I've been using Cartelectronic's WES server for several years now. It's a small box that integrates into the electrical panel and is capable of monitoring all of the household's energy consumption, whether it's electricity via teleinfo or clamp meters, water, gas, and much more. It's an extremely comprehensive server, self-sufficient. But since Home Assistant offers a very well-designed energy chart, I wanted to be able to integrate the WES server into this home automation system. This guide will help you do the same. Prerequisites You'll of course need a working WES server connected to the network, as well as a working Home Assistant installation.

First of all, to keep my Home Assistant configuration file from getting overloaded, I split it into several files, something the developers originally provided. Here we will have two files:

sensors.yaml, which will contain the configuration of all WES sensors

customize.yaml, which will allow you to customize these sensors so that they are correctly recognized by the Home Assistant Energy table

  • To do this, simply add these lines to the configuration.yaml file if you don't already have them:
  • sensor: !include sensors.yaml

#Customizing Home Assistant

It groups all the useful information in this format:

We simply need to declare the various desired information in Home Assistant. To do this, in the sensors.yaml file (create it in your homeassistant directory if you don't already have it), we need to declare the connection to the WES server:

– platform: rest

name: wesdata

#Replace with your WES server IP

friendly_name: “Peak Hours Index”

unique_id: westic1hp

friendly_name: “Blue Peak Hours Index”

unique_id: westic1bleuhp

device_class: energy

unique_id: westic2prod

unique_id: westic1tarif

unique_id: wespince1inst

friendly_name: “Water Meter”

unique_id: wesimpulsion1 device_class: waterunit_of_measurement: ‘L'

device_class: temperature unit_of_measurement: ‘°C'value_template: >-

{{ states.sensor.wesdata.attributes| float }}

friendly_name: “Relay 2”

Integrate WES into Home Assistant's Energy Dashboard

Home Assistant's Energy dashboard is really well done. But it only accepts indexes or total consumption meters. One might think this is good for WES, since we've created sensors for indexes. Except that to appear in the list of compatible devices in the Energy dashboard, these sensors must have a “state_class: total” argument. While this argument can be included directly in the MQTT sensor configuration, this isn't the case for the sensors created here for WES, since we're dealing with REST calls, not MQTT calls. Fortunately, we can modify the sensor declaration in a customize.yaml file by adding this type of code for each sensor representing total consumption:

state_class: total

device:

identifiers: “WES Server”

name: “WES Server”

model: “WES”

manufacturer: “Cartelectronic”

I'll leave my complete file here:

Download the customize.yaml file

Simply place it in the homeassistant directory, then restart Home Assistant again (after verifying that the code is correct).

post on the WES manufacturer's forum

a

post on the HACF forum

The Home Assistant documentation also provides a better understanding of how REST sensors work.

Native MQTT compatibility would have made things much easier, but ultimately, we're able to retrieve all the WES data, which can be used perfectly in Home Assistant—that's the main thing. The integration has been working for me for a little over a month now, with no issues to report. I'm able to use my WES, which saves me from having to multiply the sensors, since it handles so many things natively. This guide might help some of you who, like me, were looking for a way to do this!

For your information, this article may contain affiliate links, with no impact on what you earn yourself or the price you may pay for the product. Passing through this link allows you to thank me for the work I do on the blog every day, and to help cover the site's expenses (hosting, shipping costs for contests, etc.). It costs you nothing, but it helps me a lot! So thanks to all those who play along!
What do you think of this article? Leave us your comments!
Please remain courteous: a hello and a thank you cost nothing! We're here to exchange ideas in a constructive way. Trolls will be deleted.

Leave a reply

Maison et Domotique
Logo
Register New Account
Enregistrez vous, et stockez vos articles préférés sur votre compte pour les retrouver n'importe où, n'importe quand !
Compare items
  • Casques Audio (0)
  • Sondes de Piscine Connectées (0)
  • Smartphones (0)
Compare