Working with time series data in Node Red with SQLite
Csongor Varga
View ChannelAbout
Home automation, Node-Red, Influxdb, Grafana, Model railways, electronics, DIY and work related stuff
Latest Posts
Video Description
This video is going to be a first in a series on how to collect, display and aggregate time series data in Node Red. In this video I am using SQLite to store data, phpLiteAdmin for the basic database administrative activities. I discuss a few topics in this video: 1) How to store multiple data points in the table: generate multiple INSERT INTO 2) Back up dashboard graph state to a file and restore on startup. 3) Example on how to aggregate data stored in database: get max, min and last values daily and store aggregated values separately. 4) Generate graphs from values stored in the database using multiple data points in a single graph. Flows shown in the video are available here: http://flows.nodered.org/flow/36f2de38ed4bb62cf3a5e8fdc76d779e Create SQL commands: CREATE TABLE 'sensor_aggr' ('epoch' INTEGER NOT NULL, 'device' TEXT NOT NULL, 'sensor' TEXT NOT NULL, 'value' REAL, PRIMARY KEY ('epoch', 'device', 'sensor')) CREATE TABLE 'sensor_data' ('id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 'device' TEXT, 'sensor' TEXT,'value' REAL,'epoch' INTEGER, 'timestamp' INTEGER DEFAULT CURRENT_TIMESTAMP)
Essential Gear for Photographers
AI-recommended products based on this video

COTUBLR 31 Inch Computer Desk, Home Office Desk, Simple Modern Small Desk for Bedroom, Writing Desk with Storage Bag, Study Table for Students, Grey Oak

Birosnsy Digital Camera 4K 50MP with 32GB SD Card 2.88" IPS LCD Screen Auto Focus 16xDigital 9 Shooting Modes Zoom Entry Beginner 0.23LB HD Portable Mini Camera(Black, Batteries X2, Charging Head X1)

FYOUNG Upgrade Cooling Fan Stand &Controller Charging Station for Xbox Series X with 15RGB Light, Charger Dock for Console Accessories Storage with 2 Rechargeable Batteries, 3-Levels Fan Cooler System

Dell P2425H Computer Monitor Screen 24" 16:9 IPS Display 100Hz w/Stand - 1 Year Warranty, Full HD, 1920 x 1080 with Power Cord + DisplayPort Cable + HDMI Cable + USB 3.0 Cable + Microfiber Cloth

4 Pack Rechargeable Batteries for Xbox Series X|S Controller,Charger Dock with 4 x 3600mWh NiMH Battery for Xbox One/Xbox Series X|S,Xbox One S/X/Elite Wireless Controller

Kaiess 62" Tripod for iPhone, Selfie Stick Tripod & Phone Tripod Stand with Remote, Cell Phone Tripod for iPhone, Extendable Travel Tripod Compatible with iPhone 14/13/12 Pro Max/Android

SmallRig ZV-E1 Camera Baseplate for Sony ZV-E1, Built-in Cold Shoe Mount and QR Plate (for Arca) Quick Switch Between Tripod and Stabilizer for DJI RS 2 / RSC 2 / RS 3 / RS 3 Pro - 4314

SmallRig Baseplate for Sony Alpha 6700, Bottom Mount Plate Built-in Quick Release Plate for Arca, Supporting Quick Switch Between Tripod and Stabilizer (for DJI RS 2 / RSC 2 / RS 3 / RS 3 Pro) - 4338

SanDisk 64GB Extreme PRO SDXC UHS-I Memory Card - C10, U3, V30, 4K UHD, SD Card - SDSDXXU-064G-GN4IN

SanDisk 128GB Extreme PRO SDXC UHS-I Memory Card - C10, U3, V30, 4K UHD, SD Card - SDSDXXD-128G-GN4IN

Lexar 128GB Micro SD Card, microSDXC UHS-I Flash Memory Card with Adapter - Up to 100MB/s, A1, U3, Class10, V30, High Speed TF Card

Anker USB C Charger Cable (6ft 100W, 2Pack), USB 2.0 Type C Fast Charging Cable for iPhone 15 / 15Pro / 15Plus / 15ProMax MacBook Pro 2020, iPad Pro 2020, iPad Air 4, Samsung Galaxy S23+/S23 Ultra ClimatePartner certified
![Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)](https://m.media-amazon.com/images/I/71N7xhCJnoL._AC_UL960_FMwebp_QL65_.jpg)
Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)

