Integrate level sensors into Home Assistant

Integrate level sensors into Home Assistant

Integrating the Sensor with Home Assistant

The Senvolon level sensor is integrated into Home Assistant via MQTT. From firmware version 3.8, the sensor supports MQTT Discovery, so Home Assistant automatically detects and adds the sensor values. In that case, step 3 of these instructions is not needed. Manual configuration remains possible as well. These instructions show all the steps you need to take in Home Assistant to receive and display the sensor's readings. If you are still just getting started, our overview page has everything you need to know about measuring and monitoring your rainwater tank's fill level: from choosing the right sensor to mounting it.

Why Use MQTT for the Level Sensor

  • Reliable communication between the sensor and Home Assistant
  • Automatic detection via MQTT Discovery
  • Fast updates of the readings
  • Flexible expandability with additional sensors

Requirements for the Integration

  • Senvolon level sensor from version 3.8
  • Home Assistant
  • An MQTT broker such as Mosquitto
  • A correctly set MQTT topic in the sensor

1. Installing the MQTT Broker in Home Assistant

If you don't have an MQTT broker yet:

  1. Open Settings → Add-ons
  2. Switch to the Add-on Store
  3. Install the Mosquitto MQTT broker

2. Activating and Configuring MQTT in Home Assistant

  1. Go to Settings → Devices and Services
  2. Add the MQTT integration
  3. Complete the configuration

Note: if Mosquitto was installed as an add-on, the broker automatically uses the Home Assistant IP address. The username and password match your Home Assistant login credentials.

3. Extending configuration.yaml

To have Home Assistant read in all the sensor values correctly, the central configuration file needs to be extended.

Installing the File Editor

  1. Open Settings → Add-ons → Add-on Store
  2. Install the File Editor
  3. Enable it to show in the sidebar
  4. Open the file configuration.yaml

Adding the MQTT Sensors

Replace TOPIC with the MQTT topic you set in the level sensor.


mqtt:
  sensor:
    - name: "Level"
      unique_id: "LS_Level"
      state_topic: "stat/TOPIC/REL_LEVEL"
      unit_of_measurement: "%"
      icon: mdi:car-coolant-level
      device:
        identifiers: "LevelSensor"
        manufacturer: "Senvolon"
        name: "Level Sensor"
        model: "V1"

    - name: "Fluid"
      unique_id: "LS_Fluid"
      state_topic: "stat/TOPIC/FILLING"
      unit_of_measurement: "l"
      icon: mdi:water
      device:
        identifiers: "LevelSensor"
        manufacturer: "Senvolon"
        name: "Level Sensor"
        model: "V1"

    - name: "Distance"
      unique_id: "LS_Distance"
      state_topic: "stat/TOPIC/DISTANCE"
      unit_of_measurement: "cm"
      icon: mdi:waves-arrow-up
      device:
        identifiers: "LevelSensor"
        manufacturer: "Senvolon"
        name: "Level Sensor"
        model: "V1"

    - name: "Height"
      unique_id: "LS_Height"
      state_topic: "stat/TOPIC/LEVEL"
      unit_of_measurement: "cm"
      icon: mdi:waves
      device:
        identifiers: "LevelSensor"
        manufacturer: "Senvolon"
        name: "Level Sensor"
        model: "V1"

    - name: "Alert"
      unique_id: "LS_Alert"
      state_topic: "stat/TOPIC/ALERT"
      icon: mdi:alert-circle-outline
      device:
        identifiers: "LevelSensor"
        manufacturer: "Senvolon"
        name: "Level Sensor"
        model: "V1"

Checking the Syntax and Saving

  • Red exclamation mark = error
  • Green checkmark = syntax correct
  • Then save the file

4. Restarting Home Assistant

Reload it once via Developer Tools → Restart.

5. Viewing the Level Sensor in Home Assistant

After the restart, Home Assistant detects the sensor automatically. The values update as soon as new data arrives from the sensor. Once the readings are coming in, you can build a rainwater tank dashboard with consumption display and rain forecast as your next step.