ESPEASY via MQTT with Mosquitto broker

Hello,

I’m new on this forum because I want to jump from Domoticz (More than 150 items) to HASS.io .

I want to start solving communcation from my ESPEASY distance sensor (Level of rain tank) to HASS.IO.

I install Hass.io on Rpi4B 2GB on 32Go SD Card but I can’t have communication with my ESPEASY via MQQTT.

Config of my ESP EASY :

Log of my ESPEASY :

MQQT Conf is :

logins: []
anonymous: false
customize:
active: false
folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

MQTT broker run and log is

1593795462: New connection from 192.168.1.8 on port 1883.
1593795482: New connection from 192.168.1.8 on port 1883.
1593795503: New connection from 192.168.1.8 on port 1883.
[WARN] Not found homeassistant on local database
1593795522: New connection from 192.168.1.8 on port 1883.
1593795542: New connection from 192.168.1.8 on port 1883.
1593795562: New connection from 192.168.1.8 on port 1883.
1593795582: New connection from 192.168.1.8 on port 1883.
1593795600: Saving in-memory database to /data/mosquitto.db.
1593795605: New connection from 192.168.1.8 on port 1883.
1593795622: New connection from 192.168.1.8 on port 1883.

Thanks for your help.

I don’t know what mosquitto you are using, but if it is the mosquitto add-on for homeassistant OS or homeassistant supervised, it is clearly written in the docs that the user can’t be homeassistant.
BTW: the name hassio was retired months ago.

I don’t change MQTT user for the moment :

Snapshot of MQTT SETTING in Configuration addon.

I try to remove “Controller User” in ESP EASY without improvment.

I still get error :
73405490: MQTT : Intentional reconnect
73405568: MQTT : Failed to connect to broker

1 Like

It’s working.
I change username in MQTT settings and in ESP CONTROLLER (same username and password). And now ESP is connected to MQTT.
Thanks a lot francisp :partying_face:

But sensor didn’t appear automatically in MQTT addon, do i have to fill configuration.yaml ?

Probably. I don’t think espeasy supports sending homeassistant mqtt discovery messages.

ESPeasy it not sending discovery. Im was try that many times.
Im using ESP wall switches and in rules I control MQTT publish action to do something in HA.

In devices i have “Generic - MQTT Import” to it listen to changes of a MQTT Topic and in rules I have actions based on those changes

I have archived all rules on Github:

Here a screenshot of one of the generic MQTT import:

Those MQTT Topics are MQTT Switches in HA

Dear ALL
im also want to intergrate my nodeMCU (wich is programmed with espeasy). it is working ok with domoticz., but i cannot intergrate it in HA

image


i changed teh settings to openHAB
but now it is not working for MQTT
Uptime 16 ConnectFailures 0 FreeMem 12520 WiFiStatus 3

by configuration.yaml, you need:

# Kaffeemaschine
binary_sensor km:
  - platform: mqtt
    name: "TC91100"
    unique_id: tc91100
    state_topic: "BSTC91100/VACC/status"
#   state_topic: "BSTC91100/gpio/4"
    payload_on: "1"
    payload_off: "0"
    availability:
    - topic: "BSTC91100/status/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
    
switch km:
  - platform: mqtt
    name: "cups 5-8"
#   unique_id: tc91100b58
#   state_topic: "BSTC91100/gpio/14"
#   command_topic: "BSTC91100/gpio/14"
    state_topic: "BSTC91100/B58/status"
    command_topic: "BSTC91100/B58/status"
    payload_on: "1"
    payload_off: "0"
  - platform: mqtt
    name: "cups 2-4"
    state_topic: "BSTC91100/B24/status"
    command_topic: "BSTC91100/B24/status"
    payload_on: "1"
    payload_off: "0"
  - platform: mqtt
    name: "off"
    state_topic: "BSTC91100/BOFF/status"
    command_topic: "BSTC91100/BOFF/status"
    payload_on: "1"
    payload_off: "0"

2 Likes

Nice solution. I created same way for my wall switches based on ESPeasy. Can use them manual, will update in HA. Can use them in HA and will update in ESPeasy. Nice colors for every action I created in the switch… :slight_smile:

//Keep up the good work

1 Like

Just to let all know i have created a Node Red flow to give MQTT auto discovery cappability to EasyESP :smiley: