Binary_sensor whil not working automation

hello everyone I am new here and I am bad with English.
I also type this in a translator.
I started hassio and am a beginner
have a question who can help me with a piece of automation.yaml code.
I have a binary sensor with this code: below.
can someone help me for livingroom lux low lights on.
I can not get out
I’m busy for 14 days and do not get it. my sensor is named sensor.lux_daglight and emijn test switch has name light.test_switch

I do not get it automatically code lux low lights livingroom on

i have the BH1750 sensor

binary_sensor:

------------------------------------------------- -------------

  • platform: template
    sensors:
    low_lux:
    friendly_name: “Low LUX”
    value_template:> -
    {{states (‘sensor.lux_daglight’) | int <5}}
  • platform: template
    sensors:
    high_lux:
    friendly_name: “HighLUX”
    value_template:> -
    {{states (‘sensor.lux_daglight’) | int> 5000}}

------------------------------------------------- --------------

ferry tanks

Can you format your code? Check the blue bar on top of this page.
it’s very difficult otherwise to see what could be wrong.
Quick question though: when you go to Templates under Developers Tools and paste {{states (‘sensor.lux_daglight’) | int> 5000}}, what do you get?

You shouldn’t have more than 1 platform:template section. You have spaces after your method names before your parenthesis. I couldn’t tell if your spacing was off because of your formatting, but spacing is extremely important for yaml.

Your sensors should look like this:

 - platform: template
   sensors:
     low_lux:
       friendly_name: 'Low LUX'
       value_template: >
         {{ states('sensor.lux_daglight') | int < 5 }}
     high_lux:
       friendly_name: 'High LUX'
       value_template: >
         {{ states('sensor.lux_daglight') | int > 5000 }}