ha-lcars icon indicating copy to clipboard operation
ha-lcars copied to clipboard

Current Stardate

Open z3r0l1nk opened this issue 1 year ago • 4 comments

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 ?

z3r0l1nk avatar May 04 '23 06:05 z3r0l1nk

@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. ;-)

askpatrickw avatar May 04 '23 19:05 askpatrickw

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 avatar Oct 06 '23 22:10 gridlockjoe

Here's how it looks on my dash:

image

gridlockjoe avatar Oct 06 '23 22:10 gridlockjoe

@gridlockjoe, very nice dash.

z3r0l1nk avatar Nov 09 '23 09:11 z3r0l1nk