Where to find entries for tasmota

I looking for a description of how I set values in a yaml file. there are great websites out there, but they assume you already know what parameters to put in your file. I don’t.

platform: mqtt - I believe this is telling hass what structure to use for the device definition.

name: ? can I make up any name? or do I pull if from the sonoff/tasmota information page?

sate_topic: can I make this up, or pull from information page?
Same for command_topic, and availability_topic.

payload_on _off - i understand that (my brain seems to handle up to three letters :frowning:
the others i understand also.

switch:
  - platform: mqtt
    name: "Bedroom Switch"
    state_topic: "home/bedroom/switch1"
    command_topic: "home/bedroom/switch1/set"
    availability_topic: "home/bedroom/switch1/available"
    payload_on: "ON"
    payload_off: "OFF"
    state_on: "ON"
    state_off: "OFF"
    optimistic: false
    qos: 0
    retain: true

Simply use discovery and there is no setup required.

I have done that.
Via the GUI, I can toggle the device from HA. thanks to this forum!

In this thread, I am getting directed to not use the GUI for more complex automation.
To construct the yaml automation, I need to know the correct syntax with the correct parameters, etc. The links are ok on syntax, but I cannot find where the authors and videos experts get the parameters - they just type in a value and voila, it works - can’t be!!)

I was thinking the topics have to come from the sonoff itself. Maybe not - maybe if it is an entity in HA … , but the examples and tutorials look like the above - so where in HA do I even find the name to use, or the command topic to use, or state topic, etc, in my custom automation? I don’t even know the ‘name’ of the device: e.g. my sonoff

Friendly Name 1 DVES_5A97C3_1
Friendly Name 2 DVES_5A97C3_2

But in HA, it shows up as switch.sonoff and switch.sonoff2, though on the overview page “entity id” (is that the same as “name in yaml”?) shows up as the friendly names above. I am trying to understand all of the details, which maybe is a mistake. any help is appreciated.

Easiest way to find all of the topic info that is being used by your sonoff device is to pull it from the device information page, to make your MQTT control work you need to match the topic(s) you set in your yaml to the topic(s) that have been set in the sonoff device(s) (if they don’t match MQTT will not work)

name: set this in the configuration page of the sonoff device by logging into the devices ip address and adding a ‘friendly name’ this then becomes the name to use in your yaml for name:

- platform: mqtt (this is the protocol that you have chosen to control your switch)

Thanks Bluey. That all falls into place now. I also loaded mqtt.fx and am watching the communications - useful tool.

The subject matter experts should show a graphic with an example device information page on the left, and the HA programming (UI or yaml) on the right, and clearly show how these are used.

This would help beginners overcome some of the nomenclature mismatches - device has topic, group topic, full topic and fallback topic. HA has state topic, command topic, and availability topic, which in actuality are constructed from the device’s ‘topic’ and specific words (cmnd, etc.) or lack of words, and in various orders (e.g. sonoff/cmnd/POWER1 or cmnd/sonoff/POWER1).

Thanks again!

Correct.
Here is an example of one of my simple sonoff switches showing the topics used and the yaml code

Screen Shot 2019-07-22 at 10.29.50.png

- platform: mqtt
  name: "Outside Light"
  state_topic: "stat/sonoff01/POWER"
  command_topic: "cmnd/sonoff01/POWER"
  qos: 1
  payload_on: "ON"
  payload_off: "OFF"
  retain: true

This then gives an entity id of: "Outside Light (switch.outside_light) which you can use in your automations using the “switch.turn_on/off” etc