First off you need to make sure you properly format your code for the forum. put three backticks (```) on the line both before and after your code.
But to your issue.
as far as I know you can’t do both methods of config at the same time.
the !include statement adds the code in that file just as if you added it directly under the intial key in configuration.yaml.
So the way you have it now it will look like the when the !include is processed:
mqtt:
broker: 192.168.0.3
keepalive: 60
discovery: true
discovery_prefix: homeassistant
sensor: #!include mqtt-sensors.yaml -> everything past here is from the included file
platform: mqtt
name: “sn-163: Temperature”
sensor bedroom:
platform: mqtt
If you notice the indentation you should see why it won’t work.
Which is also why the code needs formatted properly when posting so we can see the formatting and fix any issues there.
Also I can’t really tell from your formatting but it looks like you have the same mqtt sensor included twice (sn-163: Temperature)
Got it I was investigating which one to use. For me it is understanding how HA works
Never the 2 method’s combined or at the same time but thanks for clarify this.
I understand and agree that my question or remark was not clear enough. My apologies for this. I got it working now thanks to your remarks