mhelgers
(Mhelgers)
1
I created a mqtt switch in the yaml file
mqtt:
switch:
- command_topic: "garten/channel/cmnd/power1"
- state_topic: "garten/channel/stat/POWER1"
payload_on: "ON"
payload_off: "OFF"
name: "Pumpe"
if i now want to make an automation for it i can not find a device ‘Pumpe’
How can i create/define a device regarding to the entity ‘Pumpe’??
tom_l
2
action:
- service: switch.turn_on
target:
entity_id: switch.pumpe
mhelgers
(Mhelgers)
3
in this way? i got an error
mqtt:
switch:
- command_topic: "garten/channel/cmnd/power1"
payload_on: "ON"
payload_off: "OFF"
name: "Pumpe"
- action:
- service: switch.turn_on
target:
entity_id: switch.pumpe
tom_l
4
No. Use the action in an automation. Like you asked for. Not in the switch configuration.
Troon
(Troon)
5
You’ll need to reload the configuration. Either restart HA or go to Developer Tools / YAML and click this one:

You should then have switch.pumpe
available, assuming you have fixed the indentation (switch:
should be a level below mqtt:
, not on the same level).
mhelgers
(Mhelgers)
6
hmmmm…is there no way integrate the device Pumpe in the Frontend except with yaml entry?
Troon
(Troon)
7
Yes: choose Call Service instead of Device, then select switch.turn_on
or switch.turn_off
and choose your switch.pumpe
.
mhelgers
(Mhelgers)
8
thx, that is what i looked for:)
tom_l
9
That is what I told you in the first reply to your question.
Troon
(Troon)
10
I think the automation UI is a bit unhelpful in this regard. Logical first step for a beginner is to select Device, and then you’re stuck.