Home Assistant

Home Assistant is an open-source platform for smart home automation. It functions as a central place to integrate and automate various smart devices and services in your home.

One of Home Assistant's strengths is its ability to integrate with a wide range of devices. It uses a modular system, allowing you to easily add and integrate new devices.

The platform also offers powerful automation capabilities. You can set up scenarios where certain actions are automatically performed based on predefined conditions.

Home Assistant is popular for its flexibility, customizability, and active community. It runs on various platforms, including Raspberry Pi, and you have full control over your data as it is hosted locally on your own hardware.

Sending Data to EnergyID

We do our best to add as many integrations to EnergyID as possible, but unfortunately, it is not possible to integrate all services. Some services do not provide the necessary technology (public web API) for us to retrieve the data. In that case, Home Assistant is the perfect solution. Here we describe step by step how to configure your Home Assistant to send data to EnergyID.

Call to all developers

We have built an integration in Home Assistant ourselves to simplify the configuration. A pull request is ready on the Home Assistant Github page. According to the Home Assistant procedure, it must first be reviewed by other developers before it can be included.

Therefore, we make a warm call to all developers to help us get the integration live as soon as possible.


Requirements to get started


Step 1: Determine which integration you want to add to EnergyID.

Choose a sensor you would like to add to EnergyID. Depending on what you track in Home Assistant, the choice is immense (water consumption, energy consumption, PV production, car mileage, etc.). To help you with this, go to Home Assistant to Developer tools > States. Here you can find all the different sensors and choose which ones you want to use.

Ideally, you have a meter reading and timestamp in the Home Assistant integration, but the timestamp is not mandatory. You can also use "now". In this example, we use 2 entities (sensors): the current value and the timestamp of the update. It's best to copy the names of these sensors now. You will need them later.

Step 2: Create a new service (webhook) in Home Assistant.

To send the data to EnergyID, you use Home Assistant's restful integration. This is built-in by default. So you don't need to install anything. Create the rest command (see restful integration documentation) by opening the File Editor from the menu and then selecting the configuration.yaml file.

Add the following code to the configuration.yaml file. Make sure to keep the spaces at the beginning of the line.

    url: https://hooks.energyid.eu/services/WebhookIn/........
    method: POST
    content_type: "application/json"
    payload: '{"remoteId": "xxxxxxxxxx","remoteName": "xxxxxxxxxx","metric": "xxxxxxxxxx","metricKind": "xxxxxxxxxx","unit": "xxxx","interval": "P1D",data": [["{{ states.sensor.TIMESTAMP_SENSOR_NAME.state }}", {{ states.sensor.VALUE_SENSOR_NAME.state }}]]}'

TIP: add some comments so that you remember later what this service does. You can add comments by placing a # at the start of the line.


Here is a description of the parameters in the above code:

  • push_data: the name of the service. Choose something meaningful here so that you can easily remember what this service does later.
  • url: the URL you received when creating the webhook in EnergyID.
  • payload: the data object you send to EnergyID. In the webhook documentation, you will find a more detailed description.
    • remoteId: a unique name of the sensor in your Home Assistant environment.
    • remoteName: the name of the sensor. This will be taken over by the meter added to your EnergyID dossier.
    • metric: the name of the metric. This indicates what is being measured by the sensor. The complete list can be found in the webhook documentation.
    • metricKind: indicates how we should interpret the meter readings. Home Assistant typically works with cumulative counters (total_increasing), so the value will usually be 'cumulative'. The complete list can be found in the webhook documentation.
    • unit: the unit of the meter readings.
    • interval: indicates in which resolution the measurement data is sent. For a standard free dossier, this should be 'P1D' because only daily resolution is allowed. For dossiers with a Premium HR license, you can set the interval to 'PT5M', 'PT15M' or 'PT1H' for 5-minute, quarter-hourly, or hourly resolution respectively. The value you choose here is important for the last step of this guide.
    • data: the actual data. This includes the measurement timestamp and value. Replace 'TIMESTAMP_SENSOR_NAME' and 'VALUE_SENSOR_NAME' with the names of the sensors you copied in the first step. If you don't have a sensor that contains the timestamp of the last update, you can send the current time.

After modifying the configuration.yaml file, you need to restart Home Assistant. You can do this by going to Settings in the top-right menu and then clicking on Restart Home Assistant. Once Home Assistant has restarted, you can check if the new service has been successfully created by going to Developer tools > Services. You can also test the service there to see if everything works as expected. After performing the test, your EnergyID dossier should contain the new meter with the most recent measurement value.

If this is not the case, you can check the log files of Home Assistant (Settings > System > Logs) to see what went wrong. Experiment by adjusting your YAML code as needed. Don't forget to restart Home Assistant after each code change.


Step 3: Automate the service.

Home Assistant offers many options to automate services. Go to Settings > Automations & scenes in Home Assistant and create a new automation.


The trigger indicates when the service should be executed. Choose 'Time' as the trigger type and set it to midnight.

If you have an EnergyID Premium HR license, you can configure the trigger to repeat every 5 minutes, fifteen minutes, or an hour. Make sure the chosen interval here matches the interval you included in the code in step 2.


The action indicates what should happen when the trigger condition is met. Set the action to 'Call service' and select the service you created in the previous step.


Step 4: Validation

The entire setup is now in place. Keep an eye on everything over the next few days to ensure everything works as expected. Occasionally check the logs as described in step 2 if necessary.





Thanks to Steven Uytterhoeven for sharing his Home Assistant integration. If you have built an integration with EnergyID yourself, feel free to share your methodology/code with us. This way, you can help other EnergyID users better monitor their consumption.