This is an “extension” (and compatible replacement) of the builtin mqtt_statestream integration.
Besides the functionalities of the here-above, it also allows to publish and handles an MQTT “disvovery” setup.
This is specifically useful in “Master-Slave” HA scenarios.
A “slave”, by instance a specific HA instance handling zigbee and / or Bluetooth, would use this component to publish states and discovery via MQTT.
A “master” would use the built-in MQTT discovery mechanism to subscribe to state topics, and get commands (e.g. turn on light) information
Changelog
0.5
Add device support
FIX color support
Add availability support
0.4
Add device_tracker
Add light transitions
Initial HACS release
0.3
Manage color temperature
0.3
Fix binary_sensors
0.1
Initial release:
Handles:
sensors
switches
lights (partial)
Pre-requistes
MQTT configured
Installation
HACS
Launch HACS
Navigate to the Integrations section
“+ Explore & Add Repositories” button in the bottom-right
This is excellent and has helped considerably in my setup. I understand you’ll not want to develop too far from the core statestream integration but I was wondering if a discovery_prefix could be added so I can store the mqtt sensors in their own base topic but still use the default homeassistant discovery location.
Is there any chance you can add a discovery_prefix?
I’m trying to investigate why the retained flag is being removed from mqtt ha discovery messages and having the base topic also set to homeassistant so sensors write there as well is causing problems for me.
Not sure what you mean. This component pushes discovery messages to the topic of your choice.
The actual discovery happens on the builtin MQTT integration.
I have 2 HA instances for collecting z-wave, zigbee and ble sensors which are then published to an MQTT server for the main HA instance to use. I use your integration to publish the ble sensors.
With zigbee2mqtt and Z-Wave JS2MQTT the sensors are published to the base topics zigbee2mqtt and zwave and the auto discovery config is published in the base topic homeassistant.
With your discoverystream integration the config messages are published in whatever topic is set as the base topic - there is no separate discovery_topic configuration option as there is with the zigbee2mqtt and zwave2mqtt addons. This means I have to set the base_topic to homeassistant for HA auto discovery to work.
I want to publish the sensor data in its own base_topic and have the auto_discovery messages published in the homeassistant base topic.
Example:
discoverystream message published under ha_sensor_1 - HA fails to auto discovery sensor
gonna test this out soon, if i include a domain “lights” for example, will it exlude automaticly all the other domains? or do i need to exclude them manually? dont want an overkill of entitiies on mqtt
ok, i installed this custom with hacs, and setup domain “light” for now only
some question, for now i’m having just HA as standalone, the idea is to push the entities to OpenHab, so i can turn on/off lights/switches
i see in mqtt explorer the lights coming in, but in the “mqtt broker” integration, i dont see any mqtt lights? should i not see the there also? as an mqtt duplicate of my normal light?
also , whats the payload that i need to send for example in mqtt explorer to turn an light on/off?
Here, the topic to switch the light is ha_mqtt/light/wasplaats/set_light (cmd_t or command topic)
The payload to send is the default (MQTT Light - Home Assistant), so “ON” or “OFF”
So, to switch the light on, use the equivalent of the below in openhab
mosquitto_pub -h <your_mqtt_broker> -p 1883 -t "ha_mqtt/light/wasplaats/set_light" -m ON