Command Line YAML configuration has moved error

Use packages for such a structure. :slight_smile: You can do everything you want, but if you dive deeper into packages, you might even try a totally different approach. Take a look at it:

1 Like

This doesnt address the people that use the -platform: telnet function.

I have this and this “new configuration change” breaks everything!!

switch:
   - platform: telnet
     switches:
         vxs1123_zpower:
             port: 23 
             command_on: "APP"
             command_off: "APF"

If I add the command_line the configuration becomes invalid.

command_line:
    switch:
      - platform: telnet
        switches:
            vxs1123_zpower:
                port: 23 
                command_on: "APP"
                command_off: "APF"

I think maybe the platform: telnet option was removed.

The Telnet integration still exists and its completely separate from the Command Line integration.

I think what I’m saying it that if I take your example from the Telnet instruction page above and do the following it fails.

# Example configuration.yaml entry
command_line:  
   switch:
     - platform: telnet
       switches:
         projector:
           resource: THE_IP_ADDRESS
           port: 4002
           command_on: "PWR ON"
           command_off: "PWR OFF"
           command_state: "PWR?"
           value_template: '{{ value == "PWR=01" }}'
           timeout: 0.9

So this tells me that something is maybe broken… or not being recognized when we try to use the command_line: option. When I take it away it works. When I add it the entire block fails.

command_line:
    - switch:
          - platform: telnet
            switches:
               vxs1123_zpower:
                   port: 23 
                   command_on: "APO"
                   command_off: "APF"
                   resource: 192.168.1.29
                   name: "Zone 2 Power"
                   timeout: 5

This fails with:

Invalid config for [command_line]: expected a dictionary for dictionary value @ data[‘command_line’][0][‘switch’]. Got [{‘platform’: ‘telnet’, ‘switches’: {‘vxs1123_z2power’: {‘resource’: ‘192.168.1.19’, ‘port’: 23, ‘command_on’: ‘APO’, ‘command_off’: ‘APF’, ‘name’: ‘Zone 2 Power’, ‘timeout’: 5}}}]. (See /config/configuration.yaml, line 28).

Im using Home Assistant Core 2023.8.2 and OS 10.4

Do I need to upgrade for the above syntax to become valid?

Why are you writing command_line over this? The Telnet integration is used by itself, not as a command line switch.

Setup the switch as switch, not as a command-line-switch. :slight_smile:

Obviously it fails; you’re combining the configuration of two different integrations.

The example I posted above never suggested to include the configuration of Telnet integration, or any other switch integration such as Template Switch or RESTful Switch, into the configuration of a Command Line Switch.

It’s not broken; it’s telling you what you are trying to do is invalid.

1 Like

I’m doing it because the of the following message I’m getting on my Home Assistant Dashboard and the suggestion to resolve it is to add the command_line option before the switch command.

The same message that other people on here are talking about.

This stops working in version 2023.12.0. Please address before upgrading.

Configuring Command Line switch using YAML has moved.

Consult the documentation to move your YAML configuration to integration key and restart Home Assistant to fix this issue.

Thats what I mean by something is broken…

The solution suggested here is to use the command_line option before the switch command to get rid of the following message.

This stops working in version 2023.12.0. Please address before upgrading.

Configuring Command Line switch using YAML has moved.

Consult the documentation to move your YAML configuration to integration key and restart Home Assistant to fix this issue.

If my syntax is working now and it will stop working after version 2023.12.0 than this upcoming change breaks my working configuration. If I’m incorrect and I should ignore the message than I’m cool with that. I’ll just upgrade and everything should keep working.

I’m assuming that this message is telling me …

“Hey buddy… You need to change something because your system will break after version 2023.12.0 if you don’t change something.”

I’m trying to figure what to change /or how it should be changed to keep my system from breaking - thats all.

Whatever it seems to read for you, that is not, what the message states. :slight_smile:

The message tells you, that you have configured a command_line switch anywhere, and that this configuration has changed. It doesn’t say anything about “writing this before that”. :wink: And it sure doesn’t tell you, that the telnet integration has to be changed in any way. :slight_smile:

What you have somewhere must be something like this:

switch:
  - platform: command_line

This will not work in the future. After 2023.12.x you’ll have to write it different:

command_line:
  - switch:
      name: ...

Nothing about telnet, as this is a different integration; command_line not equal to telnet. :slight_smile:

You’ve been arguing about this for a few posts, you are not correct in your assessment of the Error.

The error states:

Command line refers to this integration only.

If it were referring to the telnet integration, the error would say:

Your error does not say Telnet. Please stop focusing on Telnet. The message is only talking about Command Line switches.

You will keep your Telnet configuration unaltered and you’ll only update the command line switch.

Don’t add a Telnet configuration into a Command Line configuration.

@123 , is this the same for cover?

I have my garage door which is throwing the same error, what would be the correct syntax?

cover:
  - platform: template
    covers:
      garage_door:
        device_class: garage
        friendly_name: "Garage Door"
        value_template: >-
           {% if is_state('binary_sensor.garage_door_sensor','on') %}
             open
             {% else %}
             closed
             {% endif %}
        open_cover:
          service: switch.turn_on
          data: 
            entity_id: switch.garage_door
        close_cover:
          service: switch.turn_on
          data:
            entity_id: switch.garage_door
        stop_cover:
          service: switch.turn_on
          data:
            entity_id: switch.garage_door

This topic is/was about how entities would be configured for the Command Line integration in 2023.6.0.

What you posted is the configuration for a Template Cover, not a Command Line Cover.