Show last time irrigation ran

I hope someone can point me in the right direction for a card I would like to add to my dashboard.

I have a Shelly device that is connected to my irrigation system (which has a separate rain sensor) which I would like to know when it last ran.

The sensor is that the irrigation is on is called sensor.shelly_2_5_fgeleftgpu_power_0

When the irrigation runs it generally draws about 7W but I have noticed that from time to time there is a draw of around 2W when the irrigation is not running.

Therefore I would like to create a card that I display on my dashboard that is a date and time of when this sensor exceeded 3W so I know when the plants were last watered.

Thats the idea but I have to say im a bit lost where to start with creating that and I hope someone might point me to an example or documentation I might use? I have searched tna.

So I’m thinking you could easily accomplish this by creating a Date/Time Helper that you update with an automation when your trigger/conditions are met. You can add a Date/Time helper to an Area so it will show up on the automatic Overview or you can add this helper as a card if you have a custom dashboard. Based on your question this had my interest piqued as I’d like to know when the last time my pool pump has run. I’m going to give this a try myself.

1 Like

I have my automation using the following action nafter my pump turns off.

service: input_datetime.set_datetime
data:
  datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
target:
  entity_id: input_datetime.pool_pump_last_run

I chose this because I’m more interested to know the last time it turned off verses when it turned on because I have a visible timer that tells me how much runtime is left.

1 Like

Thats awesome thanks for setting me on the right track. I added the helper as a card to the dashboard and created the following automation which I hope will do the job:

alias: Update Help When Irrigations Starts
description: ''
trigger:
  - type: power
    platform: device
    device_id: 03931a57c9da7e4d488f20ce4b5aef2a
    entity_id: sensor.shelly_2_5_fgeleftgpu_power_0
    domain: sensor
    above: 4
condition: []
action:
  - service: input_datetime.set_datetime
    data:
      datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'
    target:
      entity_id: input_datetime.irrigation_helper
mode: single