th3jesta / ha-lcars

LCARS theme for Home Assistant
MIT License
286 stars 22 forks source link

Current Stardate #61

Open z3r0l1nk opened 1 year ago

z3r0l1nk commented 1 year ago

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 commented 1 year ago

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

gridlockjoe commented 1 year ago

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 commented 1 year ago

Here's how it looks on my dash:

image

z3r0l1nk commented 12 months ago

@gridlockjoe, very nice dash.