Android Set Brightness & Settings by Sunrise/Sunset GPS data

Thread Tools
 
Search this Thread
 
Old 10-24-2014, 04:38 PM
  #1  
Burning Brakes
Thread Starter
iTrader: (3)
 
mzilvar's Avatar
 
Join Date: Jan 2012
Posts: 940
Received 214 Likes on 152 Posts
Android Set Brightness & Settings by Sunrise/Sunset GPS data

I can't take full credit for this, much of it was taken from the Tasker Wiki here:

Sunrise and Sunset times - Tasker Wiki

I have, however, modified it slightly to use earthtools and also to use GPS to determine your location vice using an internet connection. Here's what it does, the pre-requisites and how to use it.

Disclaimer

I accept no responsibility whatsoever for any harm, damage or anything otherwise that the script included may cause. Additionally I provide no warranty, express or implied of any type. The code is free to use, as you see fit.

What is this?

A script that is used from Tasker on a rooted android device to fetch the sunrise and sunset times for your location, determined by GPS, from the internet and write them to a Google calendar.

This is for use on any Android in-dash tablet install or other Android device where you might find these functions useful.

Once this data is written to a Google calendar, we can use another script to read that data and can perform a whole host of functions based upon the GPS-based sunrise and sunset times for your location including:

- Alter the tablet manual brightness settings
- Change your wall-paper
- Enable night-mode settings
- Anything else you can do from tasker that you might want to do after sunset
- There are some extra tasks that in the script that are not needed, like one to create a 'Reboot' button and one for a 'Reboot to Recovery' button. If you don't need these just delete the tasks out of Tasker. This is taken off my tablet and are a few extra things I was using.
- 'Sun Data', 'Sun Calendar', 'Day Settings' and 'Night Settings' are the ones that work the magic

Pre-Requisites

- Rooted tablet
- Android based device
- Tasker App installed from Play store
- A Google calendar named 'Tasker'

Optional

- Tasker Helper
- Secure Settings (required for some of the tasks included in the xml, though not the Sunrise/Sunset times tasks)
- Link to the ROM I'm using for Nexus 7 (V) 1 only --> AutoDroid http://forum.xda-developers.com/show....php?t=2789993 (kernel is included with ROM now, he's updated past where I was at in the video)

How to use it

Before Proceeding backup your current Tasker profiles to an xml file, in case there is a conflict between two of them and one of yours gets over-written or altered. If it does you can remove the tasks in conflict and restore your original profiles to add them back in.

- Copy the code in the code section below.
- Paste it into a new text file
- Name the file to your desire and change the .txt extension to .xml
- Transfer this file to your android device and place it in /sdcard/tasker/profiles
- From tasker, long press the profiles tab and press import
- Import the xml file

Important Notes

- You MUST create a calendar named 'Tasker' exactly in order for this to work with the script as-is. You can alter the script to change the calendar name and then create a Google calendar named whatever you like, so long as it matches what is in the script.
- Check your time-zone settings on your Google calendar, this can throw off the sunrise/sunset times if it's improperly set.
- Alter the profile that runs it automatically to a time when you'll be in your car with your phone tethered so there's an internet connection
- Alternatively you can create a button somewhere and press it to fetch the sunshine data and then press another button to write that data to the sun calendar using the tasks themselves.
- This fetches the sunrise/sunset times for the NEXT day, not the CURRENT day, so you must run it the day prior, either automatically while your phone is connected or manually by running the tasks themselves
- There are extra tasks the script will add to tasker, if not needed simply delete them or change them to your heart's desire.


Video of it Running


So where's the code? (Sorry AZ won't let me use the code blocks.)

<TaskerData sr="" dvi="1" tv="4.4u3m">
<Profile sr="prof12" ve="2">
<cdate>1404954462625</cdate>
<edate>1407359886633</edate>
<flags>18</flags>
<id>12</id>
<mid0>10</mid0>
<mid1>11</mid1>
<nme>Sunshine</nme>
<State sr="con0" ve="2">
<code>5</code>
<Str sr="arg0" ve="3">Daytime</Str>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3"/>
<Int sr="arg3" val="0"/>
<Str sr="arg4" ve="3">Google:Tasker</Str>
</State>
</Profile>
<Profile sr="prof13" ve="2">
<cdate>1407203812433</cdate>
<edate>1409111041312</edate>
<flags>2</flags>
<id>13</id>
<mid0>14</mid0>
<State sr="con0" ve="2">
<code>10</code>
<pin>true</pin>
<Int sr="arg0" val="0"/>
</State>
</Profile>
<Profile sr="prof5" ve="2">
<cdate>1405808984151</cdate>
<edate>1409111058336</edate>
<flags>2</flags>
<id>5</id>
<mid0>6</mid0>
<State sr="con0" ve="2">
<code>10</code>
<Int sr="arg0" val="0"/>
</State>
</Profile>
<Profile sr="prof9" ve="2">
<cdate>1404954386303</cdate>
<edate>1409182906425</edate>
<flags>16</flags>
<id>9</id>
<mid0>7</mid0>
<mid1>8</mid1>
<nme>Sunshine - Check</nme>
<Time sr="con0">
<fh>7</fh>
<fm>0</fm>
<th>7</th>
<tm>1</tm>
</Time>
</Profile>
<Project sr="proj0" ve="2">
<cdate>1404078747474</cdate>
<mdate>1407203878127</mdate>
<name>Base</name>
<pids>9,12,5,13</pids>
<tids>7,8,10,11,2,3,6,4,14</tids>
<Img sr="icon" ve="2">
<nme>hl_aaa_ext_home</nme>
</Img>
</Project>
<Task sr="task10">
<cdate>1404954462615</cdate>
<edate>1409767639345</edate>
<id>10</id>
<nme>Day Settings</nme>
<pri>10</pri>
<Action sr="act0" ve="6">
<code>808</code>
<Int sr="arg0" val="0"/>
</Action>
<Action sr="act1" ve="6">
<code>989</code>
<Int sr="arg0" val="0"/>
</Action>
<Action sr="act2" ve="6">
<code>810</code>
<Int sr="arg0" val="122"/>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act3" ve="6">
<code>109</code>
<Str sr="arg0" ve="3">Download/whiteslm.png</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
</Action>
<Img sr="icn" ve="2">
<nme>hl_rating_important</nme>
</Img>
</Task>
<Task sr="task11">
<cdate>1404954462613</cdate>
<edate>1407814600154</edate>
<id>11</id>
<nme>Night Settings</nme>
<pri>10</pri>
<Action sr="act0" ve="6">
<code>808</code>
<Int sr="arg0"/>
</Action>
<Action sr="act1" ve="6">
<code>989</code>
<Int sr="arg0" val="1"/>
</Action>
<Action sr="act2" ve="6">
<code>810</code>
<Int sr="arg0" val="30"/>
<Int sr="arg1"/>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="1"/>
</Action>
<Action sr="act3" ve="6">
<code>109</code>
<Str sr="arg0" ve="3">Download/bluslm.png</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
</Action>
<Img sr="icn" ve="2">
<nme>hl_rating_not_important</nme>
</Img>
</Task>
<Task sr="task14">
<cdate>1407203825065</cdate>
<edate>1409111041312</edate>
<id>14</id>
<nme>Kill Apps</nme>
<Action sr="act0" ve="6">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra. BLURB>Airplane Mode Enabled</com.intangibleobject.securesettings.plugin.extra.B LURB>
<com.intangibleobject.securesettings.plugin.extra. BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.B LURB-type>
<com.intangibleobject.securesettings.plugin.extra. ENABLED>true</com.intangibleobject.securesettings.plugin.extra.E NABLED>
<com.intangibleobject.securesettings.plugin.extra. ENABLED-type>java.lang.Boolean</com.intangibleobject.securesettings.plugin.extra.E NABLED-type>
<com.intangibleobject.securesettings.plugin.extra. SETTING>airplane_mode</com.intangibleobject.securesettings.plugin.extra.S ETTING>
<com.intangibleobject.securesettings.plugin.extra. SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.S ETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Airp lane Mode Enabled</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin </Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act1" ve="6">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra. BLURB>GPS Disabled</com.intangibleobject.securesettings.plugin.extra.B LURB>
<com.intangibleobject.securesettings.plugin.extra. BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.B LURB-type>
<com.intangibleobject.securesettings.plugin.extra. ENABLED>false</com.intangibleobject.securesettings.plugin.extra.E NABLED>
<com.intangibleobject.securesettings.plugin.extra. ENABLED-type>java.lang.Boolean</com.intangibleobject.securesettings.plugin.extra.E NABLED-type>
<com.intangibleobject.securesettings.plugin.extra. SETTING>gps</com.intangibleobject.securesettings.plugin.extra.S ETTING>
<com.intangibleobject.securesettings.plugin.extra. SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.S ETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>GP S Disabled</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin </Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act2" ve="6">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra. BLURB>Location Mode/Location Off</com.intangibleobject.securesettings.plugin.extra.B LURB>
<com.intangibleobject.securesettings.plugin.extra. BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.B LURB-type>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION>0</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION-type>java.lang.Integer</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION-type>
<com.intangibleobject.securesettings.plugin.extra. SETTING>location_mode</com.intangibleobject.securesettings.plugin.extra.S ETTING>
<com.intangibleobject.securesettings.plugin.extra. SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.S ETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Loca tion Mode/Location Off</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin </Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
</Task>
<Task sr="task2">
<cdate>1405025734038</cdate>
<edate>1405025820690</edate>
<id>2</id>
<nme>Reboot</nme>
<Action sr="act0" ve="6">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra. BLURB>Reboot</com.intangibleobject.securesettings.plugin.extra.B LURB>
<com.intangibleobject.securesettings.plugin.extra. BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.B LURB-type>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION>REBOOT</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION-type>
<com.intangibleobject.securesettings.plugin.extra. SETTING>reboot</com.intangibleobject.securesettings.plugin.extra.S ETTING>
<com.intangibleobject.securesettings.plugin.extra. SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.S ETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Rebo ot</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin </Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
<Img sr="icn" ve="2">
<nme>hd_navigation_refresh</nme>
</Img>
</Task>
<Task sr="task3">
<cdate>1405025831967</cdate>
<edate>1405025870580</edate>
<id>3</id>
<nme>Recovery</nme>
<Action sr="act0" ve="6">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra. BLURB>Reboot Recovery</com.intangibleobject.securesettings.plugin.extra.B LURB>
<com.intangibleobject.securesettings.plugin.extra. BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.B LURB-type>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION>REBOOT_RECOVERY</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION-type>
<com.intangibleobject.securesettings.plugin.extra. SETTING>reboot</com.intangibleobject.securesettings.plugin.extra.S ETTING>
<com.intangibleobject.securesettings.plugin.extra. SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.S ETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Rebo ot Recovery</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin </Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
<Img sr="icn" ve="2">
<nme>hd_images_rotate_left</nme>
</Img>
</Task>
<Task sr="task4">
<cdate>946705436924</cdate>
<edate>946705571035</edate>
<id>4</id>
<nme>Shutdown</nme>
<Action sr="act0" ve="6">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra. BLURB>Shutdown</com.intangibleobject.securesettings.plugin.extra.B LURB>
<com.intangibleobject.securesettings.plugin.extra. BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.B LURB-type>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION>SHUTDOWN</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION-type>
<com.intangibleobject.securesettings.plugin.extra. SETTING>reboot</com.intangibleobject.securesettings.plugin.extra.S ETTING>
<com.intangibleobject.securesettings.plugin.extra. SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.S ETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Shut down</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin </Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
<Img sr="icn" ve="2">
<nme>hd_aaa_ext_halt</nme>
</Img>
</Task>
<Task sr="task6">
<cdate>1405808993754</cdate>
<edate>1409111058336</edate>
<id>6</id>
<nme>On</nme>
<pri>10</pri>
<Action sr="act0" ve="6">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra. BLURB>Keep Display On: AC, USB</com.intangibleobject.securesettings.plugin.extra.B LURB>
<com.intangibleobject.securesettings.plugin.extra. BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.B LURB-type>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION>3</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION-type>
<com.intangibleobject.securesettings.plugin.extra. SETTING>display_charge</com.intangibleobject.securesettings.plugin.extra.S ETTING>
<com.intangibleobject.securesettings.plugin.extra. SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.S ETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Ke ep Display On: AC, USB</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin </Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act1" ve="6">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra. BLURB>Airplane Mode Disabled</com.intangibleobject.securesettings.plugin.extra.B LURB>
<com.intangibleobject.securesettings.plugin.extra. BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.B LURB-type>
<com.intangibleobject.securesettings.plugin.extra. ENABLED>false</com.intangibleobject.securesettings.plugin.extra.E NABLED>
<com.intangibleobject.securesettings.plugin.extra. ENABLED-type>java.lang.Boolean</com.intangibleobject.securesettings.plugin.extra.E NABLED-type>
<com.intangibleobject.securesettings.plugin.extra. SETTING>airplane_mode</com.intangibleobject.securesettings.plugin.extra.S ETTING>
<com.intangibleobject.securesettings.plugin.extra. SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.S ETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Airp lane Mode Disabled</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin </Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act2" ve="6">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra. BLURB>GPS Enabled</com.intangibleobject.securesettings.plugin.extra.B LURB>
<com.intangibleobject.securesettings.plugin.extra. BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.B LURB-type>
<com.intangibleobject.securesettings.plugin.extra. ENABLED>true</com.intangibleobject.securesettings.plugin.extra.E NABLED>
<com.intangibleobject.securesettings.plugin.extra. ENABLED-type>java.lang.Boolean</com.intangibleobject.securesettings.plugin.extra.E NABLED-type>
<com.intangibleobject.securesettings.plugin.extra. SETTING>gps</com.intangibleobject.securesettings.plugin.extra.S ETTING>
<com.intangibleobject.securesettings.plugin.extra. SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.S ETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>GP S Enabled</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin </Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act3" ve="6">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra. BLURB>Location Mode/Device Only</com.intangibleobject.securesettings.plugin.extra.B LURB>
<com.intangibleobject.securesettings.plugin.extra. BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.B LURB-type>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION>1</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION>
<com.intangibleobject.securesettings.plugin.extra. EXTRA_SPINNER_OPTION-type>java.lang.Integer</com.intangibleobject.securesettings.plugin.extra.E XTRA_SPINNER_OPTION-type>
<com.intangibleobject.securesettings.plugin.extra. SETTING>location_mode</com.intangibleobject.securesettings.plugin.extra.S ETTING>
<com.intangibleobject.securesettings.plugin.extra. SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.S ETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Loca tion Mode/Device Only</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin </Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
</Task>
<Task sr="task7">
<cdate>1404954386277</cdate>
<edate>1413001529528</edate>
<id>7</id>
<nme>Sun Data</nme>
<pri>10</pri>
<Action sr="act0" ve="6">
<code>902</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="30"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act1" ve="6">
<code>590</code>
<Str sr="arg0" ve="3">%LOC</Str>
<Str sr="arg1" ve="3">,</Str>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act10" ve="6">
<code>547</code>
<Str sr="arg0" ve="3">%Sunset</Str>
<Str sr="arg1" ve="3">%DATE %HTTPD012</Str>
<Int sr="arg2"/>
<Int sr="arg3"/>
</Action>
<Action sr="act11" ve="6">
<code>549</code>
<Str sr="arg0" ve="3">%HTTPD+</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act12" ve="6">
<code>549</code>
<Str sr="arg0" ve="3">%LOC2</Str>
<Int sr="arg1"/>
</Action>
<Action sr="act13" ve="6">
<code>549</code>
<Str sr="arg0" ve="3">%LOC1</Str>
<Int sr="arg1"/>
</Action>
<Action sr="act14" ve="6">
<code>549</code>
<Str sr="arg0" ve="3">%DATE+</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act15" ve="6">
<code>596</code>
<Str sr="arg0" ve="3">%Sunrise</Str>
<Int sr="arg1" val="3"/>
<Str sr="arg2" ve="3">%SunriseMin</Str>
</Action>
<Action sr="act16" ve="6">
<code>596</code>
<Str sr="arg0" ve="3">%Sunset</Str>
<Int sr="arg1" val="3"/>
<Str sr="arg2" ve="3">%SunsetMin</Str>
</Action>
<Action sr="act17" ve="6">
<code>548</code>
<Str sr="arg0" ve="3">Sunshine Data retrieved for %LOC
%Sunrise - %Sunset</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act2" ve="6">
<code>590</code>
<Str sr="arg0" ve="3">%DATE</Str>
<Str sr="arg1" ve="3">-</Str>
<Int sr="arg2"/>
</Action>
<Action sr="act3" ve="6">
<code>118</code>
<Str sr="arg0" ve="3">www.earthtools.org</Str>
<Str sr="arg1" ve="3">/sun/%LOC1/%LOC2/%DAYM/%DATE1/99/1</Str>
<Str sr="arg2" ve="3"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Int sr="arg5" val="12"/>
<Str sr="arg6" ve="3">text/xml</Str>
<Str sr="arg7" ve="3"/>
<Int sr="arg8" val="0"/>
</Action>
<Action sr="act4" ve="6">
<code>547</code>
<Str sr="arg0" ve="3">%HTTPD0</Str>
<Str sr="arg1" ve="3">%HTTPD</Str>
<Int sr="arg2"/>
<Int sr="arg3"/>
</Action>
<Action sr="act5" ve="6">
<code>590</code>
<Str sr="arg0" ve="3">%HTTPD0</Str>
<Str sr="arg1" ve="3">&lt;/sunrise&gt;</Str>
<Int sr="arg2"/>
</Action>
<Action sr="act6" ve="6">
<code>590</code>
<Str sr="arg0" ve="3">%HTTPD01</Str>
<Str sr="arg1" ve="3">&lt;sunrise&gt;</Str>
<Int sr="arg2"/>
</Action>
<Action sr="act7" ve="6">
<code>547</code>
<Str sr="arg0" ve="3">%Sunrise</Str>
<Str sr="arg1" ve="3">%DATE %HTTPD012</Str>
<Int sr="arg2"/>
<Int sr="arg3"/>
</Action>
<Action sr="act8" ve="6">
<code>590</code>
<Str sr="arg0" ve="3">%HTTPD0</Str>
<Str sr="arg1" ve="3">&lt;/sunset&gt;</Str>
<Int sr="arg2"/>
</Action>
<Action sr="act9" ve="6">
<code>590</code>
<Str sr="arg0" ve="3">%HTTPD01</Str>
<Str sr="arg1" ve="3">&lt;sunset&gt;</Str>
<Int sr="arg2"/>
</Action>
<Img sr="icn" ve="2">
<nme>hd_device_access_brightness_high</nme>
</Img>
</Task>
<Task sr="task8">
<cdate>1404954386281</cdate>
<edate>1405805174992</edate>
<id>8</id>
<nme>Sun Calendar</nme>
<pri>10</pri>
<Action sr="act0" ve="6">
<code>547</code>
<Str sr="arg0" ve="3">%DAYSTART</Str>
<Str sr="arg1" ve="3">%SunriseMin / 60 - %TIMES / 60</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3"/>
</Action>
<Action sr="act1" ve="6">
<code>547</code>
<Str sr="arg0" ve="3">%DAYLENGTH</Str>
<Str sr="arg1" ve="3">%SunsetMin / 60 - %SunriseMin / 60</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3"/>
</Action>
<Action sr="act2" ve="6">
<code>547</code>
<Str sr="arg0" ve="3">%DAYSTART</Str>
<Str sr="arg1" ve="3">%DAYSTART + 1440</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%DAYSTART</lhs>
<op>6</op>
<rhs>0</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act3" ve="6">
<code>590</code>
<Str sr="arg0" ve="3">%DAYSTART</Str>
<Str sr="arg1" ve="3">.</Str>
<Int sr="arg2"/>
</Action>
<Action sr="act4" ve="6">
<code>590</code>
<Str sr="arg0" ve="3">%DAYLENGTH</Str>
<Str sr="arg1" ve="3">.</Str>
<Int sr="arg2"/>
</Action>
<Action sr="act5" ve="6">
<code>567</code>
<Str sr="arg0" ve="3">%DAYSTART1 / %DAYLENGTH1</Str>
<Str sr="arg1" ve="3">Google:Tasker</Str>
<Str sr="arg2" ve="3">Daytime</Str>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Int sr="arg5"/>
<Int sr="arg6" val="0"/>
</Action>
<Action sr="act6" ve="6">
<code>549</code>
<Str sr="arg0" ve="3">%DAY*</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act7" ve="6">
<code>549</code>
<Str sr="arg0" ve="3">%SunriseMin</Str>
<Int sr="arg1"/>
</Action>
<Action sr="act8" ve="6">
<code>549</code>
<Str sr="arg0" ve="3">%SunsetMin</Str>
<Int sr="arg1"/>
</Action>
<Action sr="act9" ve="6">
<code>548</code>
<Str sr="arg0" ve="3">Sunshine Data saved to Calender</Str>
<Int sr="arg1" val="1"/>
</Action>
<Img sr="icn" ve="2">
<nme>hd_content_event</nme>
</Img>
</Task>
</TaskerData>

Last edited by mzilvar; 10-24-2014 at 04:48 PM.
The following 2 users liked this post by mzilvar:
JMiles_T (12-05-2014), triax37 (10-24-2014)
Old 10-24-2014, 05:05 PM
  #2  
Racer
iTrader: (1)
 
triax37's Avatar
 
Join Date: Feb 2007
Location: Denver, CO
Age: 45
Posts: 404
Received 102 Likes on 72 Posts
Cool. Thanks for sharing and the great writeup!
Old 10-27-2014, 12:02 PM
  #3  
The DVD-A Script Guy
 
Adobeman's Avatar
 
Join Date: Apr 2005
Location: CT
Age: 60
Posts: 2,009
Received 184 Likes on 131 Posts
That's quite a bit of moving parts! But if it works....

Is the light sensor obstructed or not on your Nex? I can't tell from the pictures. If it isn't you may want to try an app called Velis Auto Brightness. I use it on my phone and it's been pretty good. Typically the auto brightness curves in most ROMS leave a bit to be desired but what you might find interesting about this one is you can set the curve your self and you can also set many other variables like ramp down and up delays, smoothing time delays, and many other thresholds. Typically auto brightness doesn't work so good in a car because the light levels at the center console areas often "disagree" with what you see. But I'd imagine you could set up a curve and response delay times and thresholds that would work pretty good.

I don't have anything to do with the app. I just use it and thought you might be interested. It also has some support for Tasker (as an IAP) but I never tried that. I use Llama for all my automation, not Tasker.
Old 10-27-2014, 12:29 PM
  #4  
So not a sociopath
iTrader: (1)
 
CrazyEights's Avatar
 
Join Date: Apr 2014
Posts: 221
Received 59 Likes on 37 Posts
Is the brightness sensor blocked?

If not Lux auto brightness is great for doing what you want without the complication, but that's a great writeup regardless.
Old 10-27-2014, 04:47 PM
  #5  
Burning Brakes
Thread Starter
iTrader: (3)
 
mzilvar's Avatar
 
Join Date: Jan 2012
Posts: 940
Received 214 Likes on 152 Posts
I'm pretty sure my light sensor is next to the camera if I'm not mistaken both of which are covered by the plastic bezel in my car so it shouldn't pick up much if anything.

That's why I'm using manual brightness, I enjoy messing with this a bit anyhow and it has the added feature that the time is adjusted automatically throughout the year since it's pulling it from the web.

If I wasn't selling my car soon I'd try messing with the script to get it to write a month or year at a time of sunrise/sunset times to the calendar so it doesn't have to pull it from the web every day, only time that would be off then is if you crossed time zones though.
Old 10-27-2014, 07:21 PM
  #6  
3rd Gear
 
NoRice91's Avatar
 
Join Date: Oct 2014
Posts: 3
Likes: 0
Received 0 Likes on 0 Posts
Nice looks good!
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
rockyboy
2G RDX (2013-2018)
170
12-06-2022 02:29 PM
miner
3G RLX (2013+)
36
01-11-2016 04:17 PM
johnalfa
Car Parts for Sale
16
10-31-2015 12:55 PM
braveheart
Car Parts for Sale
0
09-07-2015 08:12 AM



Quick Reply: Android Set Brightness & Settings by Sunrise/Sunset GPS data



All times are GMT -5. The time now is 03:54 PM.