Created
September 19, 2025 12:23
-
-
Save lennon101/75c43215800fe747f49d2b646d9910c0 to your computer and use it in GitHub Desktop.
Fertiliser Due
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Create a template sensor | |
Put this in your configuration.yaml or under Helpers → Template in the UI: | |
```yaml | |
template: | |
- sensor: | |
- name: "Fertiliser Due" | |
state: > | |
{% set last_tap = states('tag.lemon_liquid_feed') %} | |
{% if last_tap not in ['unknown', 'unavailable', 'none'] %} | |
{% set last = as_datetime(last_tap) %} | |
{% set months = ((now() - last).days / 30) | int %} | |
{{ months >= 3 }} | |
{% else %} | |
false | |
{% endif %} | |
device_class: battery | |
icon: mdi:leaf | |
``` | |
This sensor will be "True" if it’s been 3 months or more since the last scan, otherwise "False". | |
2. Use a conditional card in your dashboard | |
```yaml | |
type: conditional | |
conditions: | |
- entity: sensor.fertiliser_due | |
state: "True" | |
card: | |
type: markdown | |
content: | | |
🌱 **Fertiliser due!** | |
``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment