#```

1 messages · Page 1 of 1 (latest)

tawny mason
#

tried in devtools --> ```
template:

  • sensor:
    • name: MP off-peak cost
      unit_of_measurement: 'Pkr'
      device_class: monetary
      unique_id: 'MP_offpeak_cost'
      state: "5.69"
      availability: >
      True
radiant sundial
#

Okay, the templates work, but that won't check for valid YAML

tawny mason
#

valid

#

MP off-peak cost
29 seconds ago
PKR 5.69

#

need help with a automation too

tawny mason
#

what I am doing wrong in this template ```

  • sensor:
    • name: Total energy cost per quarter
      unit_of_measurement: 'Pkr'
      device_class: monetary
      unique_id: 'Quarter_energy_cost'
      state: "{{ (states('sensor.lesco_quater_energy_offpeak') | float * (states('sensor.tariff_price') ) | round(2) }}"
      availability: >
      {{ states('sensor.lesco_quater_energy_offpeak') | is_number }}
#

misses a a ) after float

radiant sundial
#

You need to cast states('sensor.tariff_price') to a float