Page 1 of 1

Days since planting counter (how to create this)

Posted: Mon Jan 11, 2021 7:16 pm
by whatthehellothere
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.

Re: Days since planting counter (how to create this)

Posted: Wed Jan 13, 2021 7:02 pm
by LEDG
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?

Re: Days since planting counter (how to create this)

Posted: Thu Mar 04, 2021 6:46 pm
by Elburro24
did you manage to figure this out?

Re: Days since planting counter (how to create this)

Posted: Thu Mar 04, 2021 9:35 pm
by LEDG
Elburro24 wrote:
Thu Mar 04, 2021 6:46 pm
did you manage to figure this out?
Having trouble with it as well?

Re: Days since planting counter (how to create this)

Posted: Fri Mar 05, 2021 2:22 am
by Elburro24
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.

Re: Days since planting counter (how to create this)

Posted: Fri Mar 05, 2021 5:37 pm
by LEDG
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.

Re: Days since planting counter (how to create this)

Posted: Sun Mar 07, 2021 5:57 am
by CrookedCola
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!

Re: Days since planting counter (how to create this)

Posted: Mon Mar 08, 2021 1:10 am
by stud
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 .

Re: Days since planting counter (how to create this)

Posted: Mon Mar 08, 2021 1:35 am
by CrookedCola
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.