Control of my robot lawnmower

I have a sort of good solution to my Gardena robot lawnmower.
But I would like to make it a bit smarter.
I have installed a simple magnetic connector between the lawnmower and charging station, with that I can see if the lawnmower is out cutting the grass or is in the charging station.
If the mower is out for more than 2 hours, I get a note on my phone that something is wrong with the mower.
To develop this, I got a Telldus “engine heater plug” that is located between the wall socket and the charger.
My idea is to program the “plug” to turn off the power if YR (weather app) shows rain and turn on if it does not show rain.
But the power is only allowed to break if the mower is charging (you know it by the means of the magnetic plug) otherwise the mower will stay on the lawn instead of at the charging station.
Any suggestions on how to program this in HA?

So you din’t provide the details, like the entity_id’s of the relevant entities. But let’s assume there’s a binary_sensor that indicates whether or not the mower is at the charger (I’ll call it binary_sensor.mower_at_charger.) Also I don’t know how you turn the mower on and off. But it could look something like this:

automation:
  - alias: Mower power
    trigger:
      platform: state
      entity_id:
        - binary_sensor.mower_at_charger
        - sensor.yr_symbol
    action:
      service_template: >
        {% is_state('binary_sensor.mower_at_charger', 'on') and
           states('sensor.yr_symbol')|int in [5, 6, 9, 10, 11] %}
          # Turn off mower
        {% else %}
          # Turn on mower
      # Any other parameters for service...

The idea is this automation will run whenever the mower docks with, or leaves, the charger, and whenever the current weather condition changes. Then if the mower is at the charger and the weather condition (as indicated by the sensor.yr_symbol number) shows rain, then call whatever service is used to turn the mover off. Otherwise, turn the mower on. The numbers I’ve come up with by observation. A different set might be appropriate for you.

Also, this might need optimization if turning the mower on when it’s already on is not “good” (and same for turning it off.)

But, at least, this might be a start for you.

1 Like