Using Node Red's function node and HA's event bus to add extra functionality to Dahua Security Cameras and Recorders

This project shows how to utilize the additional data that is sent with a dahua event. This flow:

  1. Creates payload for snapshot call.
  2. Covers all supported event types. see here
  3. Numbers snapshot (allows multiple snapshots per message type before rewrite).
  4. Stores snapshot in different folders according to camera and trigger type.
  5. Creates payload for text including snapshot file location.
  6. Creates payload for separate tts message.
  7. Bounces duplicate and stop messages.
  8. Rate limit by event and camera number.
  9. Retrieve phone state, bounce tts message if on phone.
  10. Create multiple zone triggers per camera.(See below)

Dahua cameras offer other information in the event data. Target location and direction of travel among other things. Sample JSON included in flow file. (see github page below)

More details can be found here: