Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DLI Midnight reset? #171

Open
Kagey-cmd opened this issue Jun 20, 2024 · 9 comments
Open

DLI Midnight reset? #171

Kagey-cmd opened this issue Jun 20, 2024 · 9 comments

Comments

@Kagey-cmd
Copy link

Perhaps I am misunderstanding, but it seems to me that DLI should be a continuously recalculated definite integral over the previous 24 hours and shouldn't reset at midnight. For example, at 1AM on Saturday, the DLI should the integral from 1AM Friday to 1AM Saturday, not the integral from 12AM to 1AM. At the very least, it would be a lot more useful that way.

@Olen
Copy link
Owner

Olen commented Aug 14, 2024

This is a limitation on how the statistics sensors in HA works, I believe.

@TheWarped
Copy link

Plant DLI requirements are given as the cumulative amount of light for the day, or the plant's photoperiod, not the previous 24 hrs, thus the "daily" in the variable name daily light integral, and the "d" in the unit mol/d⋅m².

@Kagey-cmd
Copy link
Author

Kagey-cmd commented Aug 15, 2024

@TheWarped a day is 24hrs. If you have a continuous flow of water coming from a tap and want to measure its flow in gallons per day, it doesn't reset to zero at midnight. As currently coded, the DLI of this integration is not giving mol/d⋅m², it is giving mol/hr⋅m² at 1AM, mol/(2hr)⋅m² at 2AM, mol/(12hr)⋅m² at noon, and so on. It is only an accurate measure of how much light a plant is getting each day and therefore a useful, actionable statistic at 11:59 PM.

Not to mention, according to Wikipedia: "Daily light integral (DLI) describes the number of photosynthetically active photons (individual particles of light in the 400-700 nm range) that are delivered to a specific area over a 24-hour period"

According to growlightmeter.com: "The DLI combines light intensity (PPFD) with the lighting duration (photoperiod) over a 24 hour window and is measured in the unit of mol/m²/d"

@TheWarped
Copy link

@Kagey-cmd
The "over a 24-hour period" referenced in the wiki article is worded poorly and misses part of the intent / function of the standardized unit - it respects photoperiod. Wiki articles are open source, so error is common. Careful of .com's for scientific knowledge, peer reviewed studies are more concrete. I've seen some crazy claims on independent websites, like the Cleve Backster experiments that claim plants have some kind of universal consciousness, and they were even featured on Mythbusters.

The standardized DLI that horticulturists communicate to each other and in scientific literature is an integral from 00:00:00 to 23:59:59. Rolling summaries would miss the mark as plants have a circadian rhythm. This is especially important in the case of obligate photoperiodic plants whose flowering response is dependent on the conversion of phytochrome Pfr(active) to phytochrome Pr(inactive), which occurs in uninterrupted dark of sufficient enough length in time. The conversion of phytochrome from an active state to an inactive state can be interrupted and reset during a dark period in some species with very little PPFD.

Poinsettias are an example of an obligate short-day plant.
Here's an example of the importance of defining DLI correctly -
I knew a Poinsettia grower who almost went bankrupt when a supermarket opened up across the street, put up parking lot lights, and a majority of his Poinsettias didn't flower that season, so he couldn't sell them.
According to Purdue University, Poinsettias require 4-5 mol/d⋅m². If they get this during a "short-day" photoperiod, flowering will occur, if any of the DLI is given over their night period, phytochrome conversion would be arrested, and flowering will not occur. Some Poinsettia growers I met would actually had a small light turn on for about an hour every night fixed to a central pivot at the top of their greenhouse to keep their plants from flowering too early for the Christmas season.
You can read more about phytochrome and photoperiodic plants here.

Another example of DLI being standardized is in this publication they quantify DLI across Northern America by season.

DLI is very important, but as caretakers of plants, in regard to light, we also need to pay attention to intensity / PPFD, and photoperiod. Spectrum can be important too, but not nearly as much as those three metrics -
PPFD, DLI, and Photoperiod.

Mind you this is all research done, it's not infallible or code.
The daily paradigm in DLI is useful for us because well, Earth.
However, with more interest in indoor cultivation, there's been a few studies that look at how plants might respond
to abnormal photoperiods. I can't recall where I saw them, but if I recall correctly, one showed that one of the species they tested performed better under a weird photoperiod like 30hrs on, 10 hrs off. Interesting, but I figure that'd be a pain to interact with / manage for someone living on a 24hr clock.

Credentials -
I have a B.S. in Horticulture Science from Michigan State University, co-founded multiple startups around plants, have visited many large-scale commercial plant production operations, have interviewed many lead cultivation managers, and have grown many plants commercially over my career.

@Kagey-cmd
Copy link
Author

Kagey-cmd commented Aug 15, 2024

The DLI standardization study you linked appears to calculate DLI using a 24 hour period. DLI is a physical phenomenon. Sure, it's useful for plants, but by mathematical definition (based soley on it having a /d in its units) it has to be over a 24 hour period. I respect your horticulture credentials, but I think the math isn't mathing here.
Credentials - Am an automation engineer. I build very mathy machines.

@TheWarped
Copy link

DLI is a man-made unit based off observations of nature and its intent / usefulness is as a production metric.
You didn't mention photoperiodism or light intensity, and I believe you've disregarded the importance of their function.
As an automation engineer, I'm sure you can appreciate the case when real world situations don't match our expectations or calculations. Plants have many confounding variables; many we still don't know about. The math isn't as important as the functional output.

Consider the functional output of the following cases of equal DLI, both having 12 hours of light and dark:

Poinsettia grower A - uninterrupted dark
light schedule:

  • 7am -7pm (12hrs) on at 115 PPFD
  • 7pm-7am (12hrs) off at 0 PPFD
  • DLI = ~5
  • Flower induction = True
  • Saleable product = True

Poinsettia grower B - interrupted dark
light schedule:

  • 7am -6pm (11hrs) on at 115 PPFD
  • 6pm-midnight (6hrs) off at 0 PPFD
  • midnight-1am (1hrs) on at 115 PPFD
  • 1am -7am (6hrs) off at 0 PPFD
  • DLI = ~5
  • Flower induction = False
  • Saleable product = False

Regardless of if we calculate DLI based off a rolling 24hrs or resetting the counter at midnight, at the literal end of the day, both methods would yield the same DLI (provided the light schedule is fixed). However, a poinsettia grower would be pretty panicked to see a DLI of 5 in the middle of the night, which would render the unit unreliable and useless to them.

I have my greenhouse DLI thresholds based off my PPFD thresholds and the elapsed apparent photoperiod.
I aim to accumulate at least 1 Mol but not more than 2 Mol in the first hour of lighting to achieve my plants requirements without stressing them. By the end of hour 2, I want between 3-4 Mol, and so on.
If the previous 24 hr's total is accounted for at the start of the day, and I see something like an accumulated 20 Mol in the first hour of lighting, I'm panicking, assuming they somehow just got an hour of 6000 PPFD, knowing that I've seen light burn on them past 1500 PPFD.

Even yield isn't the bottom line when quality is considered.
As caretakers of plants, we need to take a broad perspective to achieve "optimal" outputs.
Include photoperiodism in your mental model of plant growth, you only stand to benefit.

@Olen
Copy link
Owner

Olen commented Aug 15, 2024

Guys!

Thank you for a very insightful debate. However, the main point for me here is that the DLI sensor in this component uses the standard UtilitimeterSensors functionality in HA, and this is a kind of sensor that resets periodically.
It sounds like this is the right thing to do, and unless someone comes up with
a) More convincing arguments for changing this and
b) Creates a PR to implement the changes,
nothing will be changed from my side.

@Kagey-cmd
Copy link
Author

Kagey-cmd commented Aug 15, 2024

I don't expect to win over a disagreeing stranger on the internet, so I will conclude by saying that I just think you're a little out of your depth with the math and physics.
I understand it sounds like you have some expertise in growing flowers, and that's really great! I love plants, too! I just think you should maybe try to understand that DLI, as a measurement of a physical phenomenon doesn't give you ALL of the information you need. In the scenarios you mentioned, you need to the OTHER factors you alluded to in ADDITION to DLI.

Also, would like to mention that every source I've been able to encounter on the internet, including the ones linked by @TheWarped and the studies referenced by those studies ALL calculate DLI over a 24-hour period. This is in addition to the simple mathematical definition of a daily integral.

@Olen, I'm not sure how this would be implemented in your very lovely integration, but I've been able to make rolling 24-hour integrals using the HA native Statistics integration of things like, for example, accumulated rainfall over the previous 24 hours.

@TheWarped
Copy link

TheWarped commented Aug 20, 2024

We may disagree, but I came here to help.
So, here's a work-around option for your requested feature.

To get a running total, make an integration sensor with the source being the "Ppfd (mol)" sensor found in the diagnostics section of the plant device info.
Then, as you mentioned, use the statistics integration to get the change of the cumulative integral over the desired time period.

sensor:
  - platform: integration
    name: light_integral_running_total_mol
    source: sensor.mysensor_ppfd_mol
    method: trapezoidal
    unit_time: s
    round: 2
  - platform: statistics
    name: "My Sliding Window Light Integral"
    entity_id: sensor.light_integral_running_total_mol
    state_characteristic: change
    max_age:
      hours: 24

Hopefully that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants