esprfid / esp-rfid

ESP8266 RFID (RC522, PN532, Wiegand, RDM6300) Access Control system featuring WebSocket, JSON, NTP Client, Javascript, SPIFFS
MIT License
1.35k stars 423 forks source link

Receive MQTT Commands #102

Closed Schnittcher closed 6 years ago

Schnittcher commented 6 years ago

It would be nice if you could execute commands via MQTT to switch the relay. Is that planned?

omersiar commented 6 years ago

Can you share how can it be used?

Schnittcher commented 6 years ago

Yes, i want to integrate it in our Smart Home, and I want to implement the user accesses there.

quikote commented 6 years ago

+1 I would like to operate de door from Home Assistant using MQTT, so I need to send a MQTT message from my home controller to activate the lock as a allowed RFID card was readed

omersiar commented 6 years ago

You can always send WebSocket messages.

Schnittcher commented 6 years ago

This is okay. I will test it. Thanks. Can you give me an example?

Schnittcher commented 6 years ago

I found the testrelay command and userlist command, so I can control the relay and list all users. Can you still tell me how I can add users?

omersiar commented 6 years ago

"command": "userfile" is the for adding new user.

omersiar commented 6 years ago

Did you managed to send WebSocket commands via Home Assistant?

quikote commented 6 years ago

I don't know how to.... :-(((

omersiar commented 6 years ago

Currently we have WebUI to setup everything. MQTT was never an intended feature to support, It will take longer to support incoming mqtt commands. Closing this for now.

zuhra031 commented 6 years ago

@omersiar Can you provide WebSocket commands?

I would like to trigger relay from OpenHab2 or via local web server or anything else as long as I don't need to login every time into esp to open door remotely (click on relay test btn).

Edit: idea for improvement: trigger relay test and add to log when received specific mqtt msg on specific topic, eq. "frontdoor/eps-rfid/relay/" and msg "testRelay"