Days since planting counter (how to create this)

Home Assistant automation projects, questions, etc. go here.
Post Reply
whatthehellothere
LED-Curious
LED-Curious
Reactions:
Posts: 1
Joined: Sat Nov 21, 2020 9:38 pm

Hello all,

I'm trying to set a custom days since counter to track my seeding dates. This will need to be a custom defined date/time as I don't have any other events/triggers I can use.
I've implemented the following into my Config.yaml but am lost as to where/how to configure this.
platform: template
sensors:
days_since_grow_start:
friendly_name: "Days Since Grow Start"
icon_template: mdi:calendar
value_template: '{{ ((as_timestamp(now()) - (states.input_datetime.grow_start_date.attributes.timestamp)) | int /60/1440) | round(0) }}'

input_datetime:
grow_start_date:
name: Grow Start Date
has_date: true
has_time: false
My question is, where do I define the initial start date for Grow Start Date? I have the Days Since Grow Start entity created, but it lacks a valid ID. Apologies for the stupid questions, I'm still learning.
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

whatthehellothere wrote:
Mon Jan 11, 2021 7:16 pm
Hello all,

I'm trying to set a custom days since counter to track my seeding dates. This will need to be a custom defined date/time as I don't have any other events/triggers I can use.
I've implemented the following into my Config.yaml but am lost as to where/how to configure this.
platform: template
sensors:
days_since_grow_start:
friendly_name: "Days Since Grow Start"
icon_template: mdi:calendar
value_template: '{{ ((as_timestamp(now()) - (states.input_datetime.grow_start_date.attributes.timestamp)) | int /60/1440) | round(0) }}'

input_datetime:
grow_start_date:
name: Grow Start Date
has_date: true
has_time: false
My question is, where do I define the initial start date for Grow Start Date? I have the Days Since Grow Start entity created, but it lacks a valid ID. Apologies for the stupid questions, I'm still learning.
Have you added the input datetime to your dashboard? Does it work?
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
Elburro24
LED-Curious
LED-Curious
Reactions:
Posts: 17
Joined: Tue Feb 23, 2021 9:43 am

did you manage to figure this out?
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

Elburro24 wrote:
Thu Mar 04, 2021 6:46 pm
did you manage to figure this out?
Having trouble with it as well?
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
Elburro24
LED-Curious
LED-Curious
Reactions:
Posts: 17
Joined: Tue Feb 23, 2021 9:43 am

Earlier in the day I managed to create a simple lovelace entities card that includes the grow start date, the days since the start of the grow, and what week the grow is on. Thanks for all this LEDG, i'll be buying you a few beers when i can.
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

Elburro24 wrote:
Fri Mar 05, 2021 2:22 am
Earlier in the day I managed to create a simple lovelace entities card that includes the grow start date, the days since the start of the grow, and what week the grow is on. Thanks for all this LEDG, i'll be buying you a few beers when i can.
Oh good stuff, thought it might not be working for you either so I was going to have a look at it. Home Assistant updates break stuff sometimes.
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
User avatar
CrookedCola
LED-Curious
LED-Curious
Reactions:
Posts: 9
Joined: Fri Feb 26, 2021 2:07 pm
Location: United States

This is good stuff. I can't wait to fire up an old pi 3+ with a fresh HA install, and start my new room automation. Hopefully, I'll have my work room ready to start building my grow pod, next week. I've got most of the components LEDg recommends in his, awesome. automation videos arriving throughout next week.

I also plan on doing raised bed gardens in my backyard this year. I'm stoked to expand my automation there, as well.

happy hacking!
I love Linux, Automation, and Marijuana.
DIY or DIE
stud
LED Lover
LED Lover
Reactions:
Posts: 143
Joined: Wed Jun 03, 2020 4:19 pm
Location: Canada

CrookedCola wrote:
Sun Mar 07, 2021 5:57 am
This is good stuff. I can't wait to fire up an old pi 3+ with a fresh HA install, and start my new room automation. Hopefully, I'll have my work room ready to start building my grow pod, next week. I've got most of the components LEDg recommends in his, awesome. automation videos arriving throughout next week.

I also plan on doing raised bed gardens in my backyard this year. I'm stoked to expand my automation there, as well.

happy hacking!
i suggest you starting HA with a USB stick or SSD drive on the RPI , the SD cards a lot of times get corrupted .
User avatar
CrookedCola
LED-Curious
LED-Curious
Reactions:
Posts: 9
Joined: Fri Feb 26, 2021 2:07 pm
Location: United States

stud wrote:
Mon Mar 08, 2021 1:10 am
CrookedCola wrote:
Sun Mar 07, 2021 5:57 am
This is good stuff. I can't wait to fire up an old pi 3+ with a fresh HA install, and start my new room automation. Hopefully, I'll have my work room ready to start building my grow pod, next week. I've got most of the components LEDg recommends in his, awesome. automation videos arriving throughout next week.

I also plan on doing raised bed gardens in my backyard this year. I'm stoked to expand my automation there, as well.

happy hacking!
i suggest you starting HA with a USB stick or SSD drive on the RPI , the SD cards a lot of times get corrupted .
I'm pretty familiar with HA and pi hacking. SD cards are dirt cheap these days (I just picked up 3x 32G for $12 USD), and HA makes it easy to export/import backups.
I love Linux, Automation, and Marijuana.
DIY or DIE
Post Reply