BuYi Meter
The BuyiMeter plugin vends kWh tokens and clear credit tokens for BuYi STS keypad meters. When a customer pays, MPM asks the BuYi vending API for a token and sends it to the customer.
Prerequisites
- Access to the MPM admin panel.
- The address of the BuYi vending API.
- The secret key for that API: 32 characters, digits and the letters A to F.
- The STS values of your meters: Supply Group Code (SGC), Tariff Index (TI) and Key Revision Number (KRN).
BuYi gives you all of these.
Configuration
- Enable the plugin under Settings → Configuration → Plugins.
- Open BuYi Meter → Overview in the sidebar.
- Enter the API URL. It ends in
/api, for examplehttp://203.0.113.10:8000/api. - Enter the secret key.
- Enter the SGC, TI and KRN of your meters.
- Click Save.
Registering Meters
Register each meter with the manufacturer BuYi Meters and the meter number as serial number. The meter number must be the one BuYi knows the meter by.
How a Token Is Vended
MPM calculates the energy from the amount paid and the meter's tariff, rounded to one decimal place. It sends the meter number, the energy and the STS values to BuYi and receives a 20-digit token. BuYi does not apply a tariff of its own in this call.
Clearing a Meter's Credit
A clear credit token sets the remaining credit of a meter to zero. MPM asks BuYi for it with the meter number and the STS values, and shows the token for the customer to enter on the meter.
Good to Know
- All meters of one MPM company share the same SGC, TI and KRN.
- A token generated with the wrong SGC, TI or KRN is rejected by the meter. Check these values first when a customer reports a token that does not work.
- Clear-tamper tokens are not supported yet.
Troubleshooting
| Message | What to check |
|---|---|
BuYi credentials are not configured. | Fill in all fields on the overview page. |
BuYi could not be reached | The API URL, and whether the BuYi server accepts connections from your MPM server. |
The answer from BuYi could not be decrypted. Check the secret key. | The secret key. |
BuYi did not generate a token for meter … | The reason BuYi gave follows the meter number. |

