Getting multiple switches to work?

Hi,
im trying to get multiple switches to work. One is command_line and the other Broadlink RM.
When im having either one in configuration.yaml it works,

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude:  49.6610
  longitude: 11.0345
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 270.0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Europe/Berlin

# Show links to resources in log and frontend
#introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  # Uncomment this to add a password (recommended!)
  # api_password: PASSWORD
  # Uncomment this if you are using SSL or running in Docker etc
  # base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components..  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time.
history:

# View all events in a logbook
logbook:

# Track the sun
sun:

# Weather Prediction
sensor:
  platform: yr

# text to speech
tts:
  platform: google

# Example configuration.yaml entry
light:
  platform: limitlessled
  bridges:
    - host: 192.168.0.127
      groups:
      - number: 1
        name: Decke
        type: rgbww
      - number: 2
        name: Wand
        type: rgbww
      - number: 3
        type: rgbww
        name: Streifen
        fade: off
      - number: 4
        type: rgbww
        name: Fernsehlicht


emulated_hue:
  expose_by_default: true
  exposed_domains:
    - script
    - light
    - switch
    - group
    - media_player
    - fan


media_player:
  platform: onkyo
  host: 192.168.0.102
  name: Receiver
  sources:
    Video2: 'CBL/SAT'
    Bluray: 'BD/DVD'
    Game: 'Game'
    Video6: 'PC'
    TV: 'CD'

media_player 2:
  - platform: samsungtv
    host: 192.168.0.152
    #port: 8001
    mac: B8:BB:AF:DE:8C:7C

#switch:
#  platform: command_line
#  switches:
#    door:
#       command_on: "/usr/bin/curl -X GET http://192.168.0.66/open.php"
#       command_off: "/usr/bin/curl -X GET http://192.168.0.66/close.php"
#       value_template: '{{ value == "1" }}'
#       friendly_name: TürÖffner

switch :
    platform: broadlink
    host: 192.168.0.124
    mac: '34:EA:34:42:BD:0E'
    timeout: 5
    switches:
      tv_samsung:
        friendly_name: "Samsung TV"
        command_on: 'JgBGAJKVETkRORA6ERQRFBEUERQRFBE5ETkQOhAVEBUQFREUEBUQOhEUERQRORE5EBURFBA6EBUQOhE5EBUQFRA6EDoRFBEADQUAAA=='
        command_off: 'JgBGAJOVEDoQOhA6DxYPFhAVEBUQFRA6ETkROREUERQRFBEUEBUQFREUERQRORE5EBUQFRE5ETkRORE5ERUQFRA6DzsPFhAADQUAAA=='









group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
switch:
  - platform: command_line
    switches:
      door:
        command_on: "/usr/bin/curl -X GET http://192.168.0.66/open.php"
        command_off: "/usr/bin/curl -X GET http://192.168.0.66/close.php"
        value_template: '{{ value == "1" }}'
        friendly_name: TürÖffner
  - platform: broadlink
    host: 192.168.0.124
    mac: '34:EA:34:42:BD:0E'
    timeout: 5
    switches:
      tv_samsung:
        friendly_name: "Samsung TV"
        command_on: 'JgBGAJKVETkRORA6ERQRFBEUERQRFBE5ETkQOhAVEBUQFREUEBUQOhEUERQRORE5EBURFBA6EBUQOhE5EBUQFRA6EDoRFBEADQUAAA=='
        command_off: 'JgBGAJOVEDoQOhA6DxYPFhAVEBUQFRA6ETkROREUERQRFBEUEBUQFREUERQRORE5EBUQFRE5ETkRORE5ERUQFRA6DzsPFhAADQUAAA=='
1 Like

that worked, thank you.
i had tried with the dash before the platform also, but didnt work.
Is there anywhere a good tutorial for that yaml stuff?

Not really :smile:

There’s this…
https://home-assistant.io/docs/configuration/devices/

But I think most people just pick it up as they go along.