Källa: Home Assistant | MQTT add-on | Github | MQTT | Beginners video |

MQTT är ett transportlager på TCP/IP som är en pub/sub tjänst
MQTT (även känt som MQ Telemetry Transport) är ett maskin-till-maskin-protokoll eller ”Internet of Things”-protokoll utöver TCP/IP. Det möjliggör extremt lätt publicerings-/prenumerationsöverföring av meddelanden.
- Installer MQTT broker på Homeserver
Skapa användare + lösenord i Home Assistant för MQTT användare som ska används av klienter som vill
Test
Validera Home Assistant MQTT Broker
Note! Fungerar inte
Validate access with browser mqtt(s)://[användarnamn[:lösenord]@]host[:port] .
mqtt://user:pw@homeassistant.local:1883
| I’m assuming you are running Home Assistant OS and have mosquito installed as a home assistant addon (otherwise, you would have set up mosquito broker manually and already know the answer).
The answer depends on where you are trying to access mqtt from.
|
The Home Assistant MQTT broker address is typically the local IP address of your Home Assistant instance, with the default port being 1883. If you’re using Home Assistant OS and haven’t changed the default settings, you can also use homeassistant.local as the hostname.
Here’s a breakdown:
-
IP Address:If your Home Assistant instance has the IP address
192.168.1.100, then the MQTT broker address would bemqtt://192.168.1.100:1883. -
Hostname:If you’re using Home Assistant OS, you can also use
mqtt://homeassistant.local:1883. -
Port:The default MQTT port is 1883.
-
Authentication:If you’ve set up authentication for your MQTT broker (e.g., username and password), you’ll need to include that information in your connection settings as well.
Example:
If your Home Assistant instance has the IP address 192.168.1.100 and you have a username mqtt and password secret, your connection string might look like this (depending on the MQTT client you’re using): mqtt://mqtt:secret@192.168.1.100:1883.
- You’ll need to have the MQTT broker integration installed and configured in Home Assistant.
- If you’re using a different MQTT broker (not the one included with Home Assistant), you’ll need to use the address and port of that specific broker.
- If you’re connecting from outside your local network, you’ll need to ensure your router is properly configured to forward MQTT traffic to your Home Assistant instance.
- You may need to adjust the port number if you’ve configured your MQTT broker to use a non-standard port.