AI powered log analyzer for Z-Wave JS. Helps you analyze Z-Wave JS logs by providing insights and suggestions, and answering your questions.
Visit the site at https://zwave-js.github.io/log-analyzer/ to get started with the web interface.
You can also use the log analyzer from the command line:
# Set your Gemini API key
export GEMINI_API_KEY="your-api-key-here"
# Analyze a log file
npx @zwave-js/log-analyzer /path/to/logfile.txt
# Ask a specific question about the log
npx @zwave-js/log-analyzer /path/to/logfile.txt --question "Why is node 5 not responding?"Note
AI-powered log analysis require very large context windows up to 1 million tokens. To be able to provide this service, we need you to bring your own Gemini API key. You can get one for free at https://aistudio.google.com/app/apikey
This package includes an MCP server that exposes the log query tools over stdio, allowing AI agents to analyze Z-Wave JS logs in a tool-driven fashion without loading the entire log into context.
npx --package=@zwave-js/log-analyzer zwave-log-analyzer-mcpOr configure it in an MCP client:
{
"mcpServers": {
"zwave-log-analyzer": {
"command": "npx",
"args": [
"--package=@zwave-js/log-analyzer",
"zwave-log-analyzer-mcp"
]
}
}
}loadLogFile— Load a Z-Wave JS log file for analysis (must be called first)getLogSummary— Overall statistics: entries, time range, nodes, network activitygetNodeSummary— Traffic and signal quality summary for a specific nodegetNodeCommunication— Enumerate communication attempts with a nodegetEventsAroundTimestamp— Log entries around a specific timestampgetBackgroundRSSIBefore— Most recent background RSSI reading before a timestampsearchLogEntries— Search entries by text/regex with filters and paginationgetLogChunk— Read specific ranges of log entries by index
You can use this package as a library in your own Node.js applications.
npm install -g @zwave-js/log-analyzerThe ZWaveLogAnalyzer class provides a simple, high-level API:
import { ZWaveLogAnalyzer } from "@zwave-js/log-analyzer";
// Initialize the analyzer with your API key
const analyzer = new ZWaveLogAnalyzer(process.env.GEMINI_API_KEY!);
// Analyze a log file and stream the results
for await (const chunk of analyzer.analyzeLogFile(
"./logfile.txt",
"Analyze this log file",
)) {
process.stdout.write(chunk);
}
// Ask follow-up questions
for await (const chunk of analyzer.continueAnalysis(
"Can you explain the error in more detail?",
)) {
process.stdout.write(chunk);
}- Fixed missing entrypoints and MCP server runtime checks
- Exposed the log analyzer functionality as an MCP server
- Fixed an issue where the package could not be imported due to a wrong field in
package.json
- Initial release