Metadata-Version: 2.1
Name: virtual-hems
Version: 0.0.1
Summary: Tool to generate a docker-compose setup for a virtual Consolinno HEMS
Home-page: UNKNOWN
Author: Leonhard Heizinger
Author-email: l.heizinger@consolinno.de
License: UNKNOWN
Description: # Virtual Consolinno HEMS 
        
        ## Purpose
        This software package provides an easy way to spawn an instance of the Consolinno HEMS system consisting of `nymea:core` and `ConEMS`. You can run this on any `amd64` platform with docker installed on it. When running the `Consolinno HEMS App` on the same machine, the connection wizard should automatically detect the virtual HEMS instance. 
        
        ## Technical insight
        The docker-compose setup defines two containers `nymea-core` (IP 172.16.240.101) and `conems` (IP 172.16.240.102) which are joined via the docker network bridge `hems-netw`. Two volumes are mounted: 
        - `configs/conems/etc/conems` (container conems)
        - `configs/nymea/etc/nymea` (container nymea-core)
        
        At these locations the configs files of nymea and conems are defined. To generate the config files in advance the `gen_configs.py` scripts needs to be run.
        
        ## Requirements
        Your system must provide a working `docker` and `docker-compose` installation. 
        
        See https://docs.docker.com/engine/install/ubuntu/ and https://docs.docker.com/compose/install/linux/
        
            apt install python-jinja2
        
        ## Installation
        
            git clone git@gitlab.consolinno-it.de:leafletfirmware/virtual-hems.git
            cd virtual-hems
            sudo python setup.py develop 
            # The above command installs the project in develop mode. 
            # That way you can get the new version by just using git pull without the need to execute setup.py again
            # Debian packages are WIP
        
        ## Usage
        ```
        gen-virtual-hems-config --opti_user <insert_user> --opti_password <insert_pw> --instance_name "Consolinno HEMS"
        gen-virtual-hems
        docker-compose -f ~/.virtual-hems/docker-compose-generated.yaml up
        ```
        The credentials for `--opti_user` and  `--opti_password` can be found in BitWarden collection Embedded User -> Optimizer REST. If you do not set these values correctly the virtual HEMS system will in fact start, however ConEMS will fail to generate optimized schedules and thus the optimization will not work. 
        
        
        Use the `--help` option for `gen-virtual-hems-config` and `gen-virtual-hems-config` to get more information about the customatization possibilites.
        
        
        TODO: Update the following to be update with recent refactoring:
        
        **Note:**
        Currently the Images are based on the latest dev versions. QA and Prod support is WIP.
        To Use a Stage other than dev, set the `HEMS_STAGE` environment variable.
        For example run:
        ```
        HEMS_STAGE=qa docker-compose up
        ```
        to get a version running QA Images.
        
        ### Modbus Simulators
        By default the docker-compose setup spawns a service which simulates an alpha innotec heatpump using Modbus/TCP.
        You can also simulate other devices by setting environment variables:
        
            export MODBUS_DEVICE=stiebel-eltron MODBUS_HOSTNAME=StiebelEltronISG && docker-compose build && docker-compose up
        
        For some discovery implementations it might also be necessary to set a certain MAC address of the Modbus/TCP simulation:
        
            export MODBUS_DEVICE=alphainnotec MODBUS_SIM_MAC=02:42:ac:aa:bb:cc && docker-compose build && docker-compose up
        
        TODO: Test this with a device filtering by MAC address (alphainnotec does not). 
        
        Note: Simulations are WIP and are largely untested. Please report any occuring Bugs here: [Nymea Modbus Sim](https://gitlab.consolinno-it.de/leafletfirmware/nymea/nymea-modbus-sim)
        
        
        ### NEW: Python generator
        To allow a higher degree of customizability the following Python script can be used:
        
            python gen_dock_compose.py --install-packages nymea-plugin-sungrow --initial-upgrade --modbus-device sungrow --modbus-hostname SUNGROW && docker-compose -f docker-compose-generated.yaml up
        
        
        This example installs an additonal package `nymea-plugin-sungrow`, carries out `apt update && apt upgrade` and loads the modbus simulation for the Sungrow inverter. 
        
        ## TODO
        - [x] Add different stages (dev, qa, prod)
        - [x] Add Modbus/TCP simulators
        - [ ] Work out solution for persistence of nymea runtime data
        - [x] Refactor config file management
        - [ ] Add armhf architecture support 
        
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
