Skip to content

Instantly share code, notes, and snippets.

@lennon101
Created September 19, 2025 12:23
Show Gist options
  • Save lennon101/75c43215800fe747f49d2b646d9910c0 to your computer and use it in GitHub Desktop.
Save lennon101/75c43215800fe747f49d2b646d9910c0 to your computer and use it in GitHub Desktop.
Fertiliser Due
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