Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105921

Please help create mqtt vacuum

$
0
0

Hi everybody,

I have a Gardena Sileno City lawnmower which I tried to integrate via the available HACS integration. Unfortunately, this integration seems to be broken atm: it will update the status once, namely when (re)starting Home Assistant - if any values change after this, they will not be represented correctly (nor update) within Home Assistant.

So I installed the gardena2mqtt bridge instead. This will present me with the output below (this exact pattern, I only changed user-specific details) (topic gardena2mqtt/My Garden/Sheena)

{
  "datetime": "2022-03-26 11:33:13",
  "id": "yes",
  "type": "MOWER",
  "battery_level": 100,
  "battery_state": "OK",
  "name": "Sheena",
  "rf_link_level": 100,
  "rf_link_state": "ONLINE",
  "serial": "exactly",
  "model_type": "GARDENA smart Mower",
  "activity": "PARKED_AUTOTIMER",
  "operating_hours": 403,
  "state": "OK",
  "last_error_code": "N/A",
  "mower_id": "tis but a scratch"
}

At this time, I am only trying to receive the states reported by this bridge, not to control the “vacuum” (or, in fact, lawn mower) this way. So I created the entity below

vacuum:
  - platform: mqtt
    name: "Sheena"
    availability_topic: "gardena2mqtt/My Garden/Sheena"
    payload_available: "OK"
    availability_value_template: "{{ value_json.state }}"
    battery_level_topic: "gardena2mqtt/My Garden/Sheena"
    battery_level_template: "{{ value_json.battery_level }}"
    error_topic: "gardena2mqtt/My Garden/Sheena"
    error_value_template: >
      {% if value_json.last_error_code != 'N/A' %}
        {{ value_json.last_error_code }}
      {% else %}
        OK
    cleaning_topic: "gardena2mqtt/My Garden/Sheena"
    cleaning_value_template: "{{ value_json.activity }}"

This will only create this entity (_2 because vacuum.sheena was already created by the HACS integration I mentioned in the beginning)

Can you please tell me what’s wrong with my template, and ideally how I can fix it? I restarted the gardena2mqtt bridge after restarting Home Assistant to make sure that the payloads will have been received by Home Assistant, and checked on them by manually subscribing to that topic via mqtt_sub in the terminal, which displayed everything as expected - however, no change within Home Assistant.

Thank you in advance for your help :slight_smile:

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105921

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>