vemonitor-m8


Namevemonitor-m8 JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/vemonitor/vemonitor_m8
SummarySolar Plant Monitoring
upload_time2024-09-03 09:35:28
maintainerNone
docs_urlNone
authorEli Serra
requires_python>3.5.2
licenseApache
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # VeMonitor_m8

![CI](https://github.com/vemonitor/vemonitor_m8/actions/workflows/python-package.yml/badge.svg?branch=main)
[![PyPI package](https://img.shields.io/pypi/v/vemonitor_m8.svg)](https://pypi.org/project/vemonitor_m8/)
[![codecov](https://codecov.io/gh/vemonitor/vemonitor_m8/graph/badge.svg?token=M7VgGzkApi)](https://codecov.io/gh/vemonitor/vemonitor_m8)
[![Downloads](https://static.pepy.tech/badge/vemonitor_m8)](https://pepy.tech/project/vemonitor_m8)

> **Note**
> This repository is under active development and is not yet fully tested.

The `vemonitor_m8` package is a powerful and flexible framework designed for real-time monitoring and data acquisition from various energy systems and devices. It serves as an all-in-one solution to gather, process, and distribute data across multiple platforms, supporting diverse protocols and data sources such as VE.Direct, Redis, and EmonCms.

With `vemonitor_m8`, users can easily configure and manage connections to different devices and servers, enabling seamless data flow from energy meters, battery monitors, solar charge controllers, and other compatible equipment. The package is highly customizable, allowing you to set up different workers, connectors, and data processing pipelines tailored to your specific needs.

Key features of vemonitor_m8 include:

. **Versatile Data Integration**: Supports various input and output protocols, enabling data collection from multiple sources and distributing it to multiple destinations.
. **Modular Architecture**: The package is built around a modular design, making it easy to extend functionality with additional workers and connectors.
. **Real-Time Monitoring**: Enables real-time data monitoring, ensuring up-to-date insights into your energy systems.
. **Customizable Configuration**: Offers flexible configuration options to suit a wide range of use cases, from simple home setups to complex industrial applications.

Whether you are looking to monitor a single device or manage a large network of energy systems, vemonitor_m8 provides the tools and flexibility to build a robust and efficient monitoring solution.

> **Warning**  
> Use this package at your own risk. Misconfiguration or bugs in this application can lead to an excessive number of disk read/writes and/or requests to designated servers (e.g., the EmonCms Server). It is essential that you fully understand and manage:
> - Your VeMonitor configuration file settings.
> - Your Redis server settings.  
> 

> **Warning**  
> It is strongly recommended to test your configuration using a monitoring tool like Telegraf/Grafana and Redis/Grafana to supervise and control disk read/writes and HTTP requests, ensuring they follow expected patterns.

It currently supports:
- Reading and formatting data from:
    - Any device using the Serial Victron Energy VE.Direct text protocol
- Sending the compiled and formatted data to:
    - Redis Server
    - EmonCms Web Server

A cache system, which can be configured to use either memory or a Redis server, is available to reduce input reads and/or output requests.  

## Installation

To install directly from GitHub:
```
python3 -m pip install "git+https://github.com/vemonitor/vemonitor_m8"
```

To install from PypI :
```
python3 -m pip install vemonitor_m8
```

## Configuration Files

To run this application, you need to provide YAML configuration files. Refer to the [sample configuration files directory](https://github.com/vemonitor/vemonitor_m8/tree/main/config_sample) to understand the overall structure.

All configuration files must be placed in one of the following directories:

On Linux/Unix:
- `/opt/vemonitor_m8/conf/`
- `/opt/vemonitor/conf/`
- `${HOME}/.vemonitor`

On Windows:
- `${HOME}/.vemonitor`

### Structure

You can choose your preferred configuration architecture. You may opt for a single configuration file or divide it into multiple files.

To effectively manage data input/output and server connections, you need to configure at least both `appBlocks` and `appConnectors` in your setup.

Here’s a basic example of the required configuration:

```yaml
    # Configuration for appBlocks
    appBlocks:
        - "(...)"
    
    # Configuration for appConnectors
    # Here, configure both input and output connection data for the necessary workers
    appConnectors:
        "(...)"

```
#### Unique configuration file

If you choose to consolidate all configuration settings into a single file, you can omit the `Import` setting key parameters from the sample configuration example.

To do this, copy the contents of [`vm_appConnectors.yaml`](https://github.com/vemonitor/vemonitor_m8/tree/main/config_sample/vm_appConnectors.yaml) and append it to the end of [`vm_conf.yaml`](https://github.com/vemonitor/vemonitor_m8/tree/main/config_sample/vm_conf.yaml).

Optionally, you can also include the content of other configuration files as needed.

#### Multiple Configuration files
Refer to [sample configuration files directory](https://github.com/vemonitor/vemonitor_m8/tree/main/config_sample) to example of possible structure.

You need to set `Imports` setting parameters on the main configuration file to load needed configuration settings as fallow:

```yaml
    # Imports settings parameters
    # List of file names to load and add to configuration

    Imports:
        # example of batteryBanks settings file
        - "vm_batteryBank.yaml"
        # example of an appConnectors settings file
        - "vm_appConnectors.yaml"
```
> **Note**  
> - All file names must correspond to existing files in the current configuration directory.
> - File names should contain only alphanumeric characters, underscores (`_`), or hyphens (`-`), and must start with an alphanumeric character.
> - Only `.yaml` and `.yml` extensions are accepted.

### Settings

As mentioned above, only two configuration setting keys are required:

- **appBlocks**: Contains the configuration settings for inputs and outputs.
- **appConnectors**: Contains the connection data for inputs and outputs needed by the workers.

Additionally, some optional configuration setting keys are available:

- **Imports**: Used to import external files into the configuration.
- **batteryBanks**: Used by the internal batteryBanks middleware.

## Interfacers (Workers)

By default `vemonitor_m8` includes two primary workers, or interfacers, by default. Additionally, you can install optional external workers as Python packages to extend functionality.

### VE.Direct Worker

The `vedirect` worker is a versatile component of the `vemonitor_m8` package, designed to facilitate communication with devices using the VE.Direct text protocol over a serial connection. Primarily functioning as an Input Worker API, it allows for the seamless reading of data from a variety of Victron Energy devices, such as battery monitors and solar charge controllers.

For detailed instructions on configuring and utilizing the `vedirect` worker, please refer to the [**VeDirect Worker documentation**](https://github.com/vemonitor/vemonitor_m8/tree/main/vemonitor_m8/workers/vedirect/README.md).

#### Basic Example of appConnectors Configuration

Below is an example configuration for establishing a connection with a device using the serial VE.Direct text protocol, defined within the `appConnectors` settings:

```yaml
appConnectors:
    # Serial appConnectors settings
    # Used to establish connections to devices using the serial VE.Direct text protocol
    serial:
        # Device source name (Defined by user)
        # str: Alphanumeric characters, '-' and/or '_'
        bmv700:
            # Path of the serial port
            # -> Required if no serialTest setting is present
            serialPort: '/dev/ttyACM2'
            # Serial test to determine if the serial data corresponds with this serial item.
            # -> Useful if more than one serial item is read, or if the serial port changes.
            # -> E.g., changing the USB port, where the serial port name is not updated by the user.
            # -> Scans all serial ports on serial paths ['/dev', '/${HOME}', ...] and searches for the corresponding serial.
            serialTest:
                # Test name (Defined by user)
                # str: Required, Alphanumeric characters, '-' and/or '_'
                PIDTest:
                    # Type of test to execute
                    # str: Required, 'value' or 'columns'
                    typeTest: "value"
                    # The block key name to compare
                    # str: Required, Alphanumeric characters, '-' and/or '_'
                    key: "PID"
                    # The block key value to compare
                    # The value needs to be equal to the serial output to pass the test
                    # str: Required, Alphanumeric characters, '-' and/or '_'
                    value: "0x203"
```

#### Basic Example of appBlock Configuration

Below is a basic example of how to configure the VeDirect worker within the `appBlock` settings:

```yaml
appBlocks:
    -   # Block item name (must be unique)
        name: "VedirectToRedis"
        # (...)
        inputs:
            # Serial input worker reads data from the serial device
            serial:
                -   # Input block item name
                    # Used to identify block items
                    # str: Required, Alphanumeric characters, '-' and/or '_'
                    name: "bmv700"
                    # AppConnector source name to connect
                    # Must correspond to one of the serial appConnectors defined above
                    # str: Required, Alphanumeric characters, '-' and/or '_'
                    source: "bmv700"
                    # Read time interval (in seconds)
                    # int: Required, positive number
                    time_interval: 1
                    # Device type name (Defined by user)
                    # str: Required, Alphanumeric characters, '-' and/or '_'
                    device: "BMV"
                    # Reference columns for standardizing block names
                    # To be processed by vemonitor_m8 middlewares 
                    ref_cols: [
                        ['bat_voltage', 'V'],
                        ['bat_current', 'I'],
                        ['bat_power', 'P'],
                        ['bat_temperature', 't_bat'],
                        ['loc_temperature', 't_int']
                    ]
                    # Node columns to read from the serial device
                    # Contains block column names to extract from serial packets read
                    columns: [
                        'V', 'I', 'P', 'CE', 'SOC', 'Alarm',
                        'AR', 'Relay', 'H2', 'H17', 'H18'
                    ]
```

### redis Worker

The `redis` worker is designed to handle both reading from and writing to Redis servers. It functions as an Input/Output Interfacer API, facilitating the transfer of data between the vemonitor_m8 package and one or more Redis servers.


For detailed instructions on how to use the Redis worker, please refer to the [**Redis Worker documentation**](https://github.com/vemonitor/vemonitor_m8/tree/main/vemonitor_m8/workers/redis/README.md).

#### Use local Redis Server
To use a local Redis server, you'll need to install it on your system or use an appropriate Docker image. For detailed instructions, refer to the [**Official Redis documentation**](https://redis.io/docs/latest/get-started/).


#### Basic Example of appConnectors Configuration

Below is an example configuration for connecting to Redis servers using the `appConnectors` settings:

```yaml
appConnectors:
    # Redis appConnectors settings
    # Used to establish connections to Redis servers
    redis:
        # Source name of Redis Server
        # Defined by the user
        # str: Alphanumeric characters, '-' and/or '_'
        local:
            # Server host IP address
            # str: required
            host: "127.0.0.1"
            # Server port number
            # int: required
            port: 6379
        # Source name of Redis Server
        # Defined by the user
        # str: Alphanumeric characters, '-' and/or '_'
        remote:
            # Server host IP address
            # str: required
            host: "192.168.0.52"
            # Server port number
            # int: required
            port: 16379
            # Server password
            # str: Optional
            password: "REDIS_SERVER_PASSWORD"
```

#### Basic Example of appBlock Configuration

Here’s a basic example of how to configure the Redis worker in the `appBlock` settings:

```yaml
outputs:
    # Redis output worker writes data to the Redis server
    redis:
        - # Redis server source configuration name
          # Refer to the appConnectors Redis item with the source set as "local"
          source: "local"
          # Redis storage structure
          # In this example, the Redis HmapTimeSeries module is selected
          redis_data_structure: "HmapTimeSeries"
          # Data write interval
          time_interval: 1
          # Data cache interval
          # This value, combined with time_interval,
          # determines how many points are sent simultaneously to the server.
          # Total points = time_interval * cache_interval
          # Example: Total points = 1 * 5 = 5
          # Meaning every 5 seconds, 5 points are sent per node determined by the columns key
          cache_interval: 5
          # Redis node (must be unique)
          # Used as the Set key to store nodes from columns
          redis_node: "bat_bmv700"
          # Reference columns for standardizing block names
          # To be processed by vemonitor_m8 middleware
          ref_cols:  [
              ['bat_voltage', 'V'],
              ['bat_current', 'I'],
              ['bat_power', 'P']
          ]
          # Node columns to store in the Redis server
          columns: 
              # Key: hMap node name
              # Values: column block names to extract from the data read
              bmv700: [
                  'V', 'I', 'P', 'SOC', 'Alarm',
                  'AR', 'Relay'
              ]
```

### EmonCms Worker
The `EmonCms` worker is external python package [`emon_worker_m8`](https://github.com/vemonitor/emon_worker_m8).
It acts as an Output Interfacer API, tasked with sending data to an EmonCms web application.

To use it you need to install the package first:
```
pip install emon_worker_m8
```
> **Warning**:
> Try to ever maintain packages up to date.
> ```yaml
> pip install --update vemonitor_m8 emon_worker_m8
> ```

Then refer to the `emon_worker_m8` documentation file for how to use it.

> **Note**  
> If you want to install and run EmonCms locally,  
> see the [EmonCms repository](https://github.com/emoncms/emoncms).

#### Basic Example of appConnectors Configuration

Below is an example configuration for connecting to EmonCms servers using the `appConnectors` settings:

```yaml
appConnectors:
    # EmonCms appConnectors settings
    # Used to establish connections to EmonCms servers
    emoncms:
        # Source name of the EmonCms Server
        # Defined by the user
        # str: Alphanumeric characters, '-' and/or '_'
        local:
            # Base HTTP address and port of the EmonCms Server
            # str: required
            addr: "http://127.0.0.1:8080"
            # EmonCms Server API Key
            # Must have write permissions to work properly
            # str: required
            apikey: "EMONCMS_API_KEY"
```

This example demonstrates how to configure an `appConnectors` entry for connecting to a local EmonCms server, including setting the server address and API key with write permissions.

#### Basic Example of appBlock Configuration

Here’s a basic example of how to configure the `emon_worker_m8` worker in the `appBlock` settings:
```yaml
    outputs:
        emoncms:
            -   name: "bat_t1"
                source: "local"
                columns:
                    bmv700: [
                        'V', 'I', 'P', 'CE', 'SOC', 'Alarm',
                        'AR', 'Relay','H2', 'H17', 'H18', 'time_ref'
                    ]
                time_interval: 1
                cache_interval: 10 # number of items to send at same time
```

## VE.Direct to EmonCms
This example demonstrates how to read data from devices using the Serial VE.Direct text protocol and send the specified data at regular intervals to the [EmonCms](https://emoncms.org/) web application.

> **Note:** You need to install the [Emoncms worker extra package](https://github.com/vemonitor/emon_worker_m8).
```
pip install emon_worker_m8
```
If you want to install and run EmonCms locally, see the [EmonCms repository](https://github.com/emoncms/emoncms).

### Configuration Files

> See the [sample configuration files](https://github.com/vemonitor/vemonitor_m8/tree/main/config_sample/vedirect_to_emoncms).

You can copy these sample configuration files to your own configuration directory and then update them with the necessary settings.

### Running VeMonitor

First, ensure that you have installed any additional worker packages you require.

Next, set up your configuration files in the appropriate configuration directory.

#### How It Works

In the [main sample configuration file](https://github.com/vemonitor/vemonitor_m8/blob/main/config_sample/vedirect_to_emoncms/vm_conf.yaml) (`vm_conf.yaml`), there are two different `AppBlocks`:
- `BatteryMonitor`
- `BatteryAndPannelsMonitor`

For example, you can run `BatteryMonitor` for testing purposes.

Based on the configuration settings, this app will read data from the VE.Direct Serial Device (e.g., BMV700), and the data will be cached on the local Redis server:

- Every second, retrieve values from:
    ```python
    [
        'V', 'I', 'P', 'CE', 'SOC', 'Alarm',
        'AR', 'Relay', 'H2', 'H17', 'H18'
    ]
    ```
- Every 2 seconds, retrieve values from:
    ```python
    [
        'TTG', 'H1', 'H3', 'H4', 'H5'
    ]
    ```
- Every 5 seconds, retrieve values from:
    ```python
    [
        'H6', 'H7', 'H8', 'H9', 'H10'
    ]
    ```
- Every 10 seconds, retrieve values from:
    ```python
    [
        'H11', 'H12', 'H13', 'H14', 'H15', 'H16'
    ]
    ```

The data will then be sent to the EmonCms Server. For more details, see the [Emoncms worker extra package](https://github.com/vemonitor/emon_worker_m8).

#### Running the Application

To run the `BatteryMonitor` app block:  
```
python vemonitor_m8 --block BatteryMonitor --debug
```

To run the `BatteryAndPannelsMonitor` app block: 
```
python vemonitor_m8 --block BatteryAndPannelsMonitor --debug
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/vemonitor/vemonitor_m8",
    "name": "vemonitor-m8",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">3.5.2",
    "maintainer_email": null,
    "keywords": null,
    "author": "Eli Serra",
    "author_email": "eli.serra173@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/07/0d/cd4dc4ca6830df6a2138bdd8e4297ad10127a9c0b2d7fd8e7045d96fd1c9/vemonitor_m8-0.1.2.tar.gz",
    "platform": null,
    "description": "# VeMonitor_m8\n\n![CI](https://github.com/vemonitor/vemonitor_m8/actions/workflows/python-package.yml/badge.svg?branch=main)\n[![PyPI package](https://img.shields.io/pypi/v/vemonitor_m8.svg)](https://pypi.org/project/vemonitor_m8/)\n[![codecov](https://codecov.io/gh/vemonitor/vemonitor_m8/graph/badge.svg?token=M7VgGzkApi)](https://codecov.io/gh/vemonitor/vemonitor_m8)\n[![Downloads](https://static.pepy.tech/badge/vemonitor_m8)](https://pepy.tech/project/vemonitor_m8)\n\n> **Note**\n> This repository is under active development and is not yet fully tested.\n\nThe `vemonitor_m8` package is a powerful and flexible framework designed for real-time monitoring and data acquisition from various energy systems and devices. It serves as an all-in-one solution to gather, process, and distribute data across multiple platforms, supporting diverse protocols and data sources such as VE.Direct, Redis, and EmonCms.\n\nWith `vemonitor_m8`, users can easily configure and manage connections to different devices and servers, enabling seamless data flow from energy meters, battery monitors, solar charge controllers, and other compatible equipment. The package is highly customizable, allowing you to set up different workers, connectors, and data processing pipelines tailored to your specific needs.\n\nKey features of vemonitor_m8 include:\n\n. **Versatile Data Integration**: Supports various input and output protocols, enabling data collection from multiple sources and distributing it to multiple destinations.\n. **Modular Architecture**: The package is built around a modular design, making it easy to extend functionality with additional workers and connectors.\n. **Real-Time Monitoring**: Enables real-time data monitoring, ensuring up-to-date insights into your energy systems.\n. **Customizable Configuration**: Offers flexible configuration options to suit a wide range of use cases, from simple home setups to complex industrial applications.\n\nWhether you are looking to monitor a single device or manage a large network of energy systems, vemonitor_m8 provides the tools and flexibility to build a robust and efficient monitoring solution.\n\n> **Warning**  \n> Use this package at your own risk. Misconfiguration or bugs in this application can lead to an excessive number of disk read/writes and/or requests to designated servers (e.g., the EmonCms Server). It is essential that you fully understand and manage:\n> - Your VeMonitor configuration file settings.\n> - Your Redis server settings.  \n> \n\n> **Warning**  \n> It is strongly recommended to test your configuration using a monitoring tool like Telegraf/Grafana and Redis/Grafana to supervise and control disk read/writes and HTTP requests, ensuring they follow expected patterns.\n\nIt currently supports:\n- Reading and formatting data from:\n    - Any device using the Serial Victron Energy VE.Direct text protocol\n- Sending the compiled and formatted data to:\n    - Redis Server\n    - EmonCms Web Server\n\nA cache system, which can be configured to use either memory or a Redis server, is available to reduce input reads and/or output requests.  \n\n## Installation\n\nTo install directly from GitHub:\n```\npython3 -m pip install \"git+https://github.com/vemonitor/vemonitor_m8\"\n```\n\nTo install from PypI :\n```\npython3 -m pip install vemonitor_m8\n```\n\n## Configuration Files\n\nTo run this application, you need to provide YAML configuration files. Refer to the [sample configuration files directory](https://github.com/vemonitor/vemonitor_m8/tree/main/config_sample) to understand the overall structure.\n\nAll configuration files must be placed in one of the following directories:\n\nOn Linux/Unix:\n- `/opt/vemonitor_m8/conf/`\n- `/opt/vemonitor/conf/`\n- `${HOME}/.vemonitor`\n\nOn Windows:\n- `${HOME}/.vemonitor`\n\n### Structure\n\nYou can choose your preferred configuration architecture. You may opt for a single configuration file or divide it into multiple files.\n\nTo effectively manage data input/output and server connections, you need to configure at least both `appBlocks` and `appConnectors` in your setup.\n\nHere\u2019s a basic example of the required configuration:\n\n```yaml\n    # Configuration for appBlocks\n    appBlocks:\n        - \"(...)\"\n    \n    # Configuration for appConnectors\n    # Here, configure both input and output connection data for the necessary workers\n    appConnectors:\n        \"(...)\"\n\n```\n#### Unique configuration file\n\nIf you choose to consolidate all configuration settings into a single file, you can omit the `Import` setting key parameters from the sample configuration example.\n\nTo do this, copy the contents of [`vm_appConnectors.yaml`](https://github.com/vemonitor/vemonitor_m8/tree/main/config_sample/vm_appConnectors.yaml) and append it to the end of [`vm_conf.yaml`](https://github.com/vemonitor/vemonitor_m8/tree/main/config_sample/vm_conf.yaml).\n\nOptionally, you can also include the content of other configuration files as needed.\n\n#### Multiple Configuration files\nRefer to [sample configuration files directory](https://github.com/vemonitor/vemonitor_m8/tree/main/config_sample) to example of possible structure.\n\nYou need to set `Imports` setting parameters on the main configuration file to load needed configuration settings as fallow:\n\n```yaml\n    # Imports settings parameters\n    # List of file names to load and add to configuration\n\n    Imports:\n        # example of batteryBanks settings file\n        - \"vm_batteryBank.yaml\"\n        # example of an appConnectors settings file\n        - \"vm_appConnectors.yaml\"\n```\n> **Note**  \n> - All file names must correspond to existing files in the current configuration directory.\n> - File names should contain only alphanumeric characters, underscores (`_`), or hyphens (`-`), and must start with an alphanumeric character.\n> - Only `.yaml` and `.yml` extensions are accepted.\n\n### Settings\n\nAs mentioned above, only two configuration setting keys are required:\n\n- **appBlocks**: Contains the configuration settings for inputs and outputs.\n- **appConnectors**: Contains the connection data for inputs and outputs needed by the workers.\n\nAdditionally, some optional configuration setting keys are available:\n\n- **Imports**: Used to import external files into the configuration.\n- **batteryBanks**: Used by the internal batteryBanks middleware.\n\n## Interfacers (Workers)\n\nBy default `vemonitor_m8` includes two primary workers, or interfacers, by default. Additionally, you can install optional external workers as Python packages to extend functionality.\n\n### VE.Direct Worker\n\nThe `vedirect` worker is a versatile component of the `vemonitor_m8` package, designed to facilitate communication with devices using the VE.Direct text protocol over a serial connection. Primarily functioning as an Input Worker API, it allows for the seamless reading of data from a variety of Victron Energy devices, such as battery monitors and solar charge controllers.\n\nFor detailed instructions on configuring and utilizing the `vedirect` worker, please refer to the [**VeDirect Worker documentation**](https://github.com/vemonitor/vemonitor_m8/tree/main/vemonitor_m8/workers/vedirect/README.md).\n\n#### Basic Example of appConnectors Configuration\n\nBelow is an example configuration for establishing a connection with a device using the serial VE.Direct text protocol, defined within the `appConnectors` settings:\n\n```yaml\nappConnectors:\n    # Serial appConnectors settings\n    # Used to establish connections to devices using the serial VE.Direct text protocol\n    serial:\n        # Device source name (Defined by user)\n        # str: Alphanumeric characters, '-' and/or '_'\n        bmv700:\n            # Path of the serial port\n            # -> Required if no serialTest setting is present\n            serialPort: '/dev/ttyACM2'\n            # Serial test to determine if the serial data corresponds with this serial item.\n            # -> Useful if more than one serial item is read, or if the serial port changes.\n            # -> E.g., changing the USB port, where the serial port name is not updated by the user.\n            # -> Scans all serial ports on serial paths ['/dev', '/${HOME}', ...] and searches for the corresponding serial.\n            serialTest:\n                # Test name (Defined by user)\n                # str: Required, Alphanumeric characters, '-' and/or '_'\n                PIDTest:\n                    # Type of test to execute\n                    # str: Required, 'value' or 'columns'\n                    typeTest: \"value\"\n                    # The block key name to compare\n                    # str: Required, Alphanumeric characters, '-' and/or '_'\n                    key: \"PID\"\n                    # The block key value to compare\n                    # The value needs to be equal to the serial output to pass the test\n                    # str: Required, Alphanumeric characters, '-' and/or '_'\n                    value: \"0x203\"\n```\n\n#### Basic Example of appBlock Configuration\n\nBelow is a basic example of how to configure the VeDirect worker within the `appBlock` settings:\n\n```yaml\nappBlocks:\n    -   # Block item name (must be unique)\n        name: \"VedirectToRedis\"\n        # (...)\n        inputs:\n            # Serial input worker reads data from the serial device\n            serial:\n                -   # Input block item name\n                    # Used to identify block items\n                    # str: Required, Alphanumeric characters, '-' and/or '_'\n                    name: \"bmv700\"\n                    # AppConnector source name to connect\n                    # Must correspond to one of the serial appConnectors defined above\n                    # str: Required, Alphanumeric characters, '-' and/or '_'\n                    source: \"bmv700\"\n                    # Read time interval (in seconds)\n                    # int: Required, positive number\n                    time_interval: 1\n                    # Device type name (Defined by user)\n                    # str: Required, Alphanumeric characters, '-' and/or '_'\n                    device: \"BMV\"\n                    # Reference columns for standardizing block names\n                    # To be processed by vemonitor_m8 middlewares \n                    ref_cols: [\n                        ['bat_voltage', 'V'],\n                        ['bat_current', 'I'],\n                        ['bat_power', 'P'],\n                        ['bat_temperature', 't_bat'],\n                        ['loc_temperature', 't_int']\n                    ]\n                    # Node columns to read from the serial device\n                    # Contains block column names to extract from serial packets read\n                    columns: [\n                        'V', 'I', 'P', 'CE', 'SOC', 'Alarm',\n                        'AR', 'Relay', 'H2', 'H17', 'H18'\n                    ]\n```\n\n### redis Worker\n\nThe `redis` worker is designed to handle both reading from and writing to Redis servers. It functions as an Input/Output Interfacer API, facilitating the transfer of data between the vemonitor_m8 package and one or more Redis servers.\n\n\nFor detailed instructions on how to use the Redis worker, please refer to the [**Redis Worker documentation**](https://github.com/vemonitor/vemonitor_m8/tree/main/vemonitor_m8/workers/redis/README.md).\n\n#### Use local Redis Server\nTo use a local Redis server, you'll need to install it on your system or use an appropriate Docker image. For detailed instructions, refer to the [**Official Redis documentation**](https://redis.io/docs/latest/get-started/).\n\n\n#### Basic Example of appConnectors Configuration\n\nBelow is an example configuration for connecting to Redis servers using the `appConnectors` settings:\n\n```yaml\nappConnectors:\n    # Redis appConnectors settings\n    # Used to establish connections to Redis servers\n    redis:\n        # Source name of Redis Server\n        # Defined by the user\n        # str: Alphanumeric characters, '-' and/or '_'\n        local:\n            # Server host IP address\n            # str: required\n            host: \"127.0.0.1\"\n            # Server port number\n            # int: required\n            port: 6379\n        # Source name of Redis Server\n        # Defined by the user\n        # str: Alphanumeric characters, '-' and/or '_'\n        remote:\n            # Server host IP address\n            # str: required\n            host: \"192.168.0.52\"\n            # Server port number\n            # int: required\n            port: 16379\n            # Server password\n            # str: Optional\n            password: \"REDIS_SERVER_PASSWORD\"\n```\n\n#### Basic Example of appBlock Configuration\n\nHere\u2019s a basic example of how to configure the Redis worker in the `appBlock` settings:\n\n```yaml\noutputs:\n    # Redis output worker writes data to the Redis server\n    redis:\n        - # Redis server source configuration name\n          # Refer to the appConnectors Redis item with the source set as \"local\"\n          source: \"local\"\n          # Redis storage structure\n          # In this example, the Redis HmapTimeSeries module is selected\n          redis_data_structure: \"HmapTimeSeries\"\n          # Data write interval\n          time_interval: 1\n          # Data cache interval\n          # This value, combined with time_interval,\n          # determines how many points are sent simultaneously to the server.\n          # Total points = time_interval * cache_interval\n          # Example: Total points = 1 * 5 = 5\n          # Meaning every 5 seconds, 5 points are sent per node determined by the columns key\n          cache_interval: 5\n          # Redis node (must be unique)\n          # Used as the Set key to store nodes from columns\n          redis_node: \"bat_bmv700\"\n          # Reference columns for standardizing block names\n          # To be processed by vemonitor_m8 middleware\n          ref_cols:  [\n              ['bat_voltage', 'V'],\n              ['bat_current', 'I'],\n              ['bat_power', 'P']\n          ]\n          # Node columns to store in the Redis server\n          columns: \n              # Key: hMap node name\n              # Values: column block names to extract from the data read\n              bmv700: [\n                  'V', 'I', 'P', 'SOC', 'Alarm',\n                  'AR', 'Relay'\n              ]\n```\n\n### EmonCms Worker\nThe `EmonCms` worker is external python package [`emon_worker_m8`](https://github.com/vemonitor/emon_worker_m8).\nIt acts as an Output Interfacer API, tasked with sending data to an EmonCms web application.\n\nTo use it you need to install the package first:\n```\npip install emon_worker_m8\n```\n> **Warning**:\n> Try to ever maintain packages up to date.\n> ```yaml\n> pip install --update vemonitor_m8 emon_worker_m8\n> ```\n\nThen refer to the `emon_worker_m8` documentation file for how to use it.\n\n> **Note**  \n> If you want to install and run EmonCms locally,  \n> see the [EmonCms repository](https://github.com/emoncms/emoncms).\n\n#### Basic Example of appConnectors Configuration\n\nBelow is an example configuration for connecting to EmonCms servers using the `appConnectors` settings:\n\n```yaml\nappConnectors:\n    # EmonCms appConnectors settings\n    # Used to establish connections to EmonCms servers\n    emoncms:\n        # Source name of the EmonCms Server\n        # Defined by the user\n        # str: Alphanumeric characters, '-' and/or '_'\n        local:\n            # Base HTTP address and port of the EmonCms Server\n            # str: required\n            addr: \"http://127.0.0.1:8080\"\n            # EmonCms Server API Key\n            # Must have write permissions to work properly\n            # str: required\n            apikey: \"EMONCMS_API_KEY\"\n```\n\nThis example demonstrates how to configure an `appConnectors` entry for connecting to a local EmonCms server, including setting the server address and API key with write permissions.\n\n#### Basic Example of appBlock Configuration\n\nHere\u2019s a basic example of how to configure the `emon_worker_m8` worker in the `appBlock` settings:\n```yaml\n    outputs:\n        emoncms:\n            -   name: \"bat_t1\"\n                source: \"local\"\n                columns:\n                    bmv700: [\n                        'V', 'I', 'P', 'CE', 'SOC', 'Alarm',\n                        'AR', 'Relay','H2', 'H17', 'H18', 'time_ref'\n                    ]\n                time_interval: 1\n                cache_interval: 10 # number of items to send at same time\n```\n\n## VE.Direct to EmonCms\nThis example demonstrates how to read data from devices using the Serial VE.Direct text protocol and send the specified data at regular intervals to the [EmonCms](https://emoncms.org/) web application.\n\n> **Note:** You need to install the [Emoncms worker extra package](https://github.com/vemonitor/emon_worker_m8).\n```\npip install emon_worker_m8\n```\nIf you want to install and run EmonCms locally, see the [EmonCms repository](https://github.com/emoncms/emoncms).\n\n### Configuration Files\n\n> See the [sample configuration files](https://github.com/vemonitor/vemonitor_m8/tree/main/config_sample/vedirect_to_emoncms).\n\nYou can copy these sample configuration files to your own configuration directory and then update them with the necessary settings.\n\n### Running VeMonitor\n\nFirst, ensure that you have installed any additional worker packages you require.\n\nNext, set up your configuration files in the appropriate configuration directory.\n\n#### How It Works\n\nIn the [main sample configuration file](https://github.com/vemonitor/vemonitor_m8/blob/main/config_sample/vedirect_to_emoncms/vm_conf.yaml) (`vm_conf.yaml`), there are two different `AppBlocks`:\n- `BatteryMonitor`\n- `BatteryAndPannelsMonitor`\n\nFor example, you can run `BatteryMonitor` for testing purposes.\n\nBased on the configuration settings, this app will read data from the VE.Direct Serial Device (e.g., BMV700), and the data will be cached on the local Redis server:\n\n- Every second, retrieve values from:\n    ```python\n    [\n        'V', 'I', 'P', 'CE', 'SOC', 'Alarm',\n        'AR', 'Relay', 'H2', 'H17', 'H18'\n    ]\n    ```\n- Every 2 seconds, retrieve values from:\n    ```python\n    [\n        'TTG', 'H1', 'H3', 'H4', 'H5'\n    ]\n    ```\n- Every 5 seconds, retrieve values from:\n    ```python\n    [\n        'H6', 'H7', 'H8', 'H9', 'H10'\n    ]\n    ```\n- Every 10 seconds, retrieve values from:\n    ```python\n    [\n        'H11', 'H12', 'H13', 'H14', 'H15', 'H16'\n    ]\n    ```\n\nThe data will then be sent to the EmonCms Server. For more details, see the [Emoncms worker extra package](https://github.com/vemonitor/emon_worker_m8).\n\n#### Running the Application\n\nTo run the `BatteryMonitor` app block:  \n```\npython vemonitor_m8 --block BatteryMonitor --debug\n```\n\nTo run the `BatteryAndPannelsMonitor` app block: \n```\npython vemonitor_m8 --block BatteryAndPannelsMonitor --debug\n```\n",
    "bugtrack_url": null,
    "license": "Apache",
    "summary": "Solar Plant Monitoring",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/vemonitor/vemonitor_m8"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95da3f45fb4b0e100df977cdedc40badb227f07622ed40b718e1177161f21422",
                "md5": "5f66d0bf3feae559a535430cd196cb00",
                "sha256": "0337b1bc09c5bc615d4e3edc1b7c4a170b357f0b2f08bd3da55e74ab411ac094"
            },
            "downloads": -1,
            "filename": "vemonitor_m8-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5f66d0bf3feae559a535430cd196cb00",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">3.5.2",
            "size": 74024,
            "upload_time": "2024-09-03T09:35:26",
            "upload_time_iso_8601": "2024-09-03T09:35:26.707928Z",
            "url": "https://files.pythonhosted.org/packages/95/da/3f45fb4b0e100df977cdedc40badb227f07622ed40b718e1177161f21422/vemonitor_m8-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "070dcd4dc4ca6830df6a2138bdd8e4297ad10127a9c0b2d7fd8e7045d96fd1c9",
                "md5": "cd3de2191662239b9ef3fb2a88dfa328",
                "sha256": "e254b650c35c512a34beba9d09ca7478f38a7ed56a20d651df3f4fbd91da9c71"
            },
            "downloads": -1,
            "filename": "vemonitor_m8-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "cd3de2191662239b9ef3fb2a88dfa328",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">3.5.2",
            "size": 54258,
            "upload_time": "2024-09-03T09:35:28",
            "upload_time_iso_8601": "2024-09-03T09:35:28.213903Z",
            "url": "https://files.pythonhosted.org/packages/07/0d/cd4dc4ca6830df6a2138bdd8e4297ad10127a9c0b2d7fd8e7045d96fd1c9/vemonitor_m8-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-03 09:35:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vemonitor",
    "github_project": "vemonitor_m8",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "vemonitor-m8"
}
        
Elapsed time: 1.08289s