All communication is done using websocket at ws://localhost:23193/ws.
All messages are JSON encoded, as a type field and an optional data field.
Report the stable weight on the scale
{
"type": "weight",
"data": {
"weight": 0,
"unit": "g"
}
}Report the weight to be unstable
{
"type": "unstable",
"data": {}
}Report the status of the scale
{
"type": "status",
"data": {
"open": true
}
}Request the current status
{
"type": "status"
}Reset the scale value to 0
{
"type": "zero"
}Request the last weight
{
"type": "weight"
}Configure the logger
{
"type": "log",
"data": {
"enabled": true
}
}Debug only, send a custom weight to be broadcasted
{
"type": "debug-weight",
"data": {
"weight": 0,
"unit": "g"
}
}Debug only, send unstable to be broadcasted
{
"type": "debug-unstable"
}