dahua icon indicating copy to clipboard operation
dahua copied to clipboard

Detect Open door via DMSS and RFID

Open flyingpeter opened this issue 2 years ago • 10 comments

Hi!

first of all congratulations for this repo. I was using the other Hacs repo, that worked great but it was more “manual” then yours. I noticed that the other one detected the door open calls from DMSS or from the RFID reader on the VTO.

Can you add it to home assistant also as a device?

When I open the door via the app or via thw RFID it was supposed to detect in the log. I think it’s number 8.

Is your repo able to do it and I didn’t figure out how?

thanks in advance,

pedro

flyingpeter avatar Aug 21 '23 01:08 flyingpeter

i can confirm that the RFID value shows in the Event bus for my vto2211g-wp. but it don´t display as sensor or attribute

lleonardos avatar Aug 21 '23 18:08 lleonardos

Thanks for your answer!

I got ir working wit the other Dahua repo.

It would be interesting to have a sensor to log the openings.

Do you consider to add it?

If not, does this work with your repo:

  • alias: Dahua VTO All Events mode: queued trigger:

    • platform: event event_type: dahua_vto action:
    • service: persistent_notification.create data: title: "{{ trigger.event.data.Code if trigger.event.data.Code is defined else 'Unknown Code' }}" message: "{{ trigger.event.data }}"
  • alias: Dahua VTO Command Result mode: queued trigger:

    • platform: event event_type: dahua_vto condition:
    • condition: template value_template: "{{ trigger.event.data.method is defined }}" action:
    • service: persistent_notification.create data: title: "{{ trigger.event.data.method }}" message: "{{ trigger.event.data }}"
  • alias: Dahua VTO mode: queued trigger:

    • platform: event event_type: dahua_vto event_data: Code: BackKeyLight action:
    • choose:
      • conditions: > {{ trigger.event.data.Data.State | int in [0, 1, 2, 5, 6] }} sequence:
        • service: persistent_notification.create data: title: "{{ 'Doorbell Ring' if trigger.event.data.Data.State | int in [1, 2] else 'Doorbell No Ring' }}" message: "{{ trigger.event.data }}"
      • conditions: > {{ trigger.event.data.Data.State | int == 8 }} sequence:
        • service: timer.start data: entity_id: timer.door_lock duration: 00:00:02 # VTO Unlock Period
        • service: persistent_notification.create data: title: Unlock message: "{{ trigger.event.data }}"
      • conditions: > {{ trigger.event.data.Data.State | int == 9 }} sequence:
        • service: persistent_notification.create data: title: Unlock failed message: "{{ trigger.event.data }}"
      • conditions: > {{ trigger.event.data.Data.State | int == 11 }} sequence:
        • service: persistent_notification.create data: title: Device rebooted message: "{{ trigger.event.data }}" default:
      • service: persistent_notification.create data: title: "Unknown state {{ trigger.event.data.Data.State | int }}" message: "{{ trigger.event.data }}"

Right?

Best regards,

Pedro Andrade

No dia 21/08/2023, às 19:25, Lorenzo Leonardos @.***> escreveu:



i can confirm that the RFID value shows in the Event bus for my vto2211g-wp. but it don´t display as sensor or attribute

— Reply to this email directly, view it on GitHubhttps://github.com/rroller/dahua/issues/298#issuecomment-1686819178, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC7QCGBEOWAPBX7CCYKH5OLXWOR3FANCNFSM6AAAAAA3XUU2ME. You are receiving this because you authored the thread.Message ID: @.***>

flyingpeter avatar Aug 22 '23 03:08 flyingpeter

what repo did you use?

lleonardos avatar Aug 22 '23 13:08 lleonardos

[image0.png] Now o use yours. But previously I was using Dahua vto. It worked pretty well but I had to intercept manually the events.

Suddenly I stoped working a couple of weeks ago for me. That’s why I searched again and I found yours!:)

Pedro Andrade

No dia 22/08/2023, às 14:22, Lorenzo Leonardos @.***> escreveu:



what repo did you use?

— Reply to this email directly, view it on GitHubhttps://github.com/rroller/dahua/issues/298#issuecomment-1688179773, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC7QCGDZHYHZJXBQ4OJKAULXWSXAVANCNFSM6AAAAAA3XUU2ME. You are receiving this because you authored the thread.Message ID: @.***>

flyingpeter avatar Aug 22 '23 13:08 flyingpeter

Hey i got it working like i had before. With event detector. If number 8 it door was unlocked.

flyingpeter avatar Sep 04 '23 19:09 flyingpeter

Hey i got it working like i had before. With event detector. If number 8 it door was unlocked.

flyingpeter avatar Sep 04 '23 19:09 flyingpeter

Hey i got it working like i had before. With event detector. If number 8 it door was unlocked.

Can you share the event code for HA? Not quite sure where to put the status as per the manual beneath

platform: event event_type: dahua_event_received event_data: name: Cam13 Code: BackKeyLight action: Start

moskovskiy82 avatar Nov 24 '23 06:11 moskovskiy82

Like this: '{{ trigger.event.data.Data.State | int == 8 }}' ?

flyingpeter avatar Nov 24 '23 13:11 flyingpeter

Like this: '{{ trigger.event.data.Data.State | int == 8 }}' ?

It's even easier

#318

moskovskiy82 avatar Nov 24 '23 20:11 moskovskiy82

I only understood now what you wanted:

alias: Dahua Opening Sniffer trigger:

  • platform: event event_type: dahua_event_received condition: [] action:
  • choose:
    • conditions: "{{ trigger.event.data.Data.State | int == 8 }}" sequence:
      • service: persistent_notification.create data: title: Dahua VTO message: Portão Aberto
      • type: turn_on device_id: 41fa0590e3a7a367f entity_id: switch.gate_open domain: switch mode: queued

flyingpeter avatar Nov 24 '23 22:11 flyingpeter