Sunrise/Sunset IR led feature #834
Replies: 10 comments 10 replies
-
This would be a great feature but I can't control the IR to stay on. |
Beta Was this translation helpful? Give feedback.
-
You could create your own script and save it to /tmp/sd Some tip:
The commands to switch the IR light are:
These commands will also change camera.conf. |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for the information. I'm a not a top gun programmer and was just wondering how I can vi to the Crontab to put my two lines. Below is the code that I have programmed. It is not perfect, but for my skills, it does the work. I have decided to compare UTC all the time. I might change it as per your last instructions. Here is what I have. Your feedback would be appreciated. Are they any other control of the Night Time LEDs other than the switch? I'm asking, because even when it is turned on/off manually, when set to OFF, the camera will try to switch from somewhat ON/OFF for about 10 minutes, every 30 seconds. Like if it sees its dark, but not dark, dark, but not dark... I will upload a picture later. A picture is worth a thousand words! Thanks.
|
Beta Was this translation helpful? Give feedback.
-
Hi, It is working perfectly. You did not try it yourself?
That's the part that I did not understand until this right minute! Did not notice that you could execute crontab commands right in the "Configuration" page of the camera itself! Since the system time is UTC, if I want to execute a Crontab task at midnight, would I need to account for the UTC offset? My offset at the moment is -0400. Would that mean that the task needs to be added for 4AM? We are EDT -0400 at the moment and will be EST -0500 in November. Will I need to change that in November? I could venture myself, if you allow me, to design something similar as what you have designed for the Timezone. I would add, under the "Configuration/General" section or "Camera Settings/General" (Your call), an input field to write the location code and a web link "https://weather.codes/search/", where the people would find the code and paste it down to the input field. I would also add a switch "Sunrise/Sunset" that would say "Enable/disable Sunrise/Sunset (if you select this option, this will override the IR led switch for night vision and precisely follow the Sunrise/Sunset for your region location code)." Would you guide me on that? Where is the html code? Thanks! |
Beta Was this translation helpful? Give feedback.
-
No, at the moment. crontab works in local time (if I remember correctly), so you don't have to change the schedule. All html/js/css/cgi-code is in the www folder. |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for the information. Well I said "It is working perfectly", until I have it executed by the crontab. If I ssh to the camera and run the Sunrise.sh script manually, the SunValues.txt gets created. If the crontab executes the Sunrise.sh, SunValues.txt does not get created... crontab is new to me. Any idea? I have decided to manage for myself the deletion of the SunValues.txt file every 24 hours, instead of crontab. For HH:MM, when MM = 00, I check if HH =01, for 1AM. It did delete the SunValues.txt file at 1AM, but never got created ever after, even if the Sunrise.sh gets executed every minutes. When I run it manually, it gets created...
I also added a verification for the location code, to test that it is valid. Here is my most recent code:
|
Beta Was this translation helpful? Give feedback.
-
What's your crontab string to start the process? |
Beta Was this translation helpful? Give feedback.
-
I tested it and the file SunValues.txt is properly created inside the /tmp/sd folder
|
Beta Was this translation helpful? Give feedback.
-
Hi, I have decided to change the code, as the data provided for the Sunrise/Sunset from Weather.com does not get updated on a daily basis. They provide 7 days Sunrise/Sunset information, but I thought that they were shifting the information everyday. That is not the case. It can sit there for a few days without getting updated, at least for the Sunrise/Sunset information. Therefore, I've changed the code to build a 7 days array where I pull out the information based on the camera date/time. Below is the final version. I have updated the HTML code, but I was wondering if I was going any further with it. If I'm putting the work to update everything up, is this something that you would implement in a later release? If so, I would work on it, but if not, I can live with the hard coded location code in the script. Also, if I do my own modifications, it means that I will no longer be able to do firmware upgrades, as my modifications will be overridden by yours with a firmware upgrade. I have also noticed that the IR Switch is only for the IR cut filter. The light sensor is still controlling the IR LEDs, based on the light it receives. This is totally annoying!!! That is my understanding. It would be nice to have control of the LEDs itself... The only way I see is to modify the PCB circuit so that when the IR cut filter is ON, cut power to the IR LEDs. A simple NPN transistor would probably do the job. Just curious: "Do you have that expertise?" Maybe someone who reads this thread may have an idea for a circuit, feel free to join.
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi,
Would it be nice to have under the Camera Settings, an enable/disable switch that would turn ON/OFF the IR led based on the Sunrise/Sunset for the chosen Timezone? The IR Led toggle switch would be turned ON at Sunset and turn OFF at Sunrise, based on the Timezone. The code below works for me, but needs integration to the current hack. It only needs the location code and could be input as the same as what is done with the Timezone,.
At the moment, the ON/OFF threshold for the IR leds is quite unreliable. Is there an access to a threshold value or is everything hardware? If software accessible, a 0-100% slider to adjust the threshold sensitivity could also work nicely.
https://weather.com/weather/today/l/CAXX0454
https://weather.codes/search/
Hostname: yi-96a0
Firmware Version: 0.3.0
Base Version: 12.0.35.8_202211241029
Model Suffix: y291ga
Beta Was this translation helpful? Give feedback.
All reactions