Looking for ideas...
Posted: Thu May 17, 2018 2:19 am
I am building a mailbox monitor and am looking for some ideas.
(BTW, this is really an example of pattern detection that probably has value run many circumstances.)
Background
The mailbox is a typical french mailbox with a flap-slot set into a large door
There are several options for sensing either the opening of the flap or door, or the presence of mail in the mailbox. I have chosen to use a light detector placed at the back of the mailbox to detect changes in light caused by the opening of the flap or door. This will also work at night because off the presence of a nearby street light.
I have created an Indigo device that contains the state brightness which is an integer value in (lux). Changes in light level are broadcast to Indigo (i.e. I am not polling the sensor) Opening the flap or door causes an instantaneous increase in brightness and closing the flap/door is reflected by an instantaneous drop. I have created an Indigo trigger to record changes in brightness. Here is a typical sequence of results from opening the flap under bright sun:
Notes:
The challenge
The basic task is to detect a significant rise in light followed by a significant drop within 2 seconds to 2 minutes (the time to deliver letters or a package) and ten send a notification. The means of the notification is not an issue here.
However, this task is made more complex because the background level of brightness changes greatly during the day based on weather and time-of-day. This means that the change detection must be relative and cannot be based on absolute brightness values.
I am open to using any means available within Indigo (except AppleScript, of course). It would be nice to use just built in aspects of Indigo, but scripting is fine as well.
Ideas?
(BTW, this is really an example of pattern detection that probably has value run many circumstances.)
Background
The mailbox is a typical french mailbox with a flap-slot set into a large door
There are several options for sensing either the opening of the flap or door, or the presence of mail in the mailbox. I have chosen to use a light detector placed at the back of the mailbox to detect changes in light caused by the opening of the flap or door. This will also work at night because off the presence of a nearby street light.
I have created an Indigo device that contains the state brightness which is an integer value in (lux). Changes in light level are broadcast to Indigo (i.e. I am not polling the sensor) Opening the flap or door causes an instantaneous increase in brightness and closing the flap/door is reflected by an instantaneous drop. I have created an Indigo trigger to record changes in brightness. Here is a typical sequence of results from opening the flap under bright sun:
- 2018-05-16 15:06:38.195 Mailbox light level: 35.0
2018-05-16 15:06:38.219 Mailbox light level: 29.0
2018-05-16 15:06:38.247 Mailbox light level: 22.0
2018-05-16 15:06:38.347 Mailbox light level: 16.0
2018-05-16 15:06:47.769 Mailbox light level: 23.0 <- Starting to open flap
2018-05-16 15:06:47.798 Mailbox light level: 32.0
2018-05-16 15:06:47.813 Mailbox light level: 40.0
2018-05-16 15:06:47.838 Mailbox light level: 47.0
2018-05-16 15:06:47.866 Mailbox light level: 55.0
2018-05-16 15:06:47.879 Mailbox light level: 62.0
2018-05-16 15:06:47.913 Mailbox light level: 78.0
2018-05-16 15:06:47.925 Mailbox light level: 84.0
2018-05-16 15:06:47.963 Mailbox light level: 92.0
2018-05-16 15:06:47.986 Mailbox light level: 98.0
2018-05-16 15:06:48.021 Mailbox light level: 106.0
2018-05-16 15:06:48.061 Mailbox light level: 112.0
2018-05-16 15:06:48.136 Mailbox light level: 105.0
2018-05-16 15:06:48.743 Mailbox light level: 111.0 <- Flap fully open
2018-05-16 15:06:48.926 Mailbox light level: 104.0
2018-05-16 15:06:48.972 Mailbox light level: 97.0
2018-05-16 15:06:48.998 Mailbox light level: 91.0
2018-05-16 15:06:49.014 Mailbox light level: 75.0
2018-05-16 15:06:49.050 Mailbox light level: 53.0
2018-05-16 15:06:49.074 Mailbox light level: 46.0
2018-05-16 15:06:49.099 Mailbox light level: 37.0
2018-05-16 15:06:49.111 Mailbox light level: 31.0
2018-05-16 15:06:49.147 Mailbox light level: 23.0 <- Flap fully closed
2018-05-16 15:06:49.213 Mailbox light level: 17.0
2018-05-16 15:13:51.508 Mailbox light level: 23.0
Notes:
- There are continual small variations in light level
- I can set the minimum amount of change required for the light sensor to report. In the test above it was set to 8
The challenge
The basic task is to detect a significant rise in light followed by a significant drop within 2 seconds to 2 minutes (the time to deliver letters or a package) and ten send a notification. The means of the notification is not an issue here.
However, this task is made more complex because the background level of brightness changes greatly during the day based on weather and time-of-day. This means that the change detection must be relative and cannot be based on absolute brightness values.
I am open to using any means available within Indigo (except AppleScript, of course). It would be nice to use just built in aspects of Indigo, but scripting is fine as well.
Ideas?