# How does declare() related to TR-069 RPCs?

**URL:** <https://forum.genieacs.com/t/how-does-declare-related-to-tr-069-rpcs/4019>\
**Category:** Uncategorized\
**Created:** [June 8, 2023, 9:44am UTC](https://forum.genieacs.com/t/how-does-declare-related-to-tr-069-rpcs/4019 "2023-06-08T09:44:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpcraft](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@mpcraft](https://forum.genieacs.com/u/mpcraft)\
**Post date:** [June 8, 2023, 9:44am UTC](https://forum.genieacs.com/t/how-does-declare-related-to-tr-069-rpcs/4019/1 "2023-06-08T09:44:52Z")

</div>

I’ve read [docs of provision](http://docs.genieacs.com/en/latest/provisions.html#provisions) but i’m still not sure if i’m using `declare()` correctly. By my understanding, `declare()` would be converted into different TR-069 RPCs when given different arguments, e.g.:

- `declare(path, timestamps, null)`, timestamps are **higher** than last refreshed = GPV/GPA
- `declare(path, timestamps, null)`, timestamps are **lower** than last refreshed = read from cache
- `declare(path, null, values)` = SPV/SPA

Is that correct?

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [June 8, 2023, 4:46pm UTC](https://forum.genieacs.com/t/how-does-declare-related-to-tr-069-rpcs/4019/2 "2023-06-08T16:46:33Z")

</div>

If the timestamp given is newer than the last refresh timestamp for a param the ACS will do a GPV/SPV.

---

<div class="post-metadata">

**Author:** ![rudymartin](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@rudymartin](https://forum.genieacs.com/u/rudymartin)\
**Post date:** [June 8, 2023, 4:49pm UTC](https://forum.genieacs.com/t/how-does-declare-related-to-tr-069-rpcs/4019/3 "2023-06-08T16:49:06Z")

</div>

example found on forum search:

> [@Pushing specific parameters value](https://forum.genieacs.com/t/pushing-specific-parameters-value/2111/9):
>
> For the second param, you can also put in a path parameter. This will cause GenieACS to refresh the path if the timestamp is older than the given value. const twoDaysAgo = Date.now() - (86400 \* 2); const oneDayAgo = Date.now() - 86400; declare('Some.Path', { path: twoDaysAgo, value: oneDayAgo}, {value: 'someValue'}); This will cause GenieACS to refresh the path if its older than two days, or refresh the value if its older than 1 day.

---

<div class="post-metadata">

**Author:** ![mpcraft](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@mpcraft](https://forum.genieacs.com/u/mpcraft)\
**Post date:** [June 9, 2023, 1:16am UTC](https://forum.genieacs.com/t/how-does-declare-related-to-tr-069-rpcs/4019/4 "2023-06-09T01:16:55Z")

</div>

Does it mean when _timestamp given is newer than the last refresh timestamp_:

- if `values` is given: SPV/SPA/AO/DO
- if `values` is null: GPV/GPA/GPN

for `value` is SPV/GPV, for `object`/`writable` is SPA/GPA/GPN, for `path` is AO/DO

and when `timestamp` is null, by default it works like `Data.now()` is given.
