Goal

Get Home Assistant sensors from Congatudo to measure time and area last cleaning.

Requirements

Steps

In configuration.yaml add the code below to get sensors build from the Congatudo api every 5 seconds

    rest:
        - scan_interval: 5
            resource: "http://<congatudo_or_ha_ip>:<congatudo_port>/api/v2/robot/state/attributes"
            sensor:
            - name: "Vacuum last clean area"
                value_template: ""
                state_class: "measurement"
                json_attributes_path: "$[4]"
                json_attributes:
                - __class
                - metadata
                - type
                - value
            - name: "Vacuum last clean duration"
                value_template: ""
                device_class: "timestamp"
                state_class: "total"
                json_attributes_path: "$[3]"
                json_attributes:
                - __class
                - metadata
                - type
                - value

Now, you have sensors for both time and area measures but just in default units, so in order to get them in human readable units, you are able to build virtual templated sensors.

    sensor:
        - platform: template
          sensors:
          vacuum_last_clean_duration_time:
            friendly_name: "Vacuum last clean duration time"
            value_template: >-
                
                {% set uptime = states.sensor.vacuum_last_clean_duration.state | int %}
                {% set days = (uptime / 86400) | int %}
                {%- if days > 0 -%}
                    {{ days }} days, {{ (uptime - (days * 86400)) | int | timestamp_custom('%H:%M:%S', false) }}
                {%- else -%}
                    {{ uptime | int | timestamp_custom('%H:%M:%S', false) }}
                {%- endif -%}
                
          vacuum_last_clean_area_m2:
            friendly_name: "Vacuum last clean area m2"
            value_template: ""

Restarting Home Assistant you’ll find those sensors (sensor.vacuum_last_clean_duration_time and sensor.vacuum_last_clean_area_m2) available to use as you wish.

Congatudo

Open source cloud replacement for Conga vacuum robots enabling local-only operation

View the Project on GitHub congatudo/Congatudo

General

Getting Started Why Congatudo? Congatudo or Valetudo Supported Robots Buying supported robots Donate to the proyect

Installation

Home Assistant installation Docker installation Standalone installation

Usage

Capabilities Overview

Companion Apps

Valetudo Companion (Android) Valetudo Tray Companion (Windows) Valeronoi Lovelace Valetudo Map Card I can't believe it's not Valetudo node-red-contrib-valetudo Fun & Games

Integrations

MQTT Home Assistant Node-RED openHAB

Misc

Conga, Files to backup Troubleshooting Empower your Conga voice Add SSH Key Hey Google Clean My Room Get area and time in Home Assistant from Congatudo Clean me Time and Tank Virtual Sensors

Development

Building and Modifying Congatudo Congatudo core concepts MQTT