Code Monkey home page Code Monkey logo

Comments (3)

ollo69 avatar ollo69 commented on June 6, 2024 1

You should use platform template for this, or I will add an infinite numbers of attributes.
Here an example (assuming that the name of your washer is "washer"):

sensor:
  - platform: template
    
    sensors:

      washer_remain_time_in_minutes:
        friendly_name: Remaining Minutes
        value_template: >-
          {% if is_state('sensor.washer', 'on') %}
          {{(state_attr('sensor.washer', 'remain_time').split(':')[0]|int*60) + 
            (state_attr('sensor.washer', 'remain_time').split(':')[1]|int)
           }}
          {%endif%}

from ha-smartthinq-sensors.

dieneuser avatar dieneuser commented on June 6, 2024

Thank you for the solution. This code is how I did it for the automation script. The solution with the sensor is perfect and I can use the locelace circle card.

from ha-smartthinq-sensors.

sunsgs avatar sunsgs commented on June 6, 2024

Hi @dieneuser can you please share how you used it into automations?

from ha-smartthinq-sensors.

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.