
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-lamarzocco
Advanced tools
La Marzocco Node.js/TypeScript Client - A library to interface with La Marzocco's Home machines
A Node.js/TypeScript library to interface with La Marzocco's Home machines. This is a port of the pylamarzocco Python library.
This library provides two main components:
LaMarzoccoCloudClient - Interacts with La Marzocco's cloud API to send commands and retrieve machine information. Supports WebSocket connections for real-time updates.LaMarzoccoMachine - High-level interface for interacting with La Marzocco machines via the cloud client.npm install node-lamarzocco
You can find your La Marzocco machine's serial number in the La Marzocco app under the Settings tab, or physically on the machine itself. You'll need this serial number to control your machine.
First, generate an installation key for your client:
import { generateInstallationKey, installationKeyToJSON } from "node-lamarzocco";
import { v4 as uuidv4 } from "uuid";
import * as fs from "fs";
// Generate new key material
const installationKey = generateInstallationKey(uuidv4().toLowerCase());
// Save it for future use
fs.writeFileSync(
"installation_key.json",
installationKeyToJSON(installationKey)
);
import { LaMarzoccoCloudClient, installationKeyFromJSON } from "node-lamarzocco";
import * as fs from "fs";
// Load existing key material
const installationKeyJson = fs.readFileSync("installation_key.json", "utf-8");
const installationKey = installationKeyFromJSON(installationKeyJson);
const cloudClient = new LaMarzoccoCloudClient(
"your_username",
"your_password",
installationKey
);
// Register the client (only needed once for new installation keys)
await cloudClient.asyncRegisterClient();
import {
LaMarzoccoCloudClient,
LaMarzoccoMachine,
installationKeyFromJSON,
} from "node-lamarzocco";
import * as fs from "fs";
const SERIAL = "your_serial_number";
const USERNAME = "your_username";
const PASSWORD = "your_password";
async function main() {
// Load installation key
const installationKeyJson = fs.readFileSync("installation_key.json", "utf-8");
const installationKey = installationKeyFromJSON(installationKeyJson);
// Initialize cloud client
const cloudClient = new LaMarzoccoCloudClient(
USERNAME,
PASSWORD,
installationKey
);
// Initialize machine
const machine = new LaMarzoccoMachine(SERIAL, cloudClient);
// Get machine information
await machine.getDashboard();
await machine.getFirmware();
await machine.getSettings();
// Control the machine
await machine.setPower(true);
await new Promise((resolve) => setTimeout(resolve, 5000));
await machine.setPower(false);
}
main().catch(console.error);
// Get dashboard information
await machine.getDashboard();
// Get firmware information
await machine.getFirmware();
// Get schedule settings
await machine.getSchedule();
// Get machine settings
await machine.getSettings();
// Get statistics
await machine.getStatistics();
// Get machine data as dictionary
const machineData = machine.toDict();
import { SteamTargetLevel } from "node-lamarzocco";
// Turn machine on/off
await machine.setPower(true); // Turn on
await machine.setPower(false); // Turn off
// Control steam
await machine.setSteam(true); // Enable steam
await machine.setSteam(false); // Disable steam
// Set coffee target temperature
await machine.setCoffeeTargetTemperature(93.0);
// Set steam level (1-3) - Micra and Mini R only
await machine.setSteamLevel(SteamTargetLevel.LEVEL_2);
The cloud client supports WebSocket connections for real-time updates:
import { ThingDashboardWebsocketConfig } from "node-lamarzocco";
function callback(config: ThingDashboardWebsocketConfig) {
console.log("Received update:", config);
}
// Connect to dashboard websocket with optional callback
await machine.connectDashboardWebsocket(callback);
// The websocket will receive real-time updates about the machine status
// To disconnect later:
await machine.websocket.disconnect();
Main methods:
asyncRegisterClient() - Register a new client (one-time setup)listThings() - Get all devices associated with accountgetThingDashboard(serialNumber) - Get machine dashboardgetThingSettings(serialNumber) - Get machine settingsgetThingStatistics(serialNumber) - Get machine statisticssetPower(serialNumber, enabled) - Turn machine on/offsetSteam(serialNumber, enabled) - Control steam boilersetCoffeeTargetTemperature(serialNumber, temperature) - Set coffee temperaturewebsocketConnect(serialNumber, callbacks...) - Connect to WebSocket for real-time updatesHigh-level interface using the cloud client:
getDashboard() - Get dashboard info from cloudsetPower(enabled) - Turn machine on/off via cloudsetSteam(enabled) - Control steam via cloudsetCoffeeTargetTemperature(temperature) - Set coffee temperaturesetSteamLevel(level) - Set steam level (Micra/Mini R only)setSmartStandby(enabled, minutes, mode) - Configure smart standbyconnectDashboardWebsocket(callback) - Connect to real-time updatesThe library provides custom error classes:
LaMarzoccoError - Base error classAuthFail - Authentication failureRequestNotSuccessful - HTTP request failureCloudOnlyFunctionality - Function requires cloud clientUnsupportedModel - Function not supported on this modelimport { AuthFail } from "node-lamarzocco";
try {
await cloudClient.asyncRegisterClient();
} catch (error) {
if (error instanceof AuthFail) {
console.error("Authentication failed - check credentials");
}
}
npm install
npm run build
npm test
npm run lint
MIT
This library is a port of the excellent pylamarzocco Python library by Josef Zweck.
Contributions are welcome! Please feel free to submit a Pull Request.
FAQs
La Marzocco Node.js/TypeScript Client - A library to interface with La Marzocco's Home machines
We found that node-lamarzocco demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.