I tried to put the mqtt in a separate .yaml file. so the config.yaml does not get too full.
So in my config.yaml I put:
mqtt: !include mqtt.yaml
I crated a file called
mqtt.yaml
- plattform: mqtt
unique_id: Rasenbewässerung Hochbeet Nord
name: "Rasenbewässerung Hochbeet Nord"
state_topic: mqtt/irrigation/relay1/state
command_topic: mqtt/irrigation/relay1/switch
payload_on: "1"
payload_off: "0"
state_on: "ON"
state_off: "OFF"
- platform: mqtt
unique_id: Tropfbewässerung Terrasse
state_topic: mqtt/irrigation/relay2/state
command_topic: mqtt/irrigation/relay2/switch
payload_on: "1"
payload_off: "0"
state_on: "ON"
state_off: "OFF"
name: "Tropfbewässerung Terrasse"
- platform: mqtt
unique_id: Tropfbewässerung Haus
state_topic: mqtt/irrigation/relay3/state
command_topic: mqtt/irrigation/relay3/switch
payload_on: "1"
payload_off: "0"
state_on: "ON"
state_off: "OFF"
name: "Tropfbewässerung Haus"
- platform: mqtt
unique_id: Tropfbewässerung Hochbeet
state_topic: mqtt/irrigation/relay4/state
command_topic: mqtt/irrigation/relay4/switch
payload_on: "1"
payload_off: "0"
state_on: "ON"
state_off: "OFF"
name: "Tropfbewässerung Hochbeet"
- platform: mqtt
unique_id: Rasenbewässerung Terrasse
state_topic: mqtt/irrigation/relay5/state
command_topic: mqtt/irrigation/relay5/switch
payload_on: "1"
payload_off: "0"
state_on: "ON"
state_off: "OFF"
name: "Rasenbewässerung Terrasse"
- platform: mqtt
unique_id: Dummy Switch 6
state_topic: mqtt/irrigation/relay6/state
command_topic: mqtt/irrigation/relay6/switch
payload_on: "1"
payload_off: "0"
state_on: "ON"
state_off: "OFF"
name: "Test Schalter 6"
- platform: mqtt
unique_id: Rasenbewässerung rechts
state_topic: mqtt/irrigation/relay7/state
command_topic: mqtt/irrigation/relay7/switch
payload_on: "1"
payload_off: "0"
state_on: "ON"
state_off: "OFF"
name: "Rasenbewässerung rechts"
- platform: mqtt
unique_id: Schalter 8
state_topic: mqtt/irrigation/relay8/state
upon checking the config it gives me the following error:
Invalid config for [mqtt]: expected dictionary for dictionary value @ data['mqtt']. Got [OrderedDict([('plattform', 'mqtt'), ('unique_id', 'Rasenbewässerung Hochbeet Nord'), ('name', 'Rasenbewässerung Hochbeet Nord'), ('state_topic', 'mqtt/irrigation/relay1/state'), ('command_topic', 'mqtt/irrigation/relay1/switch'), ('payload_on', '1'), ('payload_off', '0'), ('state_on', 'ON'), ('state_off', 'OFF')]), OrderedDict([('platform', 'mqtt'), ('unique_id', 'Tropfbewässerung Terrasse'), ('state_topic', 'mqtt/irrigation/relay2/state'), ('command_topic', 'mqtt/irrigation/relay2/switch'),.... (See /config/configuration.yaml, line 12).
What do I do??
Thanks for the answer.
1 post - 1 participant