PiQueen the PowerQueen Orchestrator from a pi with AI Vibecoding

Topic:
how to get powerqueen stats from 100 meters away without bluetooth

Scope:
how i used basic hardware and AI and vibecoding to get it done

Hardware:

  • 4x 330W solar-panel
  • 4x 25V 100AH smart-battery with bluetooth
  • 2x 30A MPPT charge-controller with bluetooth
  • 1x 600W grid-tied inverter
  • 1x tuya power meter switch
  • 1x pi4 4GB with 128G micro-ssd
  • 1x asus bluetooth dongle
  • 1x waveshare 3.5" touch-display hat

Software:

  • pi-os
  • python
  • node-red
  • openai codex cli

Cost:

  • Raspi 4 - 45€ from ebay
  • Waveshare display - 22€ from amazon
  • asus usb-dongle - 6€
  • ai-tokens - 62€… still moving up with new features

Manual Tasks:

  • assemble hardware
  • install pi-os
  • install bt-dongle driver
  • install codex-cli
  • install Pi in Battery-Box in the carport in the garden
  • accessing the pi via wlan/ssh
  • assemble powerqueen documentation in pdf-format
  • write product description to feed into the ai

The Fun Part:

  • AI using a git-available bluetooth library to poll data from the batteries
  • AI finds the batteries and charge controllers on the air-interface
  • AI creating a minimum viable kiosk-dashboard on the physical display

  • Me finding out, that the pi-bluetooth modul is buggy and ordering a usb-dongle
  • AI finding out the charge-controller bluetooth is just a bluetooth modbus gateway
  • Me requested the powerqueen RS485 document from support
  • Me refining the dashboard
  • AI creating a web-dashboard

  • AI adding a json-API
  • AI adding a webhook-call with the json-data to HA

  • AI creating a minimum node-red flow with a to create HA-Entities
  • Me importing the flow and setting up a dashboard


Future Features:

  • change the format of the json that is sent to the HA-webhook
  • more HA entities
  • also include day- week- month- year- total- summary-values
  • include all relevant configurations for the appliance in a sub-menu on the dashboard, so all configuration can be done without ssh or a screen
  • also add interface to configure the charge-controller from the dashboard

Just added a light- and darkmode toggle to the dash

The dashboard looks great, can you share a link to the source?

as soon as i have all the details down…

the metrics-panel for the charge controller now shows PV-Voltage also


the 100% State of Charge on the Chargecontroller is confusing but represents that the current voltage could be nearly 100% SOC on a LIFEPO-Battery and the Charge-Controller does not see Energy going out.

Since the Charge-Controller DC-Out is capable of 30A output (26V= @30A ~700W) i consider connecting the inverters directly there… then the controller also can calculate state of charge knowing how much energy went in and out.

after a few iterations, this is what the dash now looks like

Now:

  • has a configuration-file
  • changed the graph library
  • has sql-lite DB
  • sends data to a node-red-webhook
  • also offers an api to request data from the PiQueen

Ongoing

  • AI writing a test-suite for ongoing development
  • AI writing an installer for any raspberry-pi & BT-Dongle

Future features

  • configuration via dash
  • mqtt

and for the interested … Token-Cost for dev so far: ~ 100€

i am packaging an installable “product” right now
will test on another Pi and create a testing-regime, then i will put it on github, i guess…

any feature-requests? Ideas?

i added an admin-dash

and inline-doc-reader

spoke to powerqueen today. they agreed to me creating this as a github-project with some specific limitations on the “writing” side .

We are looking good.

Description

The provided Software

  • Approved by Powerqueen
  • uses bluetooth to scan the immediate surround for blue tooth-enabled BMS and chargecontrollers by Powerqueen
  • reads data every 5 minutes and stores it in a database
  • offers a web-dashboard, showing the current data and a history-graph
  • offers a kiosk-dashboard for a waveshare display on a raspberry-pi
  • gives you an admin-dash for configuration
    – network-settings
    – up to two webhooks to send the data to
    – on/off for api-access to read the data from the box
  • does not “write” to the hardware

Prerequisites

  • Powerqueen Batteries or Charge-Controllers
  • raspberry-pi
  • ssh access
  • bluetooth-dongle (since the raspi-bt is not stable)
  • waveshare display
  • setup raspi with drivers

Complexity

Power-User proficient with the command-line

Showcase

This is a vibecoding effort with heavy human oversight.
It shows a path to more accessible hardware wit a little help of the AI-friends.

Now you!

Testers

Who is willing to test the software before i put it on Github?

Feature-Requests

What would you wat this box to do?