# modbus_inverter

> Library for accessing devices by modbus

Latest version **1.0.5** (published 2023-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install modbus_inverter
pnpm add modbus_inverter
yarn add modbus_inverter
bun add modbus_inverter
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-06-02 |
| First published | 2023-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 60.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Icke-de |
| Maintainers | pwichmann |
| Keywords | sma, modbus, pv |

## Links

- npm: https://www.npmjs.com/package/modbus_inverter
- Repository: https://github.com/Icke-de/modbus_inverter
- Issues: https://github.com/Icke-de/modbus_inverter/issues
- npm.io page: https://npm.io/package/modbus_inverter

## Dependencies (3)

- [loglevel](https://npm.io/package/loglevel.md) ^1.6.1
- [int64-buffer](https://npm.io/package/int64-buffer.md) ^0.99.1007
- [modbus-serial](https://npm.io/package/modbus-serial.md) ^8.0.11

## Recent versions

- 1.0.5 (latest) — 2023-06-02

## README

# Modbus Inverter
This module is based on the SMA_Modbus module. [Module](https://github.com/orlopau/sma_modbus.git)

## Changes
V1.0.3
- add method 
    - getInverterStatus
    - getRecommendedAction
    - getOperatingCondition
    - getCurrentPower_L1_L2_L3

V1.0.2
- change Package name to Modbus Inverter
V1.0.1
- add method getHealthStatus for SMA Sunny Tripower 8.0 (testet)
V1.0.0
- changed function "readModbus" to "readModbusHR" for Holding Registers
- add function "readModbusIR" for Inputregisters
- ClientID / SlaveID switched to SMA Object, you can declare at create Object
- add SMA Sunny Tripower 8.0 Profil

## Next Steps
- integrate in ioBroker Adapter
    
## Introduction

The module provides easy access to the data provided by SMA devices with ModBus support.

It automatically establishes a new connection on disconnect, and parses incoming byte data to their respective format.

##### Typescript definitions are included out-of-the-box.

## Usage

Common requests are included for some devices, such as:

* current battery percentage of Sunny Island devices
* power of Sunny Boy devices
* total production of Sunny Boy devices
* etc.

If more advanced requests are required, the library provides a easy method to access **all registers** with **automatic
data parsing**. 

The register values can be found on [SMAs website](https://www.sma.de/produkte/monitoring-control/modbus-protokoll-schnittstelle.html)
under "Downloads" -> "Technical Information" -> "Modbus Interface". An Excel file containing all registers with datatype and description can be downloaded.

## Examples

```javascript
// require or import can be used to acquire the package
const SMA = require('sma_modbus');
let sunnyIsland = new SMA.SunnyIsland("192.168.188.60", 502);
sunnyIsland.getPower().then((x) => {
        console.log("Power: " + x + " W");
});

// Modbus addresses and datatypes can be found in the SMA docs
sunnyIsland.readModbus(40073, SMA.ModbusDatatype.uint16).then((x) => {
    console.log("Interface speed: " + x + " Mb/s");
});
```

---
_Source: https://npm.io/package/modbus_inverter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
