Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 102998

How to make Sensor show minutes or hours instead of 0.52 hours = 30 minutes

$
0
0

Hello,

Have a sensor that takes attribute of my thermostat to tell me if its on or off, then have a sensor created to tell me it in time being on state.

it currently shows 0.5 hours which is 30 minutes, bit confusing to me to quickly gather, i’d prefer either minutes or hours and minute.

how would I do this, preferable both options as might depend, ie 120 minutes or 1 Hour 20 minutes
either help with code or guidance to which HA docs this would be, i’m virgin to templating so not great as grasping yet.

# Hvac Activiy - picks up when its on
  - platform: template
    sensors:
      hvac_activity:
        friendly_name: 'HVAC Activity'
        value_template: '{{ state_attr("climate.wiser_thermostat", "hvac_action") }}'


# Thermostat Day - Records it in days
  - platform: history_stats
    name: Thermostat Heating Today
    entity_id: sensor.hvac_activity
    state: 'heating'
    type: time
    start: "{{ now().replace(hour=0, minute=0, second=0) }}"
    end: "{{ now() }}"

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 102998

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>