Control husqvarna automower with esphome

I got it working on a esp8266. it works great. I wounder if the # out key functions works?

#   - platform: uart
#     name: "W auto key"
#     data: [0x0F, 0x80, 0x5F, 0x00, 0x0E]

Yes for most of them if l remember well. But it is probably not a good idea to mix them with the custom component. I think they was nothing very interesting that is not in custom component, it was just some first test.

Something useful/fun would be to drive the motors but I didn’t found the commands to send. It seems to be possible because some people did it but they didn’t share the code (or I didn’t found…)

Hi
I found this github that have the motor codes

Excellent :+1: thanks!

I thought there was HACS integration for Husqvarna mowers with Automower® Connect, like the 305. How come the above is needed?

Oh NVM, just needed to RTFM :slight_smile:

“ Automower® Connect comes standard on all X-line models, and it’s an optional add-on for other 300 and 400-series models. ”

I have a 220ac

bought myself a husqvarna aspire r4, after watching this

Only bug I’ve encountered so far is throws an error and fails to load if there is no schedule defined in the cloud

I updated my code to add buttons in HA for motors but it seems not working well. I just added keys and software stop (not tested for now) (+ 0D 9A 99 modes ??? )

Aspire R4 is a good entry level robot mower, has wifi and Bluetooth, has HA integration (via developer API) and is good for up to a 600sqm lawn. It works well, only downside is the error messages (if any) reading via flashing lights is annoying. But a good mower for the price vs others I’ve researched.

Also wanted to display the next time the mower was scheduled to start (on my
magic mirror and nspanel) in a nicer format than the entity that comes with the mower integration, so created a template helper as follows

{% if states('switch.automower_aspire_r4_enable_schedule') == "off" %}
  Schedule Disabled
{% elif states('sensor.automower_aspire_r4_next_start') == "error" %}
  Error
{% elif states('lawn_mower.automower_aspire_r4') == "mowing" or states('lawn_mower.automower_aspire_r4') == "returning" %}
  In Use
{% elif states('sensor.automower_aspire_r4_next_start') == "unknown" %}
    {% if states('lawn_mower.automower_aspire_r4') == "docked" %}
    Recharging
  {% else %}
    {{ states('lawn_mower.automower_aspire_r4') }}
  {% endif %}
{% else %}
   {%- set time = (as_timestamp(states('sensor.automower_aspire_r4_next_start')) - as_timestamp(now())) | int  %}
        {%- set minutes = ((time % 3600) // 60) %}
        {%- set minutes = '{}mins'.format(minutes) if minutes > 0 else '' %}
        {%- set hours = ((time % 86400) // 3600) %}
        {%- set hours = '{}hrs '.format(hours) if hours > 0 else '' %}
        {%- set days = (time // 86400) %}
        {%- set days = '{}days '.format(days) if days > 0 else '' %}
        {{ 'Less than 1 minute' if time < 60 else 'In ' + days + hours + minutes }}
{% endif %}

EDIT: updated helper

Hi I read all your discussion, I wanted to ask if you ever retrieved serial code to “TEST EXIT” option, due to a modification i need to manually say to robot to make it work (it’ s a long story)
Thank you in advance

Hi! This is the year when im connecting my Automower :grin: is there any yaml out there that i can copy paste to an esp connected to my Automower to get it integrated to home assistant? /Carl

Are you using the husqvarna integration? Just add the integration then under the husqvarna device add it to your dashboard.

You mention esp… are you using a automower that can integrate to the cloud?

Your post isn’t that specific…?