Valid syntax for new command_line switch but not work

Hello all,
after learned that the syntax for command_line switch was changed, I adapted my YAML configuration to be compilant with new specs.

The new configuration passes the test brilliantly, but after a restart (even a reboot) I can’t find all my switches via the graphical interface.

I searched from DevTools > Statuses > switch. also, but nothing.

  • I’ve tried removing the unique_id (because i’d implemented during config changes).
  • I’ve tried to move switches configuration in a dedicated file.
  • I’ve tried to totally change the name of the entity (because HA inheritance from it).
    …but I still to not found my switches in UI.

I paste a item of my switches for example purpose.

configuration.yaml:

command_line: !include command_line.yaml

command_line.yaml:

- switch:
    name: Scala sotto
    unique_id: 8f774fb4-1194-11ee-b769-eb8c0eb80a9c
    command_on: "/usr/bin/curl -X GET 'http://192.168.1.252/user/action.cgi?type=light&num1=1'"
    command_off: "/usr/bin/curl -X GET 'http://192.168.1.252/user/action.cgi?type=light&num0=1'"
    command_state: "/usr/bin/curl -X GET http://192.168.1.252/user/icon_desc.json"
    value_template: '{{ value_json["status"][1] == 1 }}'

- switch:
    name: "Neon sotto"
    unique_id: a7d1b6f8-1199-11ee-a309-77dd65738d50
    command_on: "/usr/bin/curl -X GET 'http://192.168.1.252/user/action.cgi?type=light&num1=2'"
    command_off: "/usr/bin/curl -X GET 'http://192.168.1.252/user/action.cgi?type=light&num0=2'"
    command_state: "/usr/bin/curl -X GET http://192.168.1.252/user/icon_desc.json"
    value_template: '{{ value_json["status"][2] == 1 }}'

Someone know why I cannot found my command-line switches devices?
Regards,

Daniele

command_line: !include command_line.yaml:
                                        ^
                                        |
                             Remove this colon

Hello, sorry about my mistake, in real it’s only a forum publication error. I’ve edited my previous post.
Thanks btw!

Check the Log for any errors related to Command Line.

Nothing of relevant in logs, telegram token problems, automation that not find switch or old integration not working anymore…

Update "None" caused error: "Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"
23:34:02 – (ERRORE) Telegram bot - il messaggio si è verificato per la prima volta alle 19:00:46 e compare 513 volte
Error while getting Updates: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
23:34:02 – (ERRORE) /usr/local/lib/python3.11/site-packages/telegram/ext/updater.py - il messaggio si è verificato per la prima volta alle 19:00:46 e compare 513 volte
Unable to find referenced entities switch.notturne_viale, switch.scala_sopra or it is/they are currently not available
21:14:49 – (AVVISO) helpers/service.py
TemplateError('TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'') while processing template 'Template<template=({{ state_attr('sensor.power_per_minute', 'total') / (1000 * 60) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.realtime_power_enel'
19:00:25 – (ERRORE) helpers/template_entity.py
Error while processing template: Template<template=({{ state_attr('sensor.power_per_minute', 'total') / (1000 * 60) }}) renders=2>
19:00:25 – (ERRORE) helpers/template.py
Error in 'Lavatrice ON' trigger: In 'numeric_state' condition: no entity specified
19:00:25 – (AVVISO) Home Assistant Core Integration - il messaggio si è verificato per la prima volta alle 19:00:24 e compare 3 volte
Failed to generate automation from blueprint: Failed to load blueprint: Unable to find vorion/create-automated-backups-every-day.yaml
19:00:24 – (ERRORE) Automazione - il messaggio si è verificato per la prima volta alle 19:00:19 e compare 3 volte

Tomorrow I fix all problems found in logs and then I retry to search my lost switches :slight_smile:

Ok fixing every problem found in log solved my issue.
I still not understand why… because no-one error was directly related with my issue, by the way thanks at all and happy HA!

1 Like