# Sensor data upon start

**URL:** <https://discourse.nodered.org/t/sensor-data-upon-start/27003>\
**Category:** General\
**Created:** [20 May 2020 21:50 UTC](https://discourse.nodered.org/t/sensor-data-upon-start/27003 "2020-05-20T21:50:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)\
**Post date:** [20 May 2020 21:50 UTC](https://discourse.nodered.org/t/sensor-data-upon-start/27003/1 "2020-05-20T21:50:45Z")

</div>

I suspect this is the wrong forum to ask this, and it's probably device-specific, but is there a way to "prod" sensors to send their complete data set when NR starts up? I'm using Hubitat via MQTT.

Thanks

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 May 2020 21:54 UTC](https://discourse.nodered.org/t/sensor-data-upon-start/27003/2 "2020-05-20T21:54:31Z")

</div>

Do you have control over the produce commands? If you set the MQTT publish commands to "retain" then when node-red starts and MQTT subscriptions occur, you'll get latest values.

Alternatively, you can store the values yourself in file backed store and load from this file on node-red start.

Finally, you could re-publish the mqtt values to new topics and add the retain option. Then use the new topics in your project.

---

<div class="post-metadata">

**Author:** ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)\
**Post date:** [20 May 2020 22:01 UTC](https://discourse.nodered.org/t/sensor-data-upon-start/27003/3 "2020-05-20T22:01:41Z")

</div>

Thank you. Using retain may be just the ticket.

---

<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:** [3 June 2020 22:01 UTC](https://discourse.nodered.org/t/sensor-data-upon-start/27003/4 "2020-06-03T22:01:42Z")

</div>

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