Help with mower status

Dear forum,
In the absence of a proper integration for Robomow lawn mowers, I decided to define my own sensor, so that I can at least check the status and possibly report if it did not return to base.


From the power usage, it is quite easy to see to the human eye what the mower is doing. However, defining the sensor is shaky, as the charging power fluctuates across the “mowing” range, messing up both. This makes it difficult to start a timeout to detect the mower not returning to base.
Suggestions on how to configure the status sensor and timeout?

/Fumble
P.S. I DID have a message exchange with Robomow technical support regarding the options for integration with HA, but got the answer that they do not know what home automation is… I suggested that maybe the kind technician could forward my question to someone more knowledgeable on the topic, but never got a response.
D.S

Mowing is consistent 4-5 watt

Charging is consistent 6+ watt with small drops but not long time

charging fluctuates but in is short interval and always return above 6W. I would expect that above 6w is charging and not charging if below 6w for greater than xx seconds.

Not sure how you would know it not return to base. Not charging and not mowing? 0 watt or less than 4watt? you have example in data?

realized after i type above that you looking at power use of chargers AC socket. I presume above 50watt use is charging and the lower 6-10 with occasional spikes is plugged in, fully charged, and maintaining charge.

That would solve it. How can the xx seconds be coded in the sensor?

Simple timeout. Mowing for more than an hour → stuck. How can that be coded?

The sensor looks like this:

  - sensor:
      - name: "mower"
        state: >
         {% if states("sensor.popp_smart_outdoor_plug_pool_filter_electric_consumption_w_2") | float <= 3 %}
           charging
         {% elif states("sensor.popp_smart_outdoor_plug_pool_filter_electric_consumption_w_2") | float <= 5 %}
           mowing
         {% else %}
           charging
         {% endif %}

/Fumble

Yes, that’s correct. I used to have a status for that too, but it messed things up completely. This is the cleanest I can make it with my current knowledge.

I had previously dismissed this post Need help making a sensor for my lawn mower - #3 by mirekmal as too complicated, but rereading it now, I realize it does exactly what I am after.

/Fumble

You could look into Using power consumption to show information (status, elapsed time, count) of cycles on a dish washer - Configuration - Home Assistant Community (home-assistant.io)