My house is off-grid with 6KW of PV panels on the roof. I have a custom made power-wall called a monolith. The monolith contains two PIP inverter/chargers each capable of 4KW in or out continuously. Its battery can store 20KWH of energy.
The web interface in the monolith is a raspberry-pi 2 (RPI-2) running node-red. I can modify the node-red flow to add my own features.
Using node-red I can access near real time information about the state of the monolith.
By using information such as the state of charge, battery current and charger mode I compute a cost of power (COP) in the monolith RPI-2. The COP is just a number but you can think of it as cents per KWH if that helps. With sunny weather and little load the COP is typically 30 just before sunrise and -5 after the batteries are full. I deliberately drive the COP negative to allow smart loads to turn on in a sensible order.
Node-red allows multiple node-red devices to talk over the LAN. I choose UDP ports to achieve this. Smart devices can request the COP or other information from the monolith.
My first smart load is the charger for my mitsubishi outlander PHEV (plug in hybrid electric vehicle). I bought the cheapest j1772 EV charger I could find on Ebay.
It is unbranded and cost about $220au delivered from China. It is supposed to charge at 10 or 16 amps (230V in my case) but I'm seeing slightly lower currents.
The system simply turns the charging on and off by switching the pilot signal with a relay. It is pulled high with a resistor in the off state. The so called "chargers" are really an interface between the car and the wall socket, the real charger is built into the car. The external box tells the car how much power it can have via a 1Khz 12V pilot signal which varies in duty cycle.
The relay is switched by an i/o pin on a raspberrypi zero-w. A node-red program (flow) decides when to enable/disable to charger and provides the online web interface.