Use packages for such a structure. 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:
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.
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.
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.
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â. And it sure doesnât tell you, that the telnet
integration has to be changed in any way.
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
.
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.