# Logging a sensor value every second (1 Hz)

**URL:** <https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126>\
**Category:** Questions & Help\
**Tags:** homey-pro\
**Created:** [August 29, 2022, 9:51pm UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126 "2022-08-29T21:51:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![risoy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/risoy/32/55922_2.png) [@risoy](https://community.homey.app/u/risoy)\
**Post date:** [August 29, 2022, 9:51pm UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/1 "2022-08-29T21:51:14Z")

</div>

I have issues with my hot water and shall log the temperature every second for five minutes each hour of the day.

I should be set to accomplish this as I have a BLE water valve to turn on and off the water and a BLE temperature sensor with an external sensor.

How do I accomplish this in Homey Pro? I mean, how do I log and retrieve the data on a 1 Hz interval? Are there apps that can help me with this?

---

<div class="post-metadata">

**Author:** ![FKey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fkey/32/14793_2.png) [@FKey](https://community.homey.app/u/FKey)\
**Post date:** [August 30, 2022, 5:23am UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/2 "2022-08-30T05:23:58Z")

</div>

Have not seen posts about it for some time now. But homey does [disable flows that run “too often”](https://community.homey.app/t/how-to-stop-flows-disabled-functionaliteit-in-v2-05-rc2/10157)

[Insights](https://support.homey.app/hc/en-us/articles/360015370454-Viewing-charts-with-Homey-Insights) will show you sensor reading, but I dont know the rate.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [August 30, 2022, 5:29am UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/3 "2022-08-30T05:29:35Z")

</div>

I think the main issue here is not how to do the logging, but how to get the sensor working with Homey. If there isn’t a specific app for it, you can’t use it.

---

<div class="post-metadata">

**Author:** ![FKey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fkey/32/14793_2.png) [@FKey](https://community.homey.app/u/FKey)\
**Post date:** [August 30, 2022, 7:18pm UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/4 "2022-08-30T19:18:06Z")

</div>

> [@risoy](#):
>
> and a BLE temperature sensor with an external sensor.

Why should it be a BLE? Homey can handle others and still combine them with the BLE valve.

A [shelly](https://shelly.cloud/documents/user_guide/shelly_ht_app.pdf) can do the job  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/e/aef93451f8689596deea05a9e89e71df7948ec89.jpeg)

It does not measure at 1hz interval but at temperature changes.  
Should do the job too. If there is no measurement you know the te,persture is still the same.  
Shelly can handle 3 sensors so if you dont trust one you canmout in all 3 and have a triplecheck

---

<div class="post-metadata">

**Author:** ![risoy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/risoy/32/55922_2.png) [@risoy](https://community.homey.app/u/risoy)\
**Post date:** [August 30, 2022, 9:14pm UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/5 "2022-08-30T21:14:53Z")

</div>

The sensors don’t have to be BLE - I just happen to have two:

- Temp: [S1 Temperature Humidity Sensor For Real-time Monitoring | Minew](https://www.minew.com/product/s1-temp-and-humidity-sensor/)
- Valve: [SmartLife Water Control | Bluetooth® | Battery Powered | IP54 | Maximum water pressure: 8 bar | Android™ / IOS](https://nedis.com/en-us/product/smart-home/domestic/pets-garden/550753050/smartlife-water-control-bluetooth-battery-powered-ip54-maximum-water-pressure-8-bar-android-ios)

I have yet to connect them to Homey Pro as I would like to devise a plan on how to collect the data first. It seems there are no apps dedicated to these specific devices.

But say I would be able to connect them; how would I go about collecting the data on a 1-second interval? Information on flows auto-disabling seems to be a bit unclear.

---

<div class="post-metadata">

**Author:** ![FKey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fkey/32/14793_2.png) [@FKey](https://community.homey.app/u/FKey)\
**Post date:** [August 30, 2022, 9:30pm UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/6 "2022-08-30T21:30:56Z")

</div>

> [@risoy](#):
>
> how would I go about collecting the data on a 1-second

Insights (see my post above) will log the data of your sensor automatically.  
It will be dependend of the update-rate of your sensor how often it is logged. (Insights logs when a sensor is updated)

Not sure if insights is limited for logging…  
This is what my shelly looks like in insights (buildin behaviour of home, no need to do anything)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/7/978a3f76553ed8884f42ff65e556e7d84eb7df42.jpeg)

---

<div class="post-metadata">

**Author:** ![risoy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/risoy/32/55922_2.png) [@risoy](https://community.homey.app/u/risoy)\
**Post date:** [August 30, 2022, 9:47pm UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/7 "2022-08-30T21:47:59Z")

</div>

I see. I worried the Insights feature was not suitable for 1 Hz, but if it’s up to my sensor polling then I will focus on that.

I will look into it. Thanks!

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [August 31, 2022, 9:48am UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/8 "2022-08-31T09:48:00Z")

</div>

A possible solution could be:

- start a flow with a default time trigger (every x minutes/hours).
- Use the Chronograph app to start a transition (60 steps during 1min).
- React on the transition steps with a second flow

In this flow you can log the data:

- Using Papertrail log into a local log
- Using MySQL client to log into a SQL database

If you are using the global date/time tags, you probably will only have date and time values with mm:ss.  
To get a correct relation to your transition steps, you have to log these steps in addition to date/time.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 31, 2022, 12:55pm UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/9 "2022-08-31T12:55:11Z")

</div>

Additional: Papertrails has these timestamp choices for precise logging:

 ![Screenshot_20220831-143958_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/e/7eaef68b83a299aca6587e56e3c53bb80abb6ae6.jpeg)

 ![Screenshot_20220831-143736_Chrome](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/9/5900e4f9af1a15a73ad22e475f4b210eefce46f1.jpeg)

---

<div class="post-metadata">

**Author:** ![risoy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/risoy/32/55922_2.png) [@risoy](https://community.homey.app/u/risoy)\
**Post date:** [September 1, 2022, 7:58am UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/10 "2022-09-01T07:58:16Z")

</div>

Thanks! That sounds interesting. What is the definition of a ‘transition’?

---

<div class="post-metadata">

**Author:** ![risoy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/risoy/32/55922_2.png) [@risoy](https://community.homey.app/u/risoy)\
**Post date:** [September 1, 2022, 7:58am UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/11 "2022-09-01T07:58:45Z")

</div>

Thanks! That is useful.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [September 1, 2022, 8:16am UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/12 "2022-09-01T08:16:23Z")

</div>

For a transition you define a range (from…to) and the number of steps in a timerange. The app is firering a flow trigger for everery step.  
Your case would be: from 0 to 59 in 60 steps in 1 minute.

I use this for a wake-up light.

Start flow

 ![Screenshot_20220901-100741_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/3/03c26f87369d8d9d17348c600f1e8d320a8707c5.jpeg)

Trigger for steps:

 ![Screenshot_20220901-100751_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/e/5e474236d6469ae22b8097836bad911097a8aefe.jpeg)

Action for every step.

 ![Screenshot_20220901-100756_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/8/287a5dee6fbd0eba49a2542456f3170d7767bc7f.jpeg)

Sorry, german only 😅

---

<div class="post-metadata">

**Author:** ![risoy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/risoy/32/55922_2.png) [@risoy](https://community.homey.app/u/risoy)\
**Post date:** [September 2, 2022, 8:30pm UTC](https://community.homey.app/t/logging-a-sensor-value-every-second-1-hz/68126/13 "2022-09-02T20:30:04Z")

</div>

Great! Thanks. I will try this.
