Currentmillis sensor

Having an issue with a json rest sensor the URL requires a time in milliseconds at the end of the URL. I’ve “?date=1594773533278” clearly this has to be within 5 mins of the current time.

I don’t know how to provide this url with the currentmillis. Any advice?

1 Like

used {{ (now().timestamp() | int * 1000 ) }} solved the issue. thanks for the help :joy:

1 Like

@xbecomingx how did you pass it to the url? could you please explain further

i used a rest api

sensor:
  - platform: rest
    name: "name"
    scan_interval: 5
    resource_template: https://blah.blah/list?date={{ (now().timestamp()  | int  * 1000 ) }}
    value_template: '{{ value_json.list[0].username }}'