My Garden Irrigation

Firstly apologies for my absence here and on Github. Real life is taking over recently. I plan to catch up and deal with all the questions and queries in due course but it won’t be for a few weeks I’m afraid.

Just to confirm that the package does still work (on HA 2022.05), I have started using it again this year :grinning:

@jgosnell - yes I noticed this too. It is as a result of 2022.05 removing the ‘pretty’ time attribute in the history stats. It is mentioned a s a breaking change in the release notes.

The workaround is in item_status_history_line.yaml change the custom_fields at the end of the file to the following.

Note that the result is not as ‘pretty’. The times are simply presented as a fraction of an hour. I intend to look into improving this at some point.

The whole history stats integration isn’t great (IMO). You may have noticed some strange rounding errors already. A big pull request was made (not by me) to improve it but it was rejected, possibly because ‘they’ plan to entirely overhaul it :man_shrugging:

custom_fields:
  total_yesterday: >
    [[[
      var zone = '{{ zone }}';
      return states['sensor.irrigation_' + zone + '_total_time_yesterday'].state;
    ]]]
  total_today: >
    [[[
      var zone = '{{ zone }}';
      return states['sensor.irrigation_' + zone + '_total_time_today'].state;
    ]]]