Advice for value_template

Hello, I am French and I am a newbie, I will try to get an answer on this forum because on the French hacf forum, no one has been able to give me any information. Maybe I’ll have better luck here. I would like to have the two Jeedom and Home assistant systems coexist and
I would like to retrieve the status of a zwave connected socket under jeedom in home assistant. For this I use jMQTT to send the status of my socket. MQTT Explorer shows me a 1 or a 0 depending on the state of the socket when I activate it under jeedom. Under home assistant, I create a mqtt sensor in this form:

mqtt: 
 sensor:
    - name: "Etat noeud25" 
      state_topic: "etat/noeud25"
      unique_id: etat.noeud25      

the sensor updates well in home assistant. I created a switch under home assistant which allows me with curl to control my socket under jeedom. As long as I stay under home assistant, the switch reacts normally and changes state according to my clicks.
The problem is when I activate the socket from jeedom and turn it on for example, mqtt sends the value 1 but the switch under home assistant does not change while my sensor.etat_noeud25 goes to 1.
This is how I declared the switch:

- platform: command_line
    switches:
      noeud25:
        value_template: "{{ is_state('sensor.etat_noeud25', '1') }}"
        command_on: /usr/bin/curl -X GET "https://IP/core/api/jeeApi.php?apikey=API&type=cmd&id=7120" #commande pour ouvrir
        command_off: /usr/bin/curl -X GET "https://IP/core/api/jeeApi.php?apikey=API&type=cmd&id=7121"      

I have the impression that it comes from the value_template but I am not familiar enough with yaml. Has anyone faced this issue before and is there a solution? Thanks in advance to anyone who can answer me.

What is the result of this in Developer Tools > Template?
Should look like
image

EDIT: missing } in the template

Thanks, no I get

TemplateSyntaxError: unexpected '}'

One } missing, my bad. Updated my post.

Sorry, I’ve changed the name. I get:

Type de résultat: string
"False"
Ce modèle écoute les événements de changement d'état suivants:

Entité: noeud25

String is not a Boolean. Thant could explain everything.

value_template string (optional)
If specified, command_state will ignore the result code of the command but the template evaluating to true will indicate the switch is on.

You can substitue

{{ states('sensor.noeud25') | int == 1 }}

Or put on 2 lines, to get rid of the double quotes

- platform: command_line
    switches:
      noeud25:
        value_template: >
          {{ is_state('sensor.etat_noeud25', '1') }}

Thanks.
I write

 - platform: command_line
    switches:
      noeud25:
        value_template: "{{ states('sensor.noeud25') | int == 1 }}"
        command_on: /usr/bin/curl -X GET "http://192.168.1.28/core/api/jeeApi.php?apikey=API&type=cmd&id=7120" 
        command_off: /usr/bin/curl -X GET "http://192.168.1.28/core/api/jeeApi.php?apikey=API&type=cmd&id=7121"
        unique_id: switch25

But it doesn’t work. I have tried to push 0 and 1 with MQTT Explorer.
No change

The second solution doesn’t work also.
The result for :

"{{ states('sensor.noeud25') | int == 1 }}"

is

Type de résultat: string
"True"
Ce modèle écoute les événements de changement d'état suivants:

Entité: sensor.noeud25

As you’re french speaking, I’ll not bother translating my printscreen.
But I’ll continue to write in english, for others that might land here :wink:

EDIT: I noticed the “”, it will convert the boolean to a string, remove them.
And in the switch, use the 2 lines format

If I remove quotes, I get an error

Configuration non valide !

Error loading /config/configuration.yaml: invalid key: "OrderedDict([("states('noeud25') | int == 1", None)])"
in "/config/switch.yaml", line 12, column 0

If I try “Modèle” with

{{ states('noeud25') | int -- 1 }} 

, I get this error

ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ states('noeud25') | int -- 1 }}' but no default was specified

change to this:

{{ states('sensor.noeud25') | int == 1 }} 

I think I’ve had issues with value_templates like that. Putting it on a separate line may work but you can also specify the true value in the template as well:

value_template: >
  {% if is_state('sensor.etat_noeud25', '1') %} 
    true 
  {% else %}
    false 
  {% endif %}

or I think this will work too:

value_template: >
  {{ true if is_state('sensor.etat_noeud25', '1') else false }}

It doesn’t work. I have change my approch and now it’s ok. Same beginning

mqtt:

  sensor:
    - name: "noeud25" 
      state_topic: "etat/noeud25"
      unique_id: noeud25

After rest_command

rest_command:
   on_noeud25:
     url: "http://192.168.1.28/core/api/jeeApi.php?apikey=API&type=cmd&id=7120"
   off_noeud25:
     url: "http://192.168.1.28/core/api/jeeApi.php?apikey=API&type=cmd&id=7121"

Then

switch:
  - platform: template
    switches:
      noeud25:
        unique_id: Noeud25
        value_template: "{{ is_state('sensor.noeud25', '1') }}"
        turn_on:
          service: rest_command.on_noeud25
        turn_off:
          service: rest_command.off_noeud25

All works fine. Thanks for help.