MQTT Discovery with ESPEasy firmware?

Im on ESPEasy v2.0.0-dev12 from ~1.5 years back.
Im upgrading my project from that period:

I was inspired by some tasmota devices and by zigbee2mqtt that both support autodiscovery… then I found your blog post (via google rather than this topic ;))

That looks like a cool project. That is one of the reasons I also started with ESPEasy - the sheer number of plugins/integrations it supported (and still does), though others are catching up now.

I think the rules worked the same in v2.0.0, but I may be wrong. If you have a spare ESP lying around, I’d suggest you try the same firmware on it and see if the auto discovery works and keep an eye on the log. I used a Wemos D1 mini as my development and test environment :slight_smile:

I also wanted the auto-discover feature for espeasy and keep it simple for the device so i have created a Node-Red flow to do the work at creating devices according to the name of the variable
Current support of

  • Sensors
  • Switches
  • Dimmer
  • RGB Dimmer

Working on Termostat to get it to output set temperature

note that because there is not /Set to set a variable i do need to have rules on each device but i dont need to do anything inside configuration.yaml
and each device is under Devices and has all values there.

1 Like

And now i have added support for Termostat with version 2.1.0 :slight_smile: do tell if you miss anything

V 2.2.0 released that add error message handling to show if any unsupported character is used in topic.

I have created this in the system boot proces rule:

// START Boot
On System#Boot do
  TaskValueSet 11,1,0
  TaskValueSet 11,2,0
  TaskValueSet 11,4,0

On Rules#Timer=8 do
  Publish homeassistant/switch/meek_switches/balcony/config,'{"name": "balcony","state_topic": "homeassistant/ha_switches/balcony","command_topic": "homeassistant/ha_switches/balcony","unique_id": "14685093-ad68-4e03-a978-6fb858e34390","device": {"identifiers": "meek_switches","name": "Meek switches","manufacturer": "Peter Oudenes"},"optimistic": "false","qos": "1","retain": "false","payload_on": "1","payload_off": "0","state_on": "1","state_off": "0","icon": "mdi:nintendo-switch"}'
  Publish homeassistant/switch/meek_switches/dressoir/config,'{"name": "dressoir","state_topic": "homeassistant/ha_switches/dressoir","command_topic": "homeassistant/ha_switches/dressoir","unique_id": "14685093-ad68-4e03-a978-6fb858e34391","device": {"identifiers": "meek_switches","name": "Meek switches","manufacturer": "Peter Oudenes"},"optimistic": "false","qos": "1","retain": "false","payload_on": "1","payload_off": "0","state_on": "1","state_off": "0","icon": "mdi:nintendo-switch"}'
// END

Evertime my ESP needs to restart it will send this 2 Publish actions and the switches will be created.
Those topics are used inside the “Devices” the control switches based on MQTT topic input.

Work great for me. And never needed to create MQTT switches in Home Assistant again.

My Node red Flow is updated to fix a bigger bug with matching units added to config.