History stats : decimal to HH:MM and electric cost estimation

I was wondering if it was possible to convert the data from a history stats to HH:MM instead of using decimal ?

I also had the idea to have a (very rough) estimation of the electric consumption/cost of the history stats sensors ?

e.g device_watts * hours_from_sensor / 1000 * unit price (I might be wrong in my math :thinking:)

  - platform: history_stats
    name: "bathroom downstaire"
    entity_id: light.hue_white_lamp_1
    state: "on"
    type: time
    start: "{{ now().replace(hour=0, minute=0, second=0) }}"
    end: "{{ now() }}"         
  - platform: history_stats
    name: "Living Room TV"
    entity_id: media_player.smarttv_4k
    state: "on"
    type: time
    start: "{{ now().replace(hour=0, minute=0, second=0) }}"
    end: "{{ now() }}"   

UPDATE: for the decimal to HH:MM, I just saw this (didn’t try yet)