I am having problems with my configuration.yaml

Hi I have install Home assistant and I am trying to get my configuration.yaml setup but being new to this I am not sure what i have done wrong. I am trying to add the following to the stock config file

switch:

  • platform: mqtt
    name: “tvonoff”
    state_topic: “home/MQTTtoIR” # defined by subjectGTWIRtoMQTT in User_config.h
    command_topic: “home/commands/IR_SAMSUNG”
    payload_on: “E0E040BF”
    payload_off: “E0E040BF”
    optimistic: false
    retain: true

switch:

  • platform: mqtt
    name: “outlet5”
    state_topic: “home/433toMQTT” # defined by subjectGTWRFtoMQTT in User_config.h
    command_topic: “home/commands/MQTTto433”
    payload_on: “5321987”
    payload_off: “5321996”
    optimistic: false
    retain: true

Please use preformatted text when posting your configuration. Highlight the text then click the </> button.

I don’t think you can use the domain switch: twice. try combining the switches into a single domain like:

switch:
  - platform: mqtt
    name: "tvonoff"
    state_topic: “home/MQTTtoIR” # defined by subjectGTWIRtoMQTT in User_config.h
    command_topic: "home/commands/IR_SAMSUNG"
    payload_on: "E0E040BF"
    payload_off: "E0E040BF"
    optimistic: false
    retain: true
  - platform: mqtt
    name: "outlet5"
    state_topic: “home/433toMQTT” # defined by subjectGTWRFtoMQTT in User_config.h
    command_topic: "home/commands/MQTTto433"
    payload_on: "5321987"
    payload_off: "5321996"
    optimistic: false
    retain: true

Thank you it loads up without problem now. I just have to get the mqtt working now

Thanks Nikki

I need a little more help i am not able to get the “tv power” ir sender is not working and have this message
The following components and platforms could not be set up:
logbook
history
recorder
Please check your config

I have attached my config file.

Thanks Nikki

configuration.yaml (2.6 KB)

I have now got everything working but ive a strange problem when i turn the lamp on or off the tv power toggles as well and vice versa :confused:
configuration.yaml (2.6 KB)

I’m new to HA … Don’t know if it matters, but you’re payload_on and payload_off are the same. Is it turning off when you are trying to turn it on?

That is the code for the standby button on my remote so its the same for on and off.