# Home Assistant - Reolink Doorbell rich notification - Snapshot with timestamp + external link

**URL:** https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997
**Category:** General
**Tags:** home-assistant
**Created:** [3 September 2023 11:31 UTC](https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997 "2023-09-03T11:31:01Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Merwenus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/merwenus/32/41604_2.png) [@Merwenus](https://discourse.nodered.org/u/Merwenus)
#### Post date: [3 September 2023 11:31 UTC](https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997/1 "2023-09-03T11:31:01Z")

</div>

Hello,

I have a Reolink Wifi Doorbell, works fine but the **rich notification** has a cloud platform fee.  
So I decided to look for a solution and found one, but it has a flaw.

1. Internet decided to cache the image, that means when doorbell makes a snapshot and overwrite the previous one, it shows the previous picture, that means if Friend A ringed at 10AM and Friend B rings at 11AM I still get the image of Friend A. 🙂
2. Someone mentioned that I could use ?i= in the external link, but sadly I have no idea how to put a random number there.
3. The other and would be the best way to fix it, to make it use a timestamp like this: "YYYY.MM.DD - mm:ss", and as easy it seems I couldn't find a way how. Tried many ways and failed even more.

Can someone help my current flow to use timestamp on **snapshot** and the **external link** at the same time?

```auto
[{"id":"b83835ceaa08e8cc","type":"api-call-service","z":"b0334f5a6d891812","name":"Doorbell Snapshot","server":"f6a86a23.b6858","version":1,"debugenabled":false,"service_domain":"camera","service":"snapshot","entityId":"camera.doorbell_sub","data":"{\"filename\":\"/config/www/doorbell.jpg\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":490,"y":1300,"wires":[["d437d868d5f02bdb"]]},{"id":"0166a0488c01638c","type":"api-call-service","z":"b0334f5a6d891812","name":"Dani Csengő","server":"f6a86a23.b6858","version":1,"debugenabled":true,"service_domain":"notify","service":"mobile_app_m2102k1g","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":970,"y":1300,"wires":[[]]},{"id":"b25f8066f59ddfcb","type":"function","z":"b0334f5a6d891812","name":"Doorbell","func":"msg.payload = {\n data: {\n \"message\":\"Someone is ringing !\",\n \"data\":\n {\n \"image\": \"https://inter.net/local/doorbell.jpg?i=<random>\",\n \"channel\":\"Front Doorbell\",\n \"priority\":\"high\",\n \"ttl\": 0,\n \"actions\":\n [{\n \"action\": \"URI\",\n \"title\": \"Open Camera\",\n \"uri\": \"app://com.mcu.reolink\"\n }]\n }\n }\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":1300,"wires":[["0166a0488c01638c"]]},{"id":"ebf6961cd21e025a","type":"server-state-changed","z":"b0334f5a6d891812","name":"Doorbell Visitor","server":"f6a86a23.b6858","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.doorbell_visitor","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":230,"y":1330,"wires":[["b83835ceaa08e8cc"],[]]},{"id":"d437d868d5f02bdb","type":"stoptimer","z":"b0334f5a6d891812","duration":"1","units":"Second","payloadtype":"num","payloadval":"0","name":"1s","x":650,"y":1300,"wires":[["b25f8066f59ddfcb"],[]]},{"id":"f6419242b2bd1a3d","type":"inject","z":"b0334f5a6d891812","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":1280,"wires":[["b83835ceaa08e8cc"]]},{"id":"f6a86a23.b6858","type":"server","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

```

---

<div class="post-metadata">

### Author: ![Merwenus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/merwenus/32/41604_2.png) [@Merwenus](https://discourse.nodered.org/u/Merwenus)
#### Post date: [10 September 2023 13:05 UTC](https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997/2 "2023-09-10T13:05:10Z")

</div>

So this is really a hard thing to do 😃  
In some ways it makes me happy that I'm not THAT dumb and it is not a 30 sec fix 😉

---

<div class="post-metadata">

### Author: ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)
#### Post date: [10 September 2023 15:40 UTC](https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997/3 "2023-09-10T15:40:59Z")

</div>

Could also be that there are not too many having the same setup & combo like you; using HA, having a Reolink Doorbell and need to control it via NR

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [10 September 2023 16:08 UTC](https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997/4 "2023-09-10T16:08:46Z")

</div>

Try

```auto
msg.payload = {
    data: {
        "message":"Someone is ringing !",
        "data":
            {
            "image": "https://inter.net/local/doorbell.jpg?i=" + Math.random().toString().slice(2),
            "channel":"Front Doorbell",
            "priority":"high",
            "ttl": 0,
            "actions":
                [{
                "action": "URI",
                "title": "Open Camera",
                    "uri": "app://com.mcu.reolink"
                }]
            }
    }
}

return msg;

```

That should add a random number eg `https://inter.net/local/doorbell.jpg?i=8445158252631018`

Or for a unix timestamp in milliseconds you could use `new Date().getTime()`

Can not help with HA as not a user, sorry.

---

<div class="post-metadata">

### Author: ![Merwenus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/merwenus/32/41604_2.png) [@Merwenus](https://discourse.nodered.org/u/Merwenus)
#### Post date: [10 September 2023 16:29 UTC](https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997/5 "2023-09-10T16:29:14Z")

</div>

Well it is not depending on the hardware, Doing snapshot sending rich notification should work with all the devices, even with a security camera. 🙂  
The image caching is also independent from device.  
I'm not using NVR, just a doorbell + Wifi router + HomeAssistant 🙂

---

<div class="post-metadata">

### Author: ![Merwenus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/merwenus/32/41604_2.png) [@Merwenus](https://discourse.nodered.org/u/Merwenus)
#### Post date: [10 September 2023 16:31 UTC](https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997/6 "2023-09-10T16:31:33Z")

</div>

Thank you E1cid, found another way to save the snapshots, and with YOUR solution the rich notification works flawlessly! 😃

Thanks for the trip (and the proper syntax)!

---

<div class="post-metadata">

### Author: ![nodouser](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nodouser](https://discourse.nodered.org/u/nodouser)
#### Post date: [3 October 2023 14:04 UTC](https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997/7 "2023-10-03T14:04:01Z")

</div>

Can you share the solution?

---

<div class="post-metadata">

### Author: ![Merwenus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/merwenus/32/41604_2.png) [@Merwenus](https://discourse.nodered.org/u/Merwenus)
#### Post date: [3 October 2023 16:39 UTC](https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997/8 "2023-10-03T16:39:58Z")

</div>

It is a simple automation in Home Assistant.  
Gave up the NodeRed solution, because it seemed impossible to do.

Put this in configuration.yaml

```auto
input_text:
  doorbell_timestamp:
    name: Doorbell Timestamp

```

And this to the automation.yaml

```auto

- id: doorbell_snapshot
  alias: Doorbell Snapshot
  trigger:
  - platform: state
    entity_id: binary_sensor.doorbell_visitor
    to: 'on'
  action:
  - service: input_text.set_value
    entity_id: input_text.doorbell_timestamp
    data:
      value: '{{ now().strftime("%Y%m%d_%H%M%S") }}'
  - service: camera.snapshot
    entity_id: camera.doorbell_main
    data:
      filename: /config/www/Snapshots/Doorbell_{{ states.input_text.doorbell_timestamp.state }}.jpg

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [2 December 2023 16:40 UTC](https://discourse.nodered.org/t/home-assistant-reolink-doorbell-rich-notification-snapshot-with-timestamp-external-link/80997/9 "2023-12-02T16:40:52Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
