ESP Easy Mega

Dear all

Im new at HA , i want to go from Domoticz to HA
But i m struggling with integrating sensors, like the ones on the nodeMCU 2x temperture sensors, 1 lux sensor

They are working at Domoticz, but how to intergtrate them in HA
I read that i have to set protocol: openHAB, but when i do that i do not see them anymore at MQTT expolorer… also how to add them in HA, is there any easy methode?

Unless there is some reason you want to keep using esp easy, if they’re esp chips you can use esphome instead. In the supervisor panel-> addon store-> esphome.

Find your sensors and coding here: https://esphome.io/

i have a nodeMCU NodeMCU ESP8266 and yes it supports, but its working with Mqtt.
do i have to reprogram the nodemcu ?

What are you using for an mqtt broker? Is it setup in HA? Did you add the mqtt integration?

That would be the steps you need to take if not. Add a broker, you can use a stand alone or the one in the add on store. If you use a stand alone you have to add it to configuration file.

Then add the integration from: configuration-> integrations

my ESP Easy Mega on mu nodeMCU V2

My broker server is still running on a PI , where domoticz is also running on . HA is also on a PI but a different one (im working parallel, so my domoticz is still running)

On HA in installed Mosquitto broker, and that one is pointing to the broker server

For test i added a sonoff (on Tasmota) with Setoption19 1 autodetect . And that is now working in HA.
So mqtt is working correctly . i also see the sonoff in the mqtt explorer prog. But i do not see how to intergrate the espeasy…

So when you go to configuration-> intergration-> mqtt broker-> configure. Place # in the topic and listen. Do you see the sensors in the log?

If you see them in the log you can manually add the sensor in configuration.yaml

Hi Mikefila

YES. i see it .

{
“idx”: 213,
“RSSI”: 8,
“nvalue”: 0,
“svalue”: “4.9”
}

So i have to add it in configuration.yaml ??

Yes this is where hopefully you will or someone else will be able to parse the information you need in a value template. I can show yau an example of a camera sensor I have

  - platform: mqtt
    name: Front Intrusion
    state_topic: cameras
    value_template: "{{ 'ON' if value_json.code == 'CrossRegionDetection' and value_json.action == 'Start' and value_json.index == '0' else 'OFF'}}"
    device_class: motion

Hopefully you will get the idea from that

thx , i will try

This would be under sensor: as well like so

sensor:

  - platform: mqtt
    name: Front Intrusion
    state_topic: your.topic
    value_template: "your.template"
    device_class: (this will define units and icon)

my nodemcu is working and sending to MQTT

and added this line at /config/configuration.yaml

i used MQTT explore ro read the massage

Example configuration.yaml entry

sensor:

  • platform: mqtt
    name: “TempX”
    state_topic: “home/nodeMCU v2/Temperatuur_Garage/°C”

But i see no reading in HA , where can i find entitie TempX

Naamloos2

configuration was valid , but where to find

Couple of things. Formatting I don’t believe spaces are allowed. Spelling, Temperatuur? Your listening to a topic but you haven’t told it what value to display.

If you put your code in the template page of dev tools it will tell you that. Just erase all the code in the box and you can use it to test most any code. value_json will show up as undefined though. I’m also not sure about being able to use the degree sign.

So try

sensor:

  - platform: mqtt
    name: "TempX"
    state_topic: "home/nodeMCU_v2/Temperature_Garage"
    value_template: "{{ value_json.C }}"

restart
You should see sensor.tempx in your entities.

add the device_class:

sensor:

  - platform: mqtt
    name: "TempX"
    state_topic: "home/nodeMCU_v2/Temperature_Garage"
    value_template: "{{ value_json.C }}"
    device_class: temperature

if i check mqtt explorer


then this should be the topic
home/nodeMCU v2/Temperatuur_Garage/°C

i will try removing the spaces
Spelling , yes i know some words are in English some Dutch

ok i will try, thx again

Mmh i have the sensor , at mqTT
Naamloo5s

sensor:

  • platform: mqtt
    name: “TempX”
    state_topic: “home/nodeMCU_v2/Temperatuur_Garage”
    value_template: “{{ value_json.C }}”
    device_class: temperature


but still no value Unknown. i reboot HA

- platform: mqtt
  name: TempX
  unit_of_measurement: "°C"
  state_topic: “home/nodeMCU_v2/Temperatuur_Garage/C”

Try it with unit_of_measurement with no value_template if that doesnt work add value_template back and remove C from the topic