Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current Stardate #61

Open
z3r0l1nk opened this issue May 4, 2023 · 4 comments
Open

Current Stardate #61

z3r0l1nk opened this issue May 4, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@z3r0l1nk
Copy link

z3r0l1nk commented May 4, 2023

Hi,
If we use LCARS... let's go full startrek mode then :)
Me and a friend have created a small python script that will show the current stardate, more information on my github repo below.
https://github.com/z3r0l1nk/StarDate
What do you think @th3jesta ?

@askpatrickw
Copy link

@z3r0l1nk the actual link in your description is not the displayed text.

[https://github.com/z3r0l1nk/StarDate](https://github.com/th3jesta/ha-lcars/issues/url)

https://github.com/z3r0l1nk/StarDate is enough. Don't need to do the markdown. ;-)

@th3jesta th3jesta added the enhancement New feature or request label May 30, 2023
@gridlockjoe
Copy link

I have set up the following templates for calculating stardates:

- trigger:
    - platform: time_pattern
      seconds: "/1" # Every 2 seconds
  sensor:
    - name: stardate
      icon: mdi:rocket-launch-outline
      state: >
        {% set uu = as_timestamp(utcnow()) %}
        {% set doty = states('sensor.daysintheyear')|float %}
        {{ (1000 * ((uu/86400/doty) + 25)) + ((uu/86400) % 1) }}
      attributes:
        last_updated: "{{ states('sensor.time') }}"
- sensor:
    - name: DaysInTheYear
      state: "{{strptime('12/31/'+((states('sensor.date')|as_datetime).year|string), '%m/%d/%Y').timetuple().tm_yday|float}}"

@gridlockjoe
Copy link

Here's how it looks on my dash:

image

@z3r0l1nk
Copy link
Author

z3r0l1nk commented Nov 9, 2023

@gridlockjoe, very nice dash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants