MQTT - i'm about to giveup

i have sonoff 4 channel pro r2 already flash with tasmota and working good
i put the switch in /config/configuration.yaml

mqtt:
broker: core-mosquitto

switch:

  • platform: mqtt
    name: “תאורת חוץ הצפה”
    command_topic: “cmnd/sonoff4ch1/power1”
    state_topic: “stat/sonoff4ch1/POWER1”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true
  • platform: mqtt
    name: “תתאורת מדפים”
    command_topic: “cmnd/sonoff4ch1/power2”
    state_topic: “stat/sonoff4ch1/POWER2”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true

can any1 help me
way dont i see it in the frontend of HA

Thanks Refael

Couple of things could be wrong here, your quotes look wrong to me they should be normal quotes " - like this. Your topics could be wrong and/or your payloads my be the wrong case. You need to check with mqttfx or similar to make sure the case and topics are correct.

the best way for people to help you is that you put your code into the proper format. It’s hard to see formatting errors if it isn’t displayed properly.

copy your code from your configuration file, highlight it then hit the </> at the top of the window.

MQTT is easy to debug - just don’t use home assistant. Run mosquitto_sub (or a similar MQTT app) and subscribe and make sure the topics and data are being sent. The use mosquitto_pub to send messages to the device and make sure it works. Once both of those work right, then start up HA and hook that in.

is core-mosquitto a hostname? You are supposed to put the IP address or hostname of the broker here.

1 Like

Not in hassio you’re not

I assume you installed the MQTT Broker from the addon store?

Somebody should tidy up the docs then.

The docs are pretty clear!

Really?

Not here https://www.home-assistant.io/docs/mqtt/broker

or here https://www.home-assistant.io/components/mqtt/

Ahhh I see you have to go here: https://www.home-assistant.io/addons/ and then to the mosquitto addon page. Confusing as hell.

Well if you use Hassio you need the Hassio addon… I guess that can be confusing.

Yeah, the other pages I mentioned should at least have a pointer: if you are using hass.io see also here…

Anyway, apologies for the wrong information.

1 Like