Am I Being Stupid With Sunset Times?

206 views
Skip to first unread message

My-kl

unread,
Nov 23, 2015, 5:48:28 AM11/23/15
to Tasker
I've set a task to get the sunrise/sunset times each morning but it's not working. When I tested it today it got the times for 11th Nov the first time, then today the second time, then 14th Nov, and finally the 9th Nov! I don't know if it's something I've done wrong or what, but with those random dates it seems unlikely. Should I use a different source? If so, what?

Here's the code from the .xml. I hope this is the best way of showing you as I couldn't find it in the .txt file.

   <Task sr="task29">
        <cdate>1447624384331</cdate>
        <edate>1448266202171</edate>
        <id>29</id>
        <nme>Check Sun Times</nme>
        <pri>100</pri>
        <Action sr="act0" ve="7">
            <code>425</code>
            <Int sr="arg0" val="1"/>
        </Action>
        <Action sr="act1" ve="7">
            <code>30</code>
            <Int sr="arg0" val="0"/>
            <Int sr="arg1" val="10"/>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
        </Action>
        <Action sr="act10" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%HTTPD21</Str>
            <Str sr="arg1" ve="3">am</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act11" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%SUNRISERAW</Str>
            <Str sr="arg1" ve="3">%HTTPD211</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act12" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%HTTPD22</Str>
            <Str sr="arg1" ve="3">pm</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act13" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%SUNSETRAW</Str>
            <Str sr="arg1" ve="3">%HTTPD221</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act14" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%SUNRISERAW</Str>
            <Str sr="arg1" ve="3">:</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act15" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%SUNRISE</Str>
            <Str sr="arg1" ve="3">%SUNRISERAW1.%SUNRISERAW2</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act16" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%SUNSETRAW</Str>
            <Str sr="arg1" ve="3">:</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act17" ve="7">
            <code>888</code>
            <Str sr="arg0" ve="3">%SUNSETRAW1</Str>
            <Int sr="arg1" val="12"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act18" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%SUNSET</Str>
            <Str sr="arg1" ve="3">%SUNSETRAW1.%SUNSETRAW2</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act19" ve="7">
            <code>130</code>
            <Str sr="arg0" ve="3">Update Weather</Str>
            <Int sr="arg1">
                <var>%priority</var>
            </Int>
            <Str sr="arg2" ve="3"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Int sr="arg5" val="0"/>
        </Action>
        <Action sr="act2" ve="7">
            <code>902</code>
            <Int sr="arg0" val="0"/>
            <Int sr="arg1" val="100"/>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act20" ve="7">
            <code>425</code>
            <Int sr="arg0" val="0"/>
        </Action>
        <Action sr="act3" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%LOC</Str>
            <Str sr="arg1" ve="3">,</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act4" ve="7">
            <code>118</code>
            <Str sr="arg0" ve="3">gws2.maps.yahoo.com/findlocation?pf=1&amp;locale=en_US&amp;flags=&amp;offset=15&amp;gflags=R&amp;q=%LOC1+%LOC2&amp;start=0&amp;count=100</Str>
            <Str sr="arg1" ve="3"/>
            <Str sr="arg2" ve="3"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Int sr="arg5" val="10"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Int sr="arg8" val="0"/>
        </Action>
        <Action sr="act5" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%HTTPD</Str>
            <Str sr="arg1" ve="3">&lt;/woeid&gt;</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act6" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%HTTPD1</Str>
            <Str sr="arg1" ve="3">&lt;woeid&gt;</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act7" ve="7">
            <code>118</code>
            <Str sr="arg0" ve="3">weather.yahooapis.com/forecastrss?w=%HTTPD12</Str>
            <Str sr="arg1" ve="3"/>
            <Str sr="arg2" ve="3"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Int sr="arg5" val="10"/>
            <Str sr="arg6" ve="3">text/xml</Str>
            <Str sr="arg7" ve="3"/>
            <Int sr="arg8" val="0"/>
        </Action>
        <Action sr="act8" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%HTTPD</Str>
            <Str sr="arg1" ve="3">sunrise="</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act9" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%HTTPD2</Str>
            <Str sr="arg1" ve="3">sunset="</Str>
            <Int sr="arg2" val="0"/>
        </Action>
    </Task>

Rich D

unread,
Nov 23, 2015, 5:53:51 AM11/23/15
to Tasker Google Groups Post

> Here's the code from the .xml. I hope this is the best way of showing you as I couldn't find it in the .txt file.

To post your profile or task here...  Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)

Any linked tasks will be exported with the profile they are linked to..

To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name.  Tasker will list your profile with the context name if you have not given it one).

John Doe

unread,
Nov 23, 2015, 6:44:45 AM11/23/15
to Tasker
You could try with MeteoTask. It's simpler to use. You have the value in %mtsunset and %sunrise. You can covert them from seconds to date using the Tasker built-in convert operations.

My-kl

unread,
Nov 23, 2015, 1:19:26 PM11/23/15
to Tasker
Rich D: Thanks, I'm sure I've posted code here before, I don't remember doing it that way.

John Doe: I didn't want to download another app but MeteoTask is faster than what I did. I'll see if it works over the next few days.

My-kl

unread,
Nov 24, 2015, 7:04:50 AM11/24/15
to Tasker
Here's the next problem with MeteoTask: I don't have much control over when it updates; it gives intervals in multiples of an hour instead of a real time. I don't have wifi/data connected all the time as it drains the battery on SlimRoms SlimKat. Wifi activates hourly to get a weather update then switches off. Short of reinstalling MeteoTask at exactly 0 minutes past the hour I don't know how to sync the two. I've also got the Twilight plugin but I have no idea when that updates either.

John Doe

unread,
Nov 24, 2015, 7:25:04 AM11/24/15
to Tasker
MeteoTask uses prefetching to get information, so you can use even 12 hour as update. When possible and the timer is expired it request enough information to cover severla days. Of course, the information must be refreshed daily to be accurate but it doesn't need to do a strict polling. In addition, if the timer is expired and there is no connectiviy it goes to sleep until the network is available, without keeping your CPU on.

My-kl

unread,
Nov 24, 2015, 8:57:09 AM11/24/15
to Tasker
So you're saying MeteoTask will get the information 'whenever it can' in my case?

John Doe

unread,
Nov 24, 2015, 11:33:14 AM11/24/15
to Tasker

Yep.

My-kl

unread,
Mar 23, 2016, 6:54:19 AM3/23/16
to Tasker
Thanks to your help I've been using MeteoTask and Tasker to get the sunrise/set times successfully since the end of November. At some time earlier this month it stopped. Tasker started saying something like 'unable to convert %mtsunrise'. Does anyone know why this has stopped working or could it be just my phone being sh!t? It is time for an upgrade.

John Doe

unread,
Mar 23, 2016, 7:02:43 AM3/23/16
to tas...@googlegroups.com

You need to create the Tasker action again with the latest MeteoTask version.

Regards.

Il 23 mar 2016 11:54 AM, "My-kl" <my...@hotmail.com> ha scritto:
Thanks to your help I've been using MeteoTask and Tasker to get the sunrise/set times successfully since the end of November. At some time earlier this month it stopped. Tasker started saying something like 'unable to convert %mtsunrise'. Does anyone know why this has stopped working or could it be just my phone being sh!t? It is time for an upgrade.

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/7-YRCfMVcv0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

My-kl

unread,
Mar 23, 2016, 7:14:11 PM3/23/16
to Tasker
Thanks for replying!
1) Do I actually have to rebuild the tasker action from scratch?
2) How often is this going to happen or is it just an update glitch?

John Doe

unread,
Mar 24, 2016, 1:27:39 AM3/24/16
to Tasker
You need to create again just the actions with MeteoTask not the whole task. Yes, it's just a problem of latest version, sorry.

My-kl

unread,
Mar 24, 2016, 4:06:09 PM3/24/16
to Tasker
Thanks! Why are you apologising? Is it your app?

My-kl

unread,
Mar 24, 2016, 7:39:34 PM3/24/16
to Tasker
MeteoTask seems to be draining a lot of battery juice. It's been doing that for a while now, and installing the latest version hasn't fixed the issue.
Reply all
Reply to author
Forward
0 new messages