Help State Switch

Hi all, very newbie with HA,
Trying to automate some switches when it’s manually turn off, code in

  configuration.yalm
  sensor:- platform: command_line
  name: candeiro_sala_sensor
  command: "curl http://192.168.0.50:10050/json?tasknr=1"
  value_template: '{{value_json.liga}}'
  scan_interval: 60

switches.yalm
    - platform: template
      switches:
        candsala_templated:
          value_template: "{{ is_state('binary_sensor.candeiro_sala_sensor', '1.0') }}"
          turn_on:
            service: switch.turn_on
            data:
              entity_id: switch.candeiro_sala
          turn_off:
            service: switch.turn_off
            data:
              entity_id: switch.candeiro_sala 

but the state never change, sensor display the correct value 1.0.

Then you should first read the blue box on top and edit your post, so we can read the code.

One thing i can say, your sensor in the value_template of the switch should be sensor.candeiro_sala_sensor because you configured no binary_sensor.

With your answer, HA created the candsala_templated switch and it works as intended, but what I want to do is that the entity_id: switch.candeiro_sala changes the state.

PS: code corrected… :slight_smile: