Help for binary sensor template

Hello guys,
I wanted to make these binary sensors to make my washing machine smart. Use of shelly plug s with power monitor. The problem is that it doesn’t create entities. I checked the log and there are no errors. what did i do wrong?
here my pastebin: https://pastebin.com/WvF9MQ4r

- platform: template
  sensors:
    stufa_pellet:
      friendly_name: "Stato Stufa a Pellet"
      device_class: power
      delay_on:
        seconds: 30
      delay_off:
        minutes: 5
      value_template: "{{ states('sensor.shellyplug_s_9dcb1c_power')|float > 10 }}"
    lavatrice:
      friendly_name: "Stato Lavatrice"
      device_class: power
      value_template: "{{ states('sensor.lavatrice_power')|int > 0 }}"
      delay_on:
        seconds: 30
      delay_off:
        minutes: 5
    riscaldamento_lavatrice: 
      value_template: "{{ states('sensor.lavatrice_power')|float > 1500 }}"
      delay_on:
        minutes: 2
      delay_off:
        minutes: 2
    lavaggio_lavatrice:      
      value_template: "{{ states('sensor.lavatrice_power')|int < 1500 and states('sensor.lavatrice_power')|int > 400 }}"
      delay_on:
        minutes: 2
      delay_off:
        minutes: 2
    risciacquo_lavatrice:
      value_template: "{{ states('sensor.lavatrice_power')|int < 400 and states('sensor.lavatrice_power')|int > 0 }}"
      delay_on:
        minutes: 2
      delay_off:
        minutes: 2
        

Code looks fine, some of the templates can be simplified but not by much. i.e. this:

"{{ states('sensor.lavatrice_power')|int < 1500 and states('sensor.lavatrice_power')|int > 400 }}"

can be simplified to

"{{ 400 < states('sensor.lavatrice_power')|int < 1500 }}"

but that’s not your problem.


Are you including the file in your configuration.yaml?

Are you reloading templates after you add these?

1 Like

yes i mapped wity include

I just restart only hass

thank you for reply