Influxdb error importing Json

I'm trying to import a NodeRed json from github. This on my raspberry pi with domoticz.
Het Json comes from HeishaMon/Integrations/Domoticz at master · Egyras/HeishaMon (github.com)

I've followed all steps, installed influxdb, but during import i get the following error:
image

Any clue where to look further?

Welcome to the forum @MikeyMan83

Restart node red and then refresh the editor page in the browser and try again.

If still not working, stop node red and start it again in a terminal and post the full terminal output here. Copy/paste, not screen shot.

Thanks @Colin. Restarted the Pi a couple of times, which incidentally removed the imported stuff.

code looks like this:

pi@raspberrypi:~/.node-red $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://10.0.0.30:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
25 Aug 13:38:25 - [info]
Welcome to Node-RED
===================
25 Aug 13:38:25 - [info] Node-RED version: v3.0.2
25 Aug 13:38:25 - [info] Node.js  version: v16.17.0
25 Aug 13:38:25 - [info] Linux 5.10.103-v7+ arm LE
25 Aug 13:38:27 - [info] Loading palette nodes
25 Aug 13:38:31 - [info] Settings file  : /home/pi/.node-red/settings.js
25 Aug 13:38:31 - [info] Context store  : 'default' [module=memory]
25 Aug 13:38:31 - [info] User directory : /home/pi/.node-red
25 Aug 13:38:31 - [warn] Projects disabled : editorTheme.projects.enabled=false
25 Aug 13:38:31 - [info] Flows file     : /home/pi/.node-red/flows.json
25 Aug 13:38:31 - [info] Creating new flow file
25 Aug 13:38:31 - [warn] Using unencrypted credentials
25 Aug 13:38:31 - [info] Starting flows
25 Aug 13:38:31 - [info] Started flows
25 Aug 13:38:31 - [info] Server now running at http://127.0.0.1:1880/

I don't know if this is the cause of the problem, but you shouldn't generally use sudo npm install ... and the instructions for node-red-contrib-influxdb don't have sudo

I suggest you try this:

cd ~/.node-red
sudo npm uninstall node-red-contrib-influxdb
sudo systemctl restart nodered
npm install node-red-contrib-influxdb
sudo systemctl restart nodered

(I'm not certain if you need to restart node-red if you install from the command line but it can't hurt!)
Then try importing your json file again.

That seemed to have solved it. Weird, because i started off without sudo and tried to correct it with sudo afterwards.

Is it restarting at boot now as well then?

Don't get an error now, but dont see a flow either. I'll have to check whats happening here.

Getting another error now though. Global function is not working it seems.

Did you uninstall the version on the influx node before installing it again?
If not uninstall both (to be sure) then reinstall not using the ‘sudo’ command and restart NR and see what happens.

Please explain what is not working

@zenofmud Its possibly not related, but this is the error i get:

image

With a bit of searching, it got me to:
image

[{"id":"6f1bd5f9.4cdd9c","type":"tab","label":"HeishaMon","disabled":false,"info":""},{"id":"1279ec70.ed6354","type":"mqtt in","z":"6f1bd5f9.4cdd9c","name":"MQTT HeishaSensor","topic":"panasonic_heat_pump/main/#","qos":"2","datatype":"auto","broker":"2298f8af.6176e8","inputs":0,"x":200,"y":300,"wires":[["14572908.cd7c9f"]]},{"id":"14572908.cd7c9f","type":"function","z":"6f1bd5f9.4cdd9c","name":"Map sensor to ID","func":"// if there's an entry in the global defined variable then \n// the value needs to be saved (send) to next function \nvar sensorsplit = msg.topic.split(\"/\");\nvar sensor = sensorsplit[sensorsplit.length-1];\n \nvar sensorvalue = msg.payload;\nfor (i = 0; i < context.global.heishamon.SensorMapping.length; i++) {\n    // when sensor is in the global settings \n    msg.sensor = sensor;\n    if(sensor == context.global.heishamon.SensorMapping[i][0]){\n//        node.warn(context.global.heishamon.SensorMapping[i]);\n        // add the home automation ID/name \n        msg.HAid = context.global.heishamon.SensorMapping[i][1];\n\n        // add type (if it exists):\n        if(context.global.heishamon.SensorMapping[i][2]){\n            msg.type = context.global.heishamon.SensorMapping[i][2];\n        }    \n        return msg;\n    }\n}\nreturn;","outputs":1,"noerr":0,"x":470,"y":300,"wires":[["c33d4c1c.9461f8"]]},{"id":"5a304122.7f39e8","type":"function","z":"6f1bd5f9.4cdd9c","name":"global setup","func":"if (!context.global.heishamon) {\n  context.global.heishamon = {};\n}\n\n// write down the Home Automation applications used\n// Possible values: Domoticz, InfluxDB, openHAB, HomeAssistant\n// comma seperated and case sensitive\ncontext.global.heishamon.HAapplication = \"Domoticz, InfluxDB\";\n\n\n//This is the overview of sensors which has to be sent to the Home Automation system\ncontext.global.heishamon.SensorMapping = [\n        // [\"name of topic\", \"IDx in Domoticz/Name in Home Assistant/ ?? openHAB ??\"]\n            [\"Heatpump_State\", 382, \"Switch\"],\n            [\"Pump_Flow\", null],\n            [\"Force_DHW_State\", null, \"Selector Switch\"], //DHW status (20=off, 10=on 0=unknown)\n            [\"Quiet_Mode_Schedule\", null, \"Switch\"],\n            [\"Operating_Mode_State\", null, \"Selector Switch\"], //7 levels - (0=Heat only, 10=Cool only, 20=Auto, 30=DHW only, 40=Heat+DHW, 50=Cool+DHW, 60=Auto+DHW)\n            [\"Main_Inlet_Temp\", null],\n            [\"Main_Outlet_Temp\", null], \n            [\"Main_Target_Temp\", null],\n            [\"Compressor_Freq\", null],\n            [\"DHW_Target_Temp\", null],\n            [\"DHW_Temp\", null],\n            [\"Operations_Hours\", null],\n            [\"Operations_Counter\", null],\n            [\"Main_Schedule_State\", null, \"Switch\"],\n            [\"Outside_Temp\", null],\n            [\"Heat_Energy_Production\", null],\n            [\"Heat_Energy_Consumption\", null],\n            [\"Powerful_Mode_Time\", null, \"Selector Switch\"], //  4 levels -- 0= off - 10= 30 Minute - 20= 60 Minute - 30= 90 Minute //0= off, 30 = level 3\n            [\"Quiet_Mode_Level\", null, \"Selector Switch\"], // 4 levels -- 0= off - 10= Silent 1 - 20= Silent 2 - 30= Silent 3\n            [\"Holiday_Mode_State\", null, \"Switch\"],\n            [\"ThreeWay_Valve_State\", null, \"Selector Switch\"], // 2 levels -- 0=Room, 10=DHW\n            [\"Outside_Pipe_Temp\", null],\n            [\"DHW_Heat_Delta\", null],\n            [\"Heat_Delta\", null],\n            [\"Cool_Delta\", null],\n            [\"DHW_Holiday_Shift_Temp\", null],\n            [\"Defrosting_State\", null, \"Switch\"],\n            [\"Z1_Heat_Request_Temp\", null, \"Thermostat\"],\n            [\"Z1_Cool_Request_Temp\", null],\n            [\"Z1_Heat_Curve_Target_High_Temp\", null],\n            [\"Z1_Heat_Curve_Target_Low_Temp\", null],\n            [\"Z1_Heat_Curve_Outside_High_Temp\", null],\n            [\"Z1_Heat_Curve_Outside_Low_Temp\", null],\n            [\"Room_Thermostat_Temp\", null],\n            [\"Z2_Heat_Request_Temp\", null],\n            [\"Z2_Cool_Request_Temp\", null],\n            [\"Z1_Water_Temp\", null],\n            [\"Z2_Water_Temp\", null],\n            [\"Cool_Energy_Production\", null],\n            [\"Cool_Energy_Consumption\", null],\n            [\"DHW_Energy_Production\", null],\n            [\"DHW_Energy_Consumption\", null],\n            [\"Z1_Water_Target_Temp\", null],\n            [\"Z2_Water_Target_Temp\", null],\n            [\"Error\", null],\n            [\"Room_Holiday_Shift_Temp\", null],\n            [\"Buffer_Temp\", null],\n            [\"Solar_Temp\", null],\n            [\"Pool_Temp\", null],\n            [\"Main_Hex_Outlet_Temp\", null],\n            [\"Discharge_Temp\", null],\n            [\"Inside_Pipe_Temp\", null],\n            [\"Defrost_Temp\", null],\n            [\"Eva_Outlet_Temp\", null],\n            [\"Bypass_Outlet_Temp\", null],\n            [\"Ipm_Temp\", null],\n            [\"Z1_Temp\", 1702],\n            [\"Z2_Temp\", null],\n            [\"DHW_Heater_State\", null],\n            [\"Room_Heater_State\", null],\n            [\"Internal_Heater_State\", null],\n            [\"External_Heater_State\", null],\n            [\"Fan1_Motor_Speed\", null],\n            [\"Fan2_Motor_Speed\", null],\n            [\"High_Pressure\", null],\n            [\"Pump_Speed\", null],\n            [\"Low_Pressure\", null],\n            [\"Compressor_Current\", null],\n            [\"Force_Heater_State\", null, \"Switch\"],\n            [\"Sterilization_State\", null, \"Switch\"],\n            [\"Sterilization_Temp\", null],\n            [\"Sterilization_Max_Time\", null],\n            [\"Z1_Cool_Curve_Target_High_Temp\", null],\n            [\"Z1_Cool_Curve_Target_Low_Temp\", null],\n            [\"Z1_Cool_Curve_Outside_High_Temp\", null],\n            [\"Z1_Cool_Curve_Outside_Low_Temp\", null],\n            [\"Heating_Mode\", null],\n            [\"Heating_Off_Outdoor_Temp\", null],\n            [\"Heater_On_Outdoor_Temp\", null],\n            [\"Heat_To_Cool_Temp\", null],\n            [\"Cool_To_Heat_Temp\", null],\n            [\"Cooling_Mode\", null],\n            [\"Heat_To_Cool_Temp\", null],\n            [\"Z2_Heat_Curve_Target_High_Temp\", null],\n            [\"Z2_Heat_Curve_Target_Low_Temp\", null],\n            [\"Z2_Heat_Curve_Outside_High_Temp\", null],\n            [\"Z2_Heat_Curve_Outside_Low_Temp\", null],\n            [\"Z2_Cool_Curve_Target_High_Temp\", null],\n            [\"Z2_Cool_Curve_Target_Low_Temp\", null],\n            [\"Z2_Cool_Curve_Outside_High_Temp\", null],\n            [\"Z2_Cool_Curve_Outside_Low_Temp\", null],\n            [\"Room_Heater_Operations_Hours\", null],\n            [\"DHW_Heater_Operations_Hours\", null]\n    ];\n    \ncontext.global.heishamon.ActionMapping = [\n    // actioncommand, type, \"IDx in Domoticz/Name in Home Assistant/ ?? openHAB ??\" \n    [\"SetHeatpump\", \"Switch\", null],\n    [\"SetHoliday\", \"Switch\", null],\n    [\"SetQuietMode\", \"Selector Switch\", null],\n    [\"SetPowerfull\", \"Selector Switch\", null],\n    [\"SetZ1HeatRequestTemperature\", \"Thermostat\", 1702],\n    [\"SetZ1CoolRequestTemperature\", \"Thermostat\", null],\n    [\"SetZ2HeatRequestTemperature\", \"Thermostat\", null],\n    [\"SetZ2CoolRequestTemperature\", \"Thermostat\", null],\n    [\"SetOperationMode\", \"Selector Switch\", null],\n    [\"SetForceDHW\", \"Switch\", null],\n    [\"SetDHWTemp\", \"Thermostat\", null],\n    [\"SetCoolTemp\", \"Thermostat\", null],\n    [\"SetForceDefrost\", \"Switch\", null],\n    [\"SetForceSterilization\", \"Switch\", null]\n];\nreturn msg;","outputs":1,"noerr":1,"initialize":"","finalize":"","libs":[],"x":460,"y":120,"wires":[[]]},{"id":"b9850ca2.e3d7a8","type":"inject","z":"6f1bd5f9.4cdd9c","name":"","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"Startup","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"Startup","payload":"","payloadType":"date","x":210,"y":120,"wires":[["5a304122.7f39e8"]]},{"id":"c33d4c1c.9461f8","type":"switch","z":"6f1bd5f9.4cdd9c","name":"Which HA app ","property":"heishamon.HAapplication","propertyType":"global","rules":[{"t":"cont","v":"Domoticz","vt":"str"},{"t":"cont","v":"HomeAssistant","vt":"str"},{"t":"cont","v":"openHAB","vt":"str"},{"t":"cont","v":"InfluxDB","vt":"str"}],"checkall":"true","repair":true,"outputs":4,"x":770,"y":300,"wires":[["5cc1b5a7.565794"],["b3adbd5e.d2c188"],["ca68e5fb.797e48"],["24450c97.1a66cc"]]},{"id":"5cc1b5a7.565794","type":"function","z":"6f1bd5f9.4cdd9c","name":"Prepare Domoticz output","func":"if(msg.HAid !== null){\n    msg1 = {};\n    msg1.payload = {};\n    msg1.payload.idx = msg.HAid; \n    msg1.topic = \"domoticz/in\";\n\n    if(msg.type == \"Selector Switch\"){\n        msg1.payload.command = \"switchlight\";\n        msg1.payload.switchcmd = \"Set Level\";\n        msg1.payload.level = msg.payload * 10;\n    }else if(msg.type == \"Switch\"){\n        msg1.payload.command = \"switchlight\"\n        if(msg.payload == 1){ cmd = \"On\"; }else{ cmd=\"Off\"}\n        msg1.payload.switchcmd = cmd;\n    }else{\n        msg1.payload.svalue = msg.payload;\n    }\n    return msg1;\n}\n\nreturn;","outputs":1,"noerr":0,"x":1050,"y":260,"wires":[["864dcbb4.29bdb","d93fa1dd.ba9b4"]]},{"id":"864dcbb4.29bdb","type":"mqtt out","z":"6f1bd5f9.4cdd9c","name":"MQTT publish","topic":"","qos":"","retain":"","broker":"2298f8af.6176e8","x":1360,"y":320,"wires":[]},{"id":"57ddcffb.7f6d28","type":"influxdb out","z":"6f1bd5f9.4cdd9c","influxdb":"9cf5a8bb.798e08","name":"","measurement":"heishamon","precision":"","retentionPolicy":"","x":1340,"y":540,"wires":[]},{"id":"24450c97.1a66cc","type":"function","z":"6f1bd5f9.4cdd9c","name":"Prepare InfluxDB output","func":"if(isNaN(parseFloat(msg.payload))){\n    return;\n}else{\n    \n    msg.payload = [{\n        numValue: parseFloat(msg.payload),\n        strValue: msg.sensor\n    },\n    {\n        tag1:msg.sensor\n    }];\n    return msg;\n}","outputs":1,"noerr":0,"x":1040,"y":540,"wires":[["57ddcffb.7f6d28"]]},{"id":"ca68e5fb.797e48","type":"function","z":"6f1bd5f9.4cdd9c","name":"Prepare openHAB output","func":"if(msg.payload.HAid != null){\n    //do something\n}\n\nreturn;","outputs":1,"noerr":0,"x":1050,"y":420,"wires":[["864dcbb4.29bdb"]]},{"id":"b3adbd5e.d2c188","type":"function","z":"6f1bd5f9.4cdd9c","name":"Prepare HomeAssistant output","func":"msg1 = {};\nmsg1.payload = msg.payload;\nmsg1.topic = \"home/\" + msg.HAid; // Example: home/Compressor_Freq (or how it is mentioned in global setup)\nreturn msg1;\n","outputs":1,"noerr":0,"x":1070,"y":340,"wires":[["864dcbb4.29bdb","d93fa1dd.ba9b4"]]},{"id":"e30e04b9.eabb68","type":"mqtt in","z":"6f1bd5f9.4cdd9c","name":"Domoticz Publish","topic":"domoticz/out/#","qos":"2","datatype":"auto","broker":"2298f8af.6176e8","inputs":0,"x":180,"y":660,"wires":[["13d65aa6.c4e4ed"]]},{"id":"998636d3.ac6fc","type":"debug","z":"6f1bd5f9.4cdd9c","name":"","active":false,"console":"false","complete":"false","x":1030,"y":620,"wires":[]},{"id":"13d65aa6.c4e4ed","type":"json","z":"6f1bd5f9.4cdd9c","name":"","property":"payload","action":"","pretty":false,"x":390,"y":660,"wires":[["e4bd0e33.41649"]]},{"id":"e4bd0e33.41649","type":"function","z":"6f1bd5f9.4cdd9c","name":"Translate HomeAutomation to Heishamon","func":"//node.warn(msg.payload.idx)\nvar type;\n\nfor (i = 0; i < context.global.heishamon.ActionMapping.length; i++) {\n    if(msg.payload.idx == context.global.heishamon.ActionMapping[i][2]){\n        if(context.global.heishamon.ActionMapping[i][1]){\n            msg.topic = \"panasonic_heat_pump/commands/\" + context.global.heishamon.ActionMapping[i][0];\n            type = context.global.heishamon.ActionMapping[i][1];\n            //node.warn(msg.payload);\n            switch(type){\n                case \"Selector Switch\":\n                    msg.payload = (msg.payload.svalue1 / 10);\n                    return msg;\n                case \"Thermostat\":\n                    msg.payload = parseInt(msg.payload.svalue1);\n                    return msg;\n                case \"Switch\":\n                    msg.payload = msg.payload.nvalue;\n                    return msg;\n            }\n\n        }\n    }\n}\n\nreturn;","outputs":1,"noerr":0,"x":660,"y":660,"wires":[["998636d3.ac6fc","c31e2c02.54f13"]]},{"id":"c31e2c02.54f13","type":"mqtt out","z":"6f1bd5f9.4cdd9c","name":"MQTT Publish Set-command","topic":"","qos":"","retain":"","broker":"2298f8af.6176e8","x":1320,"y":720,"wires":[]},{"id":"d93fa1dd.ba9b4","type":"debug","z":"6f1bd5f9.4cdd9c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1340,"y":420,"wires":[]},{"id":"16393f9b.83d35","type":"comment","z":"6f1bd5f9.4cdd9c","name":"Version 02","info":"Only the 'global setup' node needs to be changed (and if you're not running on localhost you need to change those mqtt connection nodes also). ","x":160,"y":60,"wires":[]},{"id":"2298f8af.6176e8","type":"mqtt-broker","name":"","broker":"10.0.0.30","port":"1883","clientid":"","autoConnect":true,"usetls":false,"verifyservercert":true,"protocolVersion":"4","keepalive":"15","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"9cf5a8bb.798e08","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"Panasonic","name":"Panasonic","usetls":false,"tls":"","influxdbVersion":"1.x","url":"","rejectUnauthorized":false}]

You should raise an issue on the authors GitHub page

@zenofmud will do... However i think might still be something wrong with my install. Just found out that when i import it and dont change anything, it doesn't give the error.

Every node i open and close, even without changes, starts to give errors. Very weird...

I'll try a full reinstall of nodered.