SamZorSec / Open-Home-Automation

Open Home Automation with Home Assistant, ESP8266/ESP32 and MQTT
MIT License
957 stars 196 forks source link

Help: binary sensor door/button VS multi sensor door/button #35

Closed pidiet closed 6 years ago

pidiet commented 6 years ago

Hello,

i just switched over from using the binary sensor door (ha_mqtt_binary_sensor_door) over to use the multisensor (ha_mqtt_multisensor) for the same propose plus more (pir sensor)

I found some difference:

magnet/reed/door sensor with the same wiring (d1 and ground) results:

button with same wiring (wemos button shield on d3 and ground) without any resistor:

And the pir/motion sensor on the multi sensor sketch also works like a charm.

Beside that I like the "online" state information from the multi sensor! Very nice feature!

Would be awesome to "tune" the multisensor sketch that it's possible to use more/different types of sensor. For example:

Any idea how I can correct my open/closed problem with the my door sensor? Thank's!

rradar commented 6 years ago

Like the idea! Having the multi sensor with modules you can choose and wire your hardware! :+1:

pidiet commented 6 years ago

How can I change the (wrong) open/closed state of my magnet/reed/door sensor?

SamZorSec commented 6 years ago

@pidiet Just invert the payload sent to the MQTT broker:

Replace the following lines in config.h:

#define MQTT_PAYLOAD_ON   "ON"
#define MQTT_PAYLOAD_OFF  "OFF"

by

#define MQTT_PAYLOAD_ON   "OFF"
#define MQTT_PAYLOAD_OFF  "ON"