elad-bar / DahuaVTO2MQTT

Listens to events from Dahua VTO unit and publishes them via MQTT Message
103 stars 39 forks source link

Code proposal for ability to unlock 2nd door for DEE1010B device !! NOT TESTED !! #34

Closed Thanouz closed 3 years ago

NimlothPL commented 3 years ago

This will mostly work ... but I don't think that it's cleanest solution.

Function should be only one, which is already implemented - Door 1 or Door 2 should be controlled using Payload, i.e. Door 1 - Payload 1 Door 2 - Payload 2

tof92130 commented 3 years ago

I use this shell ommand from HA to unlock the door :

open_door: 'curl -s --globoff --digest --user : "http:///cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Remote"'

elad-bar commented 3 years ago

@Thanouz, according to the title it wasn't test, can you confirm that the parameter in the url is the correct one? I would like to implement it as @NimlothPL suggested using a payload with the parameter instead of different topic, in case the payload will be empty, it will go to default which is Door 1

thanks

Thanouz commented 3 years ago

Yep I'm sure :-)

elad-bar commented 3 years ago

@Thanouz, thanks for the PR suggestion, I implemented it bit differently using payload rather an additional topic, you can use the same topic without payload, it will open door 1, in case payload will contain the door number, it will open it up, Open door 1:

{
  "Door": 1
}

Open door 2:

{
  "Door": 2
}