Inserting a time format to influxdb - 8:45:00

Hey All,
I'm using the Hourglass Pallet to record how many hours I have a fire in my Rocket Mass Heater each day. At just before midnight I want to send the daily burn time to influxdb and graph it. I'm able to do this when I just send the hrs burned but not the minuets.

I wrote a function to merge the time format to a payload that looks like this, 8:45:00

This makes it to influxdb. I know this because I see the variable in Grafana. However when I try to graph it in Grafana it says there is no data. I've set the units to "time duration HH:MM:SS

How can I grafana to recognize this data?

In the influx node set the timestamp resolution to milliseconds, then set the value of the time field to the JavaScript Date milliseconds of the start of the hour.

Sorry, I meant to say the milliseconds for whatever time you want.

To build on Colin's answer, what you have done I believe is give InfluxDB some TEXT rather than a number which is what it needs to be able to calculate on. Values should pretty much always be numbers in InfluxDB.

hmm, still struggling. Here is my flow

[
    {
        "id": "b36e6ffdfe2e4a84",
        "type": "inject",
        "z": "0e9443b6465b78e6",
        "g": "67afd73c146e47be",
        "name": "hrs burned to database",
        "props": [
            {
                "p": "payload[0]",
                "v": "hrsBurned",
                "vt": "flow"
            },
            {
                "p": "payload[1]",
                "v": "minsBurned",
                "vt": "flow"
            }
        ],
        "repeat": "",
        "crontab": "58 23 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 250,
        "y": 1080,
        "wires": [
            [
                "054a17241739ac59"
            ]
        ]
    },
    {
        "id": "054a17241739ac59",
        "type": "function",
        "z": "0e9443b6465b78e6",
        "g": "67afd73c146e47be",
        "name": "function 26",
        "func": "let hrs = parseFloat(msg.payload[0]);\nlet mins = parseFloat(msg.payload[1]);\nmsg.payload = ((hrs) + \":\" + (mins) + \":00\");\nreturn msg; ",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 1080,
        "wires": [
            [
                "80d14ec3802dc722",
                "078dd60bd49ba231"
            ]
        ]
    },
    {
        "id": "80d14ec3802dc722",
        "type": "debug",
        "z": "0e9443b6465b78e6",
        "g": "67afd73c146e47be",
        "name": "debug 467",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 790,
        "y": 1080,
        "wires": []
    },
    {
        "id": "078dd60bd49ba231",
        "type": "influxdb out",
        "z": "0e9443b6465b78e6",
        "g": "67afd73c146e47be",
        "influxdb": "e5928bcbfeb0bb32",
        "name": "",
        "measurement": "hrsMinsSecBurned",
        "precision": "ms",
        "retentionPolicy": "",
        "database": "database",
        "precisionV18FluxV20": "ms",
        "retentionPolicyV18Flux": "",
        "org": "organisation",
        "bucket": "bucket",
        "x": 880,
        "y": 1000,
        "wires": []
    },
    {
        "id": "e5928bcbfeb0bb32",
        "type": "influxdb",
        "hostname": "127.0.0.1",
        "port": "8086",
        "protocol": "http",
        "database": "rmhHighLow",
        "name": "rmhHighLow",
        "usetls": false,
        "tls": "d50d0c9f.31e858",
        "influxdbVersion": "1.x",
        "url": "http://localhost:8086",
        "rejectUnauthorized": true
    },
    {
        "id": "d50d0c9f.31e858",
        "type": "tls-config",
        "name": "",
        "cert": "",
        "key": "",
        "ca": "",
        "certname": "",
        "keyname": "",
        "caname": "",
        "servername": "",
        "verifyservercert": false
    }
]

Not really clear where you are now struggling. But note that if you've written text values to the db but now want numbers, you have to start over, I think that once Influx gets a specific data type for a value, it can't be later changed.

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