MQTT DiscoveryStream integration

much appreciated, that works!! cool thnx for fast reponses
now lets install openHab :slight_smile:

One last question , I was looking at openhab, and seems they have an mqtt binding to discover mqtt entities from HA…

But the base topic needs to be “homeassistant” , if I setup that basetopic in your custom and I do a restart , I get thousands of entities , seems they are constantly discovering again and making duplicates…

Is there a way to resolve that?

If you don’t need it for something else, you could disable discovery on the main MQTT integration

image

Hmm, I can do that indeed, it’s only for my alarm that I need mqtt, but those are static…

Why is it rediscovering ? does the base topic in your custom always needs to different when discovery is on? Because in the mqtt statestream, the official one , the base topic is also homeassistant

Why would it not if you publish on the same root topic as HA and you keep “discovery”?

The integration publishes discovery topics for your entities. Obviously, if you use the same root topic as HA, with discovery enabled, HA will “discover” those and create duplicates. Those duplicates will be published themselves, then discovered, and so on in and endless loop…

Yes indeed , that was indeed happening, thnx for info :+)

Just for info, this custom is great improvent over the official integeration, why are your not making a PR to the core for this?

  1. Getting something accepted in core is basically gambling
  2. it’s a PITA anyway
  3. As it’s YAML only, it’s not even worth hoping
  4. I don’t believe in the current monolithic way of working
1 Like

I hope you can maintain it, it’s a really nice upgrade… thnx for it!

Hey @koying , back from holiday, and now started working on OpenHab, entities are nicely discovered in OpenHab too!! Easy now to control switches!
But i have a problem with the lights that are imported…, i’m getting this error in OpenHab

2022-07-26 17:50:24.625 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '{"state": "OFF"}' from channel 'mqtt:homeassistant_mqtt_5Flight_2Ewasplaats:e94f1500bd:mqtt_5Flight_2Ewasplaats:mqtt_5Flight_2Ewasplaats#light' not supported by type 'ColorValue': {"state": "OFF"} is not a valid string syntax

Not sure what it means, maybe the syntax is wrong in your custom? or maybe OpenHab to blame?

anyway, i dont use ColorValue anyway, is it possible i can remove it? or change the string values?

also second question, i added cover/script domain now also , but seems there is no cmd_topic to turn it on/off? i dont see it either in mqtt explorer , its seem different the lights/switches?

isnt it possible to to turn on/off a cover or scripts?

1 Like

Hello, great integration. Just what I was working for to connect my development system to my production system with Z-wave and ZHA.

Any chance of getting support for climate entities?

I’m struggling with configuring this HACS integration correctly and am looking for advice.

The goal is to have the Master HA instance publish all Z-wave and Zigbee devices to the slave HA instance. I’ve configured the Master instance with the devices in YAML, and am using the homeassistant discovery topic, and the devices are replicated to the slave instance. I had MQTT discovery enabled on the Master initially, but that wound up duplicating devices, so I disabled discovery, and that wound up breaking existing espresense MQTT devices.

Is there a way to configure this that allows my goal but still allow normal MQTT discovery on both systems without the device replication problem?

I’m guessing I can manually configure the espresense devices (there are fewer of these than Z-wave/Zigbee)?

@koying does this integration support reloading without restarting Home Assistant?

@RogTP

I saw you forked the component, is it maybe possible to also add “cover” support to your version?
What other fixes have you done ?

thnx

for cover domain, i added below:

            elif ent_domain == "cover":
                config["pl_closed"] = STATE_CLOSED
                config["pl_open"] = STATE_OPEN
                config["cmd_t"] = f"{mybase}set"
                publish_config = True

and

await hass.components.mqtt.async_subscribe(f"{base_topic}cover/+/set", message_received)

and

            elif msg.payload == STATE_CLOSED:
               await hass.services.async_call(domain, SERVICE_CLOSE_COVER, {ATTR_ENTITY_ID: f"{domain}.{entity}"})
            elif msg.payload == STATE_OPEN:
               await hass.services.async_call(domain, SERVICE_OPEN_COVER, {ATTR_ENTITY_ID: f"{domain}.{entity}"})

Can you submit a pull request? I don’t have any ‘cover’ entities to test against.

Ok, will do that next week

Btw , do you know if it’s possible to also include the script domain?

Also it would be better if it covered all the services shown here - Cover - Home Assistant

In terms of changes, you can see what has been done in the release history here - Releases · RogerSelwyn/mqtt_discoverystream_ha · GitHub

Ah ok, ok , will try to have a look
Problem is that I have stateless covers, I can only open/close… I can however make a workaround to test the state…

But set cover position I can’t test :frowning: