Code Monkey home page Code Monkey logo

Comments (4)

craibo avatar craibo commented on August 24, 2024

Hi @patfelst

The activity id has been added to the title sensor attributes. You can use a template to create the url for now until I get a chance to add the full url to the attributes

from ha_strava.

patfelst avatar patfelst commented on August 24, 2024

thanks, is it possible to make it clickable using something like this?

entities:
  - type: custom:template-entity-row
    icon: mdi:web
    state: "https://www.strava.com/activities/{{ state_attr('sensor.strava_0_0', 'activity_id') }}"

from ha_strava.

patfelst avatar patfelst commented on August 24, 2024

Thanks for adding activity_url attribute. I'm still struggling with how to display it on the front end so it's clickable. Do you have an example pls? I tried this, but it seems you can't template entities with a type of url:

title: Strava
type: entities
entities:
  - type: weblink
    url: '{{ state_attr('sensor.strava_0_0', 'activity_url') }}'

from ha_strava.

patfelst avatar patfelst commented on August 24, 2024

Never mind, the markdown card works
image

Activity 0 [{{ state_attr('sensor.strava_0_0', 'friendly_name').split(" |")[0] }}]({{ state_attr('sensor.strava_0_0', 'activity_url') }})
Activity 1 [{{ state_attr('sensor.strava_1_0', 'friendly_name').split(" |")[0] }}]({{ state_attr('sensor.strava_1_0', 'activity_url') }})
Activity 2 [{{ state_attr('sensor.strava_2_0', 'friendly_name').split(" |")[0] }}]({{ state_attr('sensor.strava_2_0', 'activity_url') }})

from ha_strava.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.