Summer Time and Sunrise/Sunset

Before British Summer Time started a couple of days ago, I had a Rule working to display Sunrise and Sunset times on a dashboard. In brief:

  • Define global Time variable "Sunrise"
  • Once a day, set its value as "Sunrise time"
  • Using a Connector, create a "Sunrise" device and display its value in a Time variable tile
  • Similarly for sunset
  • I got a nice display, such as "06:48"

This is now broken, with the tiles displaying "invalid date". If I change the tile type to String variable tile, then I get a display such as "Mon Mar 30 06:48:00 BST 2020".

How can I get rid of all the extra text and get back to "06:48"? So far as I can see, the variable has to be a time variable in the first place in order to assign the "Sunrise time" value to it. If it were a string I could do some manipulation on it - but how to get Sunrise time into a string format?

What time zone are you using, I have mine as gmt but it's still not updating, it's still an hour out

I have my time zone set as Europe/London. Time itself is fine, and sunrise/sunset times are working correctly in rules which use them.

Changed it over to that, can't help but think were not in Europe any more!

I'm confused why so many options, there is gmt, gmt 0, GB, Europe/London

I see issue and I'm in EDT US. I store sunrise/sunset around midnight. Seemed to have started when HE changed the maintenance schedule.

Well the UK is still within the continent of Europe, even although the political relationship to other European countries has changed! I suppose the "GMT" option might be useful in some circumstances - for example I used to have an electricity tariff which was based on set (GMT) times which didn't change when the clocks changed, so it might be useful to be able to mirror that. I don't see why "GB" and "Europe/London" both exist, but maybe it's just to help in the search!

Not seeing anything in my log about the time change, although the time change itself has worked correctly (albeit with the slightly curious side-effect that all historical log entries have been re-timed correspondingly).

The Actions I'm running "Set SunRise to sunrise time" are exactly the same as yours. Glad it's not just me, and hopefully someone will come along and work out how to fix this!

What time does your rule run to change those variables? Where are you pulling sunrise time from? A copy of your rule would be very helpful.

My rule and log are earlier in thread

You're neither the original poster with the question or the person I was replying to. But thanks.

Basically the same as starcom:

Sunrise defined as a global time variable, and connector made.
Running every minute at the moment for testing purposes.

Bit of dashboard:


Used to display simply "06:48" etc.

I would stop that...you can always run the rule manually for testing by hitting "Run Rule".

Did you make any changes at all to the location settings page in your hub within the past 24 hours? Timezone? Locaiton? Time format? Anything like that.

No, no changes made by me. I suspect it's the sudden appearance of the "BST" in the response that's the problem. So far as I know, I can only access sunrise/sunset time as a "time". If I could access it as a string, or convert it to a string variable, then I could manipulate the string to get the result I want.

Did you change the tile type back? You said you changed it to String Variable tile.

No, with the original tile type of "time" it just says "invalid date" as per my original post - having the tiles as type string at least lets me get some meaningful data on display.

What does the date/time look like in the edit device page for the connector?

Did you manually change the connector data? Or the type? The date/time in the connection should look like this:
2020-02-19T11:00:00.000-0500

If that is what is not displayed, then that is the problem. The format in the connector is very important and you should not manually change the string in the connector or Rule Machine will not work with the variable any longer either.

The last number is the offset from GMT (UTZ).

Isn't the connector type always variable ?
Anyhow, I have my rule running starting at 11:00 PM till 1:30 AM
image
Notice it's only sunrise that has an issue, during certain time range, and recovers...
Note: examining GV in RM, shows bad time, when trying to set value, the input field populates w correct value w/o any input...