I have a rule, screenshot 1, that sets two hub variables, screenshot 2, to Sunrise and Sunset times.
I then display them on a dashboard, screenshot three. Although the variables are shown in a 12 hour format on the hub variable setting page, they are displayed in a 24 hour format on the dashboard. The dashboard option is set to show in 12 hour format, as seen by the current time display. Is this a bug, is there an option I am missing, or just the way it is?
Nothing to do with the possible bug, but wondering how can I do the same but with just the time. I can only set the hub variable as date/time and I only want the time. Thanks.
Edit: Guessing I might need to create a string variable and add something to the rule to remove the date then add that string variable to the dash?
If this could be twisted into a feature request, it would be nice if these could be made available for linking to a dashboard, whether it be under the current device / variable selections, or even additional options made available in the dashboard app settings page, allowing selection of these times plus potentially other hub details.... Removing the need for users to construct variable values. The formatting of the time could be a separate configuration item or potentially draw from other settings....
Yeah agreed. I saw this thread and thought that would be handy. With SharpTools I show the current time on my dashboard with a separate tile for day and date, another for external (measured) temperature. I just thought it would be handy to display the local sunrise and sunset times as well.
@thebearmay - is Sunrise Sunset available to be added into Hub Information Driver or does Hubitat not make it available?
It could be added. Looks like the native format is a date data type, probably milliseconds since January 1, 1970. Easy enough to make it a different format though, what format would be most convenient? (I could also make format a selectable option.)
Can you clarify all the content you'd like to see in your tile at once? You might be able to use a SharpTools Super Tile to mix and match the content you're looking for.
The clock elements in the Super Tile would pickup your system locale and display it in your regional time format or you could customize it as you see fit:
For sunrise/sunset, if you already have a driver that has that information, you could pull it from there. Otherwise there are sunset/sunrise APIs and I could guide you through that if needed.
Thanks for looking at this. I've given that a try. I can see the additional time format option in the preference pane and I can select the 'sunset' and 'sunrise' attributes for use in my tile but nothing is populated. In the logs I get an error:
Yeah my plan is probably to use a Super Tile rather than individual tiles. It looks as though the 'Hub Information Driver' that @thebearmay created will be able to grab the sunrise and sunset times for my location from the hub once updated. I'll then add those to a Super Tile via the 'Hub Information Driver' virtual device, selecting the Hero attribute layout and 'sunrise' / 'sunset' as the primary attribute for the device. I've used this driver to put the 'Hub Free Memory' in a SharpTools tile already.
I'll need to wait until I get home this afternoon to see what the format is that is coming in and play with it a little. Should be a 5 minute fix once I get home though.