Hi, I am kind of out of ideas on why topic_prefix isnt working well for me. I have specified a topic_prefix but I end up seeing messages both on the topic_prefix as well as the default topic , so I end up two set of sensors / switch etc.
Can somebody point out what’s the issue here?
Env: Hassio / ESPHome add on Ver 1.14.5
My ESPHome yaml file:
substitutions:
# below substitutions are required as they are used in include files
device_id: 'security_siren'
device_name: 'Security Siren'
platform: ESP8266
board: esp12e
ssid: !secret secondary_ssid
ssid_pswd: !secret secondary_ssid_pswd
mqtt_broker: !secret mqtt_broker
mqtt_uname: !secret mqtt_uname
mqtt_pswd: !secret mqtt_pswd
base_topic: 'home/security/siren'
api_pswd: !secret api_pswd
ota_pswd: !secret ota_pswd
static_ip: 192.168.1.58
# required substitutions end
siren_gpio: GPIO12
led_gpio: GPIO14
esphome:
<<: !include common/esphome.yaml
# Enable logging
logger:
# include the ota & other settings from common file
<<: !include common/common.yaml # cant use common file as I have to define my api below
wifi:
<<: !include common/wifi.yaml
api:
<<: !include common/api.yaml
mqtt:
# <<: !include common/mqtt.yaml
broker: $mqtt_broker
username: $mqtt_uname
password: $mqtt_pswd
topic_prefix: $base_topic
reboot_timeout: 10min
# Individual outputs
switch:
- platform: gpio
name: "Siren"
id: "siren"
icon: mdi:bullhorn
pin:
number: $siren_gpio
mode: OUTPUT
inverted: False
status_led:
pin:
number: $led_gpio
inverted: yes
text_sensor:
- <<: !include common/text_sensor/wifiinfo.yaml
- <<: !include common/text_sensor/mac.yaml
- <<: !include common/text_sensor/version.yaml
example of one of the included text sensor : wifiinfo.yaml
platform: wifi_info
ip_address:
name: ${device_name} IP Address
icon: mdi:ip-network
An image of my MQTT is included, as you can see i have topics created both under the default “homeassistant/” and under what I specific “home/security/siren”. I have deleted the topics multiple times and they keep coming back.