Allow message to pass on the hour

Hello All,

I'm currently logging mqtt messages containing temperature and humidity data to an SQLite database. The messages come in every minute. All these messages are saved to a table which I will eventually set up pruning on.

I also have a second table that I only want to store 1 messages every hour. I have setup a limit node to handle this, however this is reset every time I deploy so can end up with multiple messages within an hour.

Is there a simple way to allow a message to pass between on the hour and 1 minute past the hour e.g. 08:00-08:01, 09:00-09:01. My concern with this still would be if the mqtt message failed to send for whatever then no reading for that hour.

Maybe a gate opens on the hour and after the 1st message it closes? Any recommendations would be appreciated.

I've simulated something like this which could work.

Any suggestions on something more efficient?

Thanks

Maybe something like this

[{"id":"c925fae5.01a53","type":"inject","z":"bf9e1e33.030598","name":"every hour","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"0 0-23 * * *","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":560,"wires":[["ef8d58a5.238ea8"]]},{"id":"ef8d58a5.238ea8","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"pass","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":560,"wires":[[]]},{"id":"dd30854.5a92f78","type":"inject","z":"bf9e1e33.030598","name":"mqtt every minute","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"*/1 0-23 * * *","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":660,"wires":[["fedb4145.387a58","8997dfc4.c66288"]]},{"id":"fedb4145.387a58","type":"switch","z":"bf9e1e33.030598","name":"","property":"pass","propertyType":"flow","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":720,"wires":[["4a6280d0.cb8be"]]},{"id":"4a6280d0.cb8be","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"pass","pt":"flow","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":720,"wires":[["439694c8.af0c44"]]},{"id":"8997dfc4.c66288","type":"debug","z":"bf9e1e33.030598","name":"minute","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":500,"y":660,"wires":[]},{"id":"439694c8.af0c44","type":"debug","z":"bf9e1e33.030598","name":"hour","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":670,"y":720,"wires":[]}]

Looks great, will give that a try. Thanks