Robonect module in Husqavarna Automower via mqtt vacuum

Hi,
Thanks for your work - it helped a lot.
But I am still struggling with my configuration.
A config check gave me - Integration not found: mower_name_command -

Not sure what is wrong cause I did a copy /paste.
Thanks,
Gernot

I think I missed a line when I pasted this code, this is a chunk defining an input_select:

input_select:
  mower_name_command:
    name: mower_name Set State
    options:
     - status_quo
     - start
     - stop
     - auto
     - home
     - man
     - eod
    initial: status_quo
    icon: mdi:robot

Can someone share latest config file of this integration because mine doesn’t work anymore :face_with_monocle:

…maybe because i made a robonect update :thinking:

Is it possible to set a Timer with Automations?
For Example.
set to Auto and 3h later set to Home

Yes. Easiest would be to set it to auto on one timeframe and than 3h later to end of day.

To restart thius discussion: implemented as described above.

What i am missing is two things:

  1. get information from HA in case the mover has an error (currently through Pushover directly from the mover) and reset this to continue (cuirrently only through robonect web interface) and
  2. see the blade status (currently only through webinterface or notification from the mover after the configured time). Ok, can implement same thing into HA maybe…

Anyone already did this?
/ Ralf

Use the Rest API. An example can be found here: https://robonect.net/viewtopic.php?f=29&t=19

The best would be if the rest Api and Mqtt were one to one in an functional aspect but that is not the case right now. Push (mqtt) works so much better then pull (rest sensor)…

@fn87: Thanks for the note: i see a mqtt topic is available for “TOPIC/mower/stopped”. Maybe this is the one i thought of, will try.

But i am still missing information how to retrieve the status of the blade status?

/ Ralf

EDIT: just found it: run http://192.168.178.59/json?cmd=status, then “grep” for the “blades”.
If i have some time free, will try this and post my solution here. Maybe takes some time…

Something like this should work:

- platform: rest
  resource: http://192.168.XX.XX/json?cmd=status
  name: blades
  value_template: "{{ value_json.blades.quality }}"
  username: X
  password: X
  json_attributes_path: '$.blades'
  json_attributes:
    - hours
    - days
1 Like

I am at a loss here about how should i set this up.

I created an automations.yaml -file, copy-pasted the scripts there. Did the same to other files.

I have some experience with simple esp8266 temperature sensors around the house using mqtt to get the values but i cannot grasp the concept how this integration has been set up.

What the end result looks like? What card is added from the overview menu?

Sorry to be a total doofus about this but i did not grasp the concept from this thread yet :slight_smile:

If you have set up your mower correctly the data will added to the senors through MQTT. Have you added the MQTT settings in Robonect?

I can’t seem to get the communication from HA to robonect to work. I get the data from the mower from mqqt, but nothing happens on the robot when I change in the input select list. Any clews?

anybody translated all this configuration to the new model for MQTT already? Is it simply all same but only the sensors "sensor: - platform: mqtt state_topic: " ist to be changed to “mqtt: sensor: - state_topic:” and it should work the same as before?

I would not do this, if you want to change anyway. Just use the publish service and the discovery way) to avoid all the yaml-loads, etc. Put it in a script, run it once (!) and you have all the entities and on top a device (which is not possible with yaml config). Here my config.

alias: MQTT Discovery Huqvarna Automower 330x
sequence:
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_gps_breitengrad/config
      retain: true
      payload: |
        {
          "state_topic": "automower/gps/latitude",
          "name": "Mähroboter GPS Breitengrad",
          "unique_id": "unique_id_mahroboter_gps_breitengrad",
          "object_id": "mahroboter_gps_breitengrad",
          "icon": "mdi:crosshairs-gps",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_gps_langengrad/config
      retain: true
      payload: |
        {
          "state_topic": "automower/gps/longitude",
          "name": "Mähroboter GPS Längengrad",
          "unique_id": "unique_id_mahroboter_gps_langengrad",
          "object_id": "mahroboter_gps_langengrad",
          "icon": "mdi:crosshairs-gps",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_gps_anzahl_satelliten/config
      retain: true
      payload: |
        {
          "state_topic": "automower/gps/satellites",
          "name": "Mähroboter GPS Anzahl Satelliten",
          "unique_id": "unique_id_mahroboter_gps_anzahl_satelliten",
          "object_id": "mahroboter_gps_anzahl_satelliten",
          "icon": "mdi:crosshairs-gps",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_luftfeuchte/config
      retain: true
      payload: |
        {
          "state_topic": "automower/health/climate/humidity",
          "name": "Mähroboter Luftfeuchte",
          "unique_id": "unique_id_mahroboter_luftfeuchte",
          "object_id": "mahroboter_luftfeuchte",
          "device_class": "humidity",
          "state_class": "measurement",
          "unit_of_measurement": "%",
          "icon": "mdi:water-percent",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_temperatur/config
      retain: true
      payload: |
        {
          "state_topic": "automower/health/climate/temperature",
          "name": "Mähroboter Temperatur",
          "unique_id": "unique_id_mahroboter_temperatur",
          "object_id": "mahroboter_temperatur",
          "device_class": "temperature",
          "state_class": "measurement",
          "unit_of_measurement": "°C",
          "icon": "mdi:thermometer",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_batteriespannung/config
      retain: true
      payload: |
        {
          "state_topic": "automower/health/voltage/batt",
          "name": "Mähroboter Batteriespannung",
          "unique_id": "unique_id_mahroboter_batteriespannung",
          "object_id": "mahroboter_batteriespannung",
          "device_class": "voltage",
          "state_class": "measurement",
          "unit_of_measurement": "V",
          "icon": "mdi:sine-wave",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_betriebsspannung_maher/config
      retain: true
      payload: |
        {
          "state_topic": "automower/health/voltage/ext33",
          "name": "Mähroboter Betriebsspannung Mäher",
          "unique_id": "unique_id_mahroboter_betriebsspannung_maher",
          "object_id": "mahroboter_betriebsspannung_maher",
          "device_class": "voltage",
          "state_class": "measurement",
          "unit_of_measurement": "V",
          "icon": "mdi:sine-wave",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_betriebsspannung_robonect/config
      retain: true
      payload: |
        {
          "state_topic": "automower/health/voltage/int33",
          "name": "Mähroboter Betriebsspannung Robonect",
          "unique_id": "unique_id_mahroboter_betriebsspannung_robonect",
          "object_id": "mahroboter_betriebsspannung_robonect",
          "device_class": "voltage",
          "state_class": "measurement",
          "unit_of_measurement": "V",
          "icon": "mdi:sine-wave",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_batterie/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/battery/charge",
          "name": "Mähroboter Batterie",
          "unique_id": "unique_id_mahroboter_batterie",
          "object_id": "mahroboter_batterie",
          "device_class": "battery",
          "state_class": "measurement",
          "unit_of_measurement": "%",
          "icon": "mdi:battery",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_messertage/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/blades/days",
          "name": "Mähroboter Messertage",
          "unique_id": "unique_id_mahroboter_messertage",
          "object_id": "mahroboter_messertage",
          "unit_of_measurement": "Tage",
          "icon": "mdi:terraform",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_messerstunden/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/blades/hours",
          "name": "Mähroboter Messerstunden",
          "unique_id": "unique_id_mahroboter_messerstunden",
          "object_id": "mahroboter_messerstunden",
          "unit_of_measurement": "Stunden",
          "icon": "mdi:terraform",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_messerqualitat/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/blades/quality",
          "name": "Mähroboter Messerqualität",
          "unique_id": "unique_id_mahroboter_messerqualitat",
          "object_id": "mahroboter_messerqualitat",
          "unit_of_measurement": "%",
          "icon": "mdi:terraform",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_fehlercode/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/error/code",
          "name": "Mähroboter Fehlercode",
          "unique_id": "unique_id_mahroboter_fehlercode",
          "object_id": "mahroboter_fehlercode",
          "icon": "mdi:alert-circle",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_fehlernachricht/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/error/message",
          "name": "Mähroboter Fehlernachricht",
          "unique_id": "unique_id_mahroboter_fehlernachricht",
          "object_id": "mahroboter_fehlernachricht",
          "icon": "mdi:alert-circle",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_betriebsstunden/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/statistic/hours",
          "name": "Mähroboter Betriebsstunden",
          "unique_id": "unique_id_mahroboter_betriebsstunden",
          "object_id": "mahroboter_betriebsstunden",
          "unit_of_measurement": "Stunden",
          "icon": "mdi:timer-sand",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_status_raw/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/status",
          "name": "Mähroboter Status Raw",
          "unique_id": "unique_id_mahroboter_status_raw",
          "object_id": "mahroboter_status_raw",
          "icon": "mdi:list-status",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_im_aktuellen_status/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/status/duration",
          "name": "Mähroboter Zeit im aktuellen Status",
          "unique_id": "unique_id_mahroboter_im_aktuellen_status",
          "object_id": "mahroboter_im_aktuellen_status",
          "unit_of_measurement": "Minuten",
          "icon": "mdi:timer",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_status_plain/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/status/plain",
          "name": "Mähroboter Status Plain",
          "unique_id": "unique_id_mahroboter_status_plain",
          "object_id": "mahroboter_status_plain",
          "icon": "mdi:list-status",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_substatus_raw/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/substatus",
          "name": "Mähroboter Substatus Raw",
          "unique_id": "unique_id_mahroboter_substatus_raw",
          "object_id": "mahroboter_substatus_raw",
          "icon": "mdi:list-status",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_substatus_plain/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/substatus/plain",
          "name": "Mähroboter Substatus Plain",
          "unique_id": "unique_id_mahroboter_substatus_plain",
          "object_id": "mahroboter_substatus_plain",
          "icon": "mdi:list-status",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_nachster_start_datum/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/timer/next/date",
          "name": "Mähroboter Nächster Start Datum",
          "unique_id": "unique_id_mahroboter_nachster_start_datum",
          "object_id": "mahroboter_nachster_start_datum",
          "icon": "mdi:calendar",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_nachster_start_uhrzeit/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/timer/next/time",
          "name": "Mähroboter Nächster Start Uhrzeit",
          "unique_id": "unique_id_mahroboter_nachster_start_uhrzeit",
          "object_id": "mahroboter_nachster_start_uhrzeit",
          "icon": "mdi:calendar",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_nachster_start_timestamp/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/timer/next/unix",
          "name": "Mähroboter Nächster Start Timestamp",
          "unique_id": "unique_id_mahroboter_nachster_start_timestamp",
          "object_id": "mahroboter_nachster_start_timestamp",
          "icon": "mdi:calendar",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_strecke_bis_startpunkt/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/distance",
          "name": "Mähroboter Strecke bis Startpunkt",
          "unique_id": "unique_id_mahroboter_strecke_bis_startpunkt",
          "object_id": "mahroboter_strecke_bis_startpunkt",
          "icon": "mdi:map-marker-distance",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_modus_raw/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/mode",
          "name": "Mähroboter Modus Raw",
          "unique_id": "unique_id_mahroboter_modus_raw",
          "object_id": "mahroboter_modus_raw",
          "icon": "mdi:state-machine",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_gestoppt/config
      retain: true
      payload: |
        {
          "state_topic": "automower/mower/stopped",
          "name": "Mähroboter gestoppt",
          "unique_id": "unique_id_mahroboter_gestoppt",
          "object_id": "mahroboter_gestoppt",
          "icon": "mdi:octagon",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_passage_geoffnet/config
      retain: true
      payload: |
        {
          "state_topic": "automower/passage/open",
          "name": "Mähroboter Passage geöffnet",
          "unique_id": "unique_id_mahroboter_passage_geoffnet",
          "object_id": "mahroboter_passage_geoffnet",
          "icon": "mdi:fence",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_wetterstop_aktiv/config
      retain: true
      payload: |
        {
          "state_topic": "automower/weather/data/break",
          "name": "Mähroboter Wetterstop aktiv",
          "unique_id": "unique_id_mahroboter_wetterstop_aktiv",
          "object_id": "mahroboter_wetterstop_aktiv",
          "icon": "mdi:stop",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/mahroboter_wifi_signal/config
      retain: true
      payload: |
        {
          "state_topic": "automower/wlan/rssi",
          "name": "Mähroboter Wifi-Signal",
          "unique_id": "unique_id_mahroboter_wifi_signal",
          "object_id": "mahroboter_wifi_signal",
          "device_class": "signal_strength",
          "state_class": "measurement",
          "unit_of_measurement": "dBm",
          "icon": "mdi:wifi",
          "device": {
              "identifiers": ["330x"],
              "name": "Husqvarna Automower 330x",
              "model": "330x",
              "manufacturer": "Husqvarna",
              "sw_version": "4.05.00"
          }
        }
mode: single

I meanwhile simply tried after my post and what should I tell: It works. It was not so much to re-work but still I am interested in your method as this not being all under the hood of one device annoys me a long time already. So would you mind to detail a bit how this works, the “Put it in a script, run it once (!)” in detail? I assume what you posted below as your config is the result and not the script, am I right? And how does this adapt to other models of mowers and robonects (I see GPS, mine does not have)?

No, this is already the script, not the result. So you can copy and adopt. Just remove the topics, which you don’t use or add, if I missed some. Or rename. And then only execute it. Done.

But how do you control then the mower? I cannot find any of the “automower/control” topics in your script. So the device has only sensors, but no action is possible on it. You created scripts to publish MQTT messages on each control action?
What kind of Robonect do you have? many of the topics in your script don´t even exist in mine, just checked by MQTT Explorer, e.g. I neither have any GPS nor Blades nor a “automower/mower/error” branch… Or is this dependent not on the robonect but the mower?

Didn’t get this. control via

      - service: mqtt.publish
        data:
          topic: automower/control
          payload: start

etc. as before. Didn’t define anything for that before in yaml. And therefor, of course, this is only the replacement for the mqtt yaml sensor entities.

Again. This is a script to add the entities (instead of defining them in config-yaml) with the pros of faster startup time, a device etc., not a automower steering script.

I have the Robonect® Hx. But I doubt, that it is related to the automower modell, but to the Robonect fw, which mqtt topics you have. Here 1.3

Missing MQTT topic branches: you´re right, updating FW to 1.3b brought some of those to mine, too.

Yes, yes. Understood: this script creates the device adding all those sensors. What I am after is to add also the control to the device like having a mode selector or start or stop buttons directly linked to the device - and not only as scripts unlinked to the device which “owns” the sensors only. Maybe this is also possible somehow?