ESPEasy firmware


#5

@xbmcnut
sorry but I don’t actively use HA and easyesp at the moment. I will see if I get some time to fire it up again later and can reply.

Try use a mqtt tool to see what is posted. I used mqttfx I think it was called


#6

Thanks. I’m tracking /ESP01/# and I see the payload heading to the GPIO but nothing back. Wondering if ESPEasy has a status mechanism at all for MQTT. Know you can get pin status with a http request but that complicates my home automation integration.


#7

@runtime Did you get yours working as I’ve cracked this now and I’m in the process of writing a semi definitive guide to using ESPEasy with MQTT on HA. I’ve tested it with Sonoff and NodeMCU and under the latest build (R121), it works extremely well.


#8

Will that guide be posted here or elsewhere?


#9

I’ll post on my blog with a link in this post. Admin will then be welcome to turn into some form of sticky.


#10

I’m trying to get this to work, but am not succeeding yet.

I have ESPEasy build R120 on a Wemos D1 Mini with a relay shield on top of it.
With mosquitto_pub -t /WemosD1/gpio/5 -m 1 i can turn the relay on.
With mosquitto_pub -t /WemosD1/gpio/5 -m 0 i can turn it off again.

With mosquitto_sub -h 192.168.4.14 -p 1883 -v -t '/WemosD1/#' i can see that the GPIO is turned on/off:
/WemosD1/gpio/5 1 /WemosD1/gpio/5 0
I created a switch in HASS:

- platform: mqtt
  name: "Switch"
  state_topic: "WemosD1/gpio/5/state"
  command_topic: "WemosD1/gpio/5/set"
  payload_on: "1.0"
  payload_off: "0.0"
  optimistic: true
  qos: 0
  retain: true
  value_template: '{{ value.x }}'

But nothing happens when i click the on/off icons.

In my configuration.yaml i added the mqtt component:

mqtt:
  broker: 192.168.4.14
  client_id: home-assistant
  keepalive: 60
  protocol: 3.1

I know it is working, because i grab the temperatures from my OpenTherm gateway over MQTT. I use a separate VM running Mosquitto as my broker.

What is going wrong with the HASS <> ESPEasy part?


#11

Hi,

We use some ESP8266 with a firmware ESPEasy to read some sensors without any problems (DHT22)…

sensor 4:
  platform: mqtt
  name: "Temperatura Exterior Sur"
  state_topic: "/esp01/dht/Temperature"
  qos: 0
  unit_of_measurement: "C"

sensor 5:
  platform: mqtt
  name: "Humedad Exterior Sur"
  state_topic: "/esp01/dht/Humidity"
  qos: 0
  unit_of_measurement: "%"

sensor 6:
  platform: mqtt
  name: "Nivel Luz Exterior Sur"
  state_topic: "/esp01/lum/Lux"
  qos: 0
  unit_of_measurement: "Lux"

sensor 7:
  platform: mqtt
  name: "Wifi Signal Exterior"
  state_topic: "/esp01/system/wifi"
  qos: 0
  unit_of_measurement: "dB"

#12

Apologies for the delay. Had man flu all last week. My blog post with what I’ve learnt so far is now up. Sorry it’s a bit rough but it might help someone? http://xbmcnut.blogspot.co.nz/2016/08/using-espeasy-with-home-assistant.html


#13

Hi,

Not sure if you’ve already solved the issue but if not and for future reference I have relay connected to Lolin board on ESPeasy and it works just fine via MQTT.
Relay connected to GPIO 16 on ES8266 called Esp01 with reversed logic so the on is 0 and off is 1 in my example.
Here is my HA config:

switch:
platform: mqtt
name: "ESP Switch"
state_topic: "/Esp01/relay16/Switch"
command_topic: "/Esp01/gpio/16"
payload_on: "0"
payload_off: "1"
optimistic: true
qos: 0

retain: true

In ESPEasy ver.120 there is no support for MQTT retain so I have it disable it should be available in next stable version.

Let me know if it helped.


#14

I’ve been trying to install 120 with limited success. Doesn’t work via Arduino but via some Windows tool I found it works out, but I have a variety of other problems - anyone with solid recommendation on version to use?


#15

I have four Lolin V3 boards running on ESPeasy 120 without any issues.
Installed it with their batch application in the zip file.
I had some problems with previous version 83 (not sure about the number). The problem was that I had MQTT server down and when it failed to connect for about a minute it restarted and tried again. When switched to standalone in settings I was able to configure all devices and then start MQTT server.
You can always check standard things like different power adapters or wiring or if it’s going into deep sleep.
Can’t help you more without details.


#16

Thank you. I’ve used your code in a customised sensors.yaml file and my Dallas Temp/Humidity are coming in nicely now.


#17

You are welcome!,


#18

Late reply, but i am still having some problems with ESPEasy and MQTT.

Controlling the relay works with this HASS code:
- platform: mqtt name: "Wemos D1 MQTT" command_topic: "/WemosD1/gpio/5" payload_on: "1.0" payload_off: "0.0" qos: 1 retain: true value_template: '{{ value.x }}'

But i also want to get the state, so HASS always knows the real state of the relay. I have read some posts online and it seems that you guys use some logic on the ESPEasy to read a button, switch a LED and such, based on the state of the relay.

However, i don’t need that. My ESP only has a relay connected, which i want to switch with MQTT and read the status.

Can someone explain how to read the status without any additional rules/switches in ESPEasy?


#19

I like Homie esp for switches over Mqtt, it provides feedback. You should check it out.


#20

Thanks, i will check that out later.

Do you have any idea for now?

I created a ‘Switch input’ in ESPEasy on the same GPIO as my relay (GPIO5). I can see in the ESPEasy interface that it turns to ‘1’ and ‘0’ when i turn the relay on and off. I can also see the status being sent to MQTT now [email protected]:~$ mosquitto_sub -h 192.168.4.14 -p 1883 -v -t '/WemosD1/relais/state' /WemosD1/relais/state 0 /WemosD1/relais/state 1 /WemosD1/relais/state 0 /WemosD1/relais/state 1 /WemosD1/relais/state 0 /WemosD1/relais/state 1

I can turn the relay on with HASS, but directly after that, the toggle switch in HASS jumps back to the ‘off’ position. However, the relay itself stays on. I don’t know what to try next now… This is the HASS code i use now:

`- platform: mqtt
name: "Wemos D1 MQTT"
command_topic: "/WemosD1/gpio/5"
state_topic: "/WemosD1/relais/state"
payload_on: "1.0"
payload_off: "0.0"
qos: 1
retain: true

I also tried with payload_on: "1" payload_off: "0"
but that didn’t make a difference.

I’m pulling my hairs out, because i have the feeling that i am so close!


Motion Sensor Basic Question
#21

It works now:

- platform: mqtt name: "Wemos D1 MQTT" command_topic: "/WemosD1/gpio/5" state_topic: "/WemosD1/relais/state" payload_on: "1" payload_off: "0" qos: 1 retain: true

When controlling the relay over HTTP, the toggle switch in HASS now changes to on/off accordingly. Yay!
I’m now going to order the ‘Linknode R4’, which is a nice board with a ESP and 4 relays. I find that it looks very safe with the milled slots in the PCB to create more isolation distance. I’m going to use it to control my mechanical home ventilation soon.


#22

onyone use espeasy with HC-SR501 PIR Sensor. I have problem with this sensor, not working well.


#23

they need 5v to run and should be at least a few inches away from the radio (rf seems to make them wacky)


#24

Hey,

I installed it in the following way (also Wemos D1 Mini v2) .
There where some glitches in previous versions of esp easy with relais .
also had a bug with the systemname variable (advanced tab)
Cut from the config like below

switch:

  • platform: mqtt
    name: "Afzuiging"
    state_topic: "azrelay/gpio/5"
    command_topic: "azrelay/gpio/5"
    payload_on: "1"
    payload_off: "0"
    optimistic: false
    qos: 0