WolfwithSword / Bambu-HomeAssistant-Flows

A collection of HomeAssistant Dashboards and NodeRed Flows with a configurator to connect a BambuLabs printer to HomeAssistant through MQTT - based off of my Gists
32 stars 3 forks source link

Error on db upload #3

Closed Cres09 closed 1 month ago

Cres09 commented 1 month ago

I set up the advanced setup but i can't get it to create and update the prints table. I keep getting the folowing error:

"12/5/2024, 16:04:25node: Get Printing Time msg : string[39] "error: relation "prints" does not exist" 12/5/2024, 16:04:25node: Get Printing Amount msg : string[39] "error: relation "prints" does not exist" 12/5/2024, 16:05:48node: Insert Update (Mat Cost) msg : string[39] "error: relation "prints" does not exist" 12/5/2024, 16:05:48node: Insert Update (Plate) msg : string[39] "error: relation "prints" does not exist"

I tried to create myself the table in the db and then there are no error, but nothing gets uploaded. The energy_readings tables only worked on uploading the data once.

WolfwithSword commented 1 month ago

In the db flow, could you try clicking the box next to this "Force Init" node?

image

This should force the DB to be created. Otherwise, the table "should" be created if not exists anytime a print triggers. In the DB flow, can you tell me what it shows below this node when you start a new print? Maybe check this before clicking the force-init node actually.

image

If it doesn't show anything, or if it does but you're not sure, can you also check these blue nodes that say "60s" image

Does it have a green box saying "Success" below them? It could be the HomeAssistant server connection via these nodes is not setup or is having some issue running, thus the prints table never initializes as it doesn't get triggered that a print started properly there. Make sure the server credentials in it are setup (and if you're using nodered as a HAOS addon, tick that box saying yes), and that in HA you have the "nodered companion" integration too.

If the other nodes seems to show like "Print Started" just fine as a print is actively going on, and the 60s node shows green success and all that, then could you double click on this node here image

And verify that the "Server" field/dropdown is the same as selected as the one in the "Get Printing Time", "Get Printing Amount", "Insert Update (Mat Cost) and "Insert Update (Place)" nodes if you double click them?

Cres09 commented 1 month ago

so, to your questions:

  1. the start / end... node doesn't upload.
  2. if i click on force init the tables are created correctly but only some data gets uploaded.
  3. the 60s node appears as succes. and the mqtt in also as connected.
  4. "and if you're using nodered as a HAOS addon, tick that box saying yes" i'm using HAOS and the tick box was already ticked as yes. and i have the companion too.
  5. they are the same.
WolfwithSword commented 1 month ago

Ah okay so if the start/end node doesn't have the status under it, but everything else seems fine, I think I know what the issue is.

Can you double check what you set for "HA Printer Device Name" in the advanced flow? Note that this is different from what you set in the basic flow for "Printer Name".

You can view the current value in the Advanced Flow group -> "Set Flow Properties" node. Can you confirm that this is correct? It should be essentially <model>_<printer_name>, where is the value from the basic flow but all lowercase and underscored, and model is lowercase too.

Cres09 commented 1 month ago

that waws the issue, althought it looked okay. I deleted everything and make it fresh. now works great. Thank your vey much for your help.