[Warframe] A cetus day/night sensor

Also playing Warframe and want this juicy Arkanas from the Eidolon’s, but always missing when its getting night? Not anymore! Get your lights dimmer when the night is coming with a state trigger!
Thanks to the guys from Warframe Hub we can use the fanbased worlsdsatus API. Much appriciated btw!
In my opinion it is’nt that prittey. But it works ¯_(ツ)_/¯

image

sensor:

  - platform: rest
    name: cetus_string
    json_attributes:
      - cetusCycle
    value_template: '{{ value_json.cetusCycle.shortString }}'
    resource: https://ws.warframestat.us/pc

  - platform: template
    sensors:
      cetus_is_day:
        value_template: '{{ states.sensor.cetus_string.attributes.cetusCycle.isDay }}'
  - platform: template
    sensors:
      cetus_time_left:
        value_template: "{{ states.sensor.cetus_string.attributes.cetusCycle.timeLeft.split(' ')[0].split('m')[0]|int }}"

  - platform: template
    sensors:
      cetus_state:
        friendly_name: "Cetus State"
        value_template: >-
          {% if is_state("sensor.cetus_is_day", "False") and ((states("sensor.cetus_time_left")|int) < 10) and ((states("sensor.cetus_time_left")|int) != 0) %}
            getting morning
          {% elif is_state("sensor.cetus_is_day", "True") and ((states("sensor.cetus_time_left")|int) < 10) and ((states("sensor.cetus_time_left")|int) != 0) %}
            getting night
          {% elif is_state("sensor.cetus_is_day", "False") %}
            night
          {% elif is_state("sensor.cetus_is_day", "True") %}
            day
          {% endif %}

I had my troubles with cetus_time_left due to my split but with ((states("sensor.cetus_time_left")|int) != 0) I’m getting somewhere.

and also a fast and dirty loflace card for the eye

type: picture-elements
image: /local/jpg/warframe/wf.png
elements:
  - type: image
    entity: sensor.cetus_state
    tap_action:
      action: null
    image: /local/jpg/warframe/cetus_tag.png
    state_image:
      day: /local/jpg/warframe/cetus_tag.png
      getting morning: /local/jpg/warframe/cetus_morgen.png
      getting night: /local/jpg/warframe/cetus_abend.png
      night: /local/jpg/warframe/cetus_nacht.png
    style:
      top: 50%
      left: 50%
      width: 102%
  - type: state-label
    entity: sensor.cetus_string
    style:
      top: 94%
      left: 85%
      text-align: right
      font-size: 16px
      color: white
      font-family: Helvetica

Some screenshots for the lovelace card:
cetus_abend cetus_morgen cetus_nacht cetus_tag wf

Would love to make a real sensor out of it… But I cant code, so wont. But would :rofl:

1 Like

Did you manage to download data other than east or west on cetus like in this phone app? I mean, for example, the progress of work in the workshop or e.g. time left until the rooms in the Dojo are built or possibly master rank level e.t.c ?

Glad you like it.
yes and no. It’s really not too hard to get other data out you are interested in, as long as it is from this public fanbased service. You can browse stuff here.
This only utilizes the public world status.

Master rank and all are account bound. I bet you could intercept the login flow and get the data out, but my guess would be then that this violates the TOS.

How can I

considering that I have even less knowledge than you in programming because I can’t even write simple functions. when I opened this link, a wall of text appears to me and I do not know how to read to be able to download other data, so could you help me how to decode it?

I’m not a programmer :rofl:
when using firefox for example the json string will get a lot prettyer.

Otherwise, use your HomeAssistant instance to check it out. a command like
curl -sL https://ws.warframestat.us/pc | jq spits out everything printed in a readable fashion too.
curl and jq should come preinstalled.

From there you can start testing your filtering just like in HA.
When you’re interested in the Cambion cycle run
curl -sl https://ws.warframestat.us/pc | jq '.cambionCycle'
or the Razorback progress.
curl -sl https://ws.warframestat.us/pc | jq '.constructionProgress.razorbackProgress'

from there I would just add the data I want in the sensor, to the json_attribute and filter the rest out just like in the template above.

1 Like

I didn’t have the jp package so I had to install it apt install jq and after typing

It turned out that my console has a limit on displaying the number of characters, so after a moment’s thought I came up with the idea to send all the content displayed by curl to a file using curl -sL https://ws.warframestat.us/pc | jq > warframe.txt

TLDR: Download clocks zip and extract. Download config-template-card in HACS. Copy and Paste code into a card. change image locations. Enjoy

ws.warframe.us/pc wasn’t working for me. idk if it is old or just me but for anyone having issues, i think the new page is https://api.warframestat.us/platform just change the word platform with pc,ps4,xb1,swi one of these

Update:
Made the cycle spin around the planet in time with the time remaining like the app.

ERRORS:
Some of the code didn’t work. It is due to the site formatting the time when cetus would be 1h…(Fixed)
When the site times out and gives a negative sometimes will cause the image to not align…(might fix this later)

type: custom:config-template-card
variables:
  worldImage: '''/local/Icons/DayNightCyclerOverlay.png'''
  cycleImage: '''/local/Icons/DayNightCyclerSkyArt.png'''
  overlayImage: '''/local/Icons/DeimosDayNightCyclerOverlay.png'''
  time: states['sensor.cetus_time_left'].state
  t1: '''translate(+.4%,-59%) rotate('''
  t3: '''turn)'''
entities:
  - sensor.cetus_time_left
card:
  type: picture-elements
  elements:
    - type: conditional
      conditions:
        - entity: sensor.cetus_is_day
          state: 'False'
      elements:
        - type: image
          image: ${cycleImage}
          style:
            transform: ${t1 + (parseFloat(time)/100 +.25) + t3}
    - type: conditional
      conditions:
        - entity: sensor.cetus_is_day
          state: 'True'
      elements:
        - type: image
          image: ${cycleImage}
          style:
            transform: ${t1 + (parseFloat(time)/200 -.25) + t3}
    - type: image
      image: ${overlayImage}
      style:
        width: 100%
        height: 99%
        transform: translate(+0%,-100%) scale(1,1)
    - type: image
      image: ${overlayImage}
      style:
        width: 100%
        height: 99%
        transform: translate(+0%,-100%) scale(1,1)
    - type: image
      image: ${overlayImage}
      style:
        width: 100%
        height: 99%
        transform: translate(+0%,-100%) scale(1,1)
    - type: image
      image: ${overlayImage}
      style:
        width: 100%
        height: 99%
        transform: translate(+0%,-100%) scale(1,1)
    - type: image
      image: ${overlayImage}
      style:
        width: 100%
        height: 99%
        transform: translate(+0%,-100%) scale(1,1)
    - type: image
      image: ${overlayImage}
      style:
        width: 100%
        height: 99%
        transform: translate(+0%,-100%) scale(1,1)
    - type: image
      image: ${overlayImage}
      style:
        width: 100%
        height: 99%
        transform: translate(+0%,-100%) scale(1,1)
    - type: state-label
      entity: sensor.cetus_string
      style:
        top: 92%
        left: 50%
        color: white
        font-family: Product Sans
        font-size: 25px
  image: ${worldImage}

paste this into configuration file

sensor:
  - platform: rest
    name: cetus_string
    json_attributes:
      - cetusCycle
    value_template: "{{ value_json.cetusCycle.shortString }}"
    resource: https://api.warframestat.us/pc

  - platform: template
    sensors:
      cetus_is_day:
        value_template: "{{ states.sensor.cetus_string.attributes.cetusCycle.isDay }}"

  - platform: template
    sensors:
      cetus_time_left:
        value_template: "{{ states.sensor.cetus_string.attributes.cetusCycle.timeLeft.split(' ')[1].split('m')[0] |int +60 if (states.sensor.cetus_string.attributes.cetusCycle.timeLeft.split(' ')[0].split('m')[0] == '1h') else states.sensor.cetus_string.attributes.cetusCycle.timeLeft.split(' ')[0].split('m')[0] |int }}"

  - platform: template
    sensors:
      cetus_state:
        friendly_name: "Cetus State"
        value_template: >-
          {% if is_state("sensor.cetus_is_day", "False") and ((states("sensor.cetus_time_left")|int) < 10) and ((states("sensor.cetus_time_left")|int) != 0) %}
            getting morning
          {% elif is_state("sensor.cetus_is_day", "True") and ((states("sensor.cetus_time_left")|int) < 10) and ((states("sensor.cetus_time_left")|int) != 0) %}
            getting night
          {% elif is_state("sensor.cetus_is_day", "False") %}
            night
          {% elif is_state("sensor.cetus_is_day", "True") %}
            day
          {% endif %}```

Ty to ShadowCat for these images

HACS config-template-card manual install (if you can’t do it automatically)

image