Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Timestamp into string variable

$
0
0

@skitex wrote:

Hello,

I’m trying to add a timestamp to the camera.snapshots and send the image to a persistent notification. I would like to define the timestamp only once and put the timestamp in a string variable. Afterwards I would like to reuse that variable to send out the persistent notification.

When doing this I will have a unique photoname and it will not be subject on browsers image cache. I tried using the data_template within the persistent notification but I did not get it working.

The best thing I have right now is creating two camera snapshots, one for just archiving and one to use with the persistent notification.

Any help to get it working with defining the timestamp into a variable and re-using it in the persistent notication is welcome.

another working approach is also welcome

thanks in advance

stijn

- id: '1574603291945'
  alias: '[doorbell] push actions'
  description: ''
  trigger:
  - event_data:
      address: 1/5/4
      data: 1
    event_type: knx_event
    platform: event
  condition: []
  action:
  - data:
      message: Er is iemand aan de deur.
      title: Deurbel
    service: notify.notify
  - data:
      deviceID:
      - ipad_living
      entity_id: camera.cam_voordeur
      large: true
    service: browser_mod.more_info
  - data:
      filename: /config/www/camera/{{ now().strftime("%Y%m%d_%H%M%S") }}_snap_voordeur.jpg
    entity_id: camera.cam_voordeur
    service: camera.snapshot
  - delay: 00:00:02
  - data:
      filename: /config/www/camera/snap_voordeur.jpg
    entity_id: camera.cam_voordeur
    service: camera.snapshot
  - data:
      message: 'Er is iemand aan de deur: [foto voordeur](https://xxxxxxxxxxxxxxxxxxxxxxxxxxx.ui.nabu.casa/local/camera/snap_voordeur.jpg?{{now().second}})'
      title: Deurbel
    service: persistent_notification.create
  - delay: 00:01:00
  - service: browser_mod.close_popup

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles