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
        In theory this should work an all systems with Python3 and docker installed. However, the debian packages only target Ubuntu Focal as of now.
        
        - Add Consolinno dev stage debian repo
            ```bash
            sudo wget -qO - https://packages.services.consolinno.de/repo_signing.key | sudo apt-key add -
            sudo sh -c 'echo "deb https://packages.services.consolinno.de/ubuntu-focal focal dev" >>  /etc/apt/sources.list.d/consolinno.list'
            sudo apt update
            ```
        - Your system must provide a working `docker` and `docker-compose` installation. 
            ```bash
            sudo apt install docker docker-compose
            # Add your user to the docker group to allow running docker images
            sudo usermod -a -G docker <insert-your-username> 
            ```
        
        - You must have access to the Consolinno docker registry. Use your GitLab account to login
            ```bash
            docker login registry.consolinno-it.de 
            ```
        
        ## Installation
        
            sudo apt install virtual-hems
        
        ## Usage
        ```
        gen-virtual-hems-config --opti_user <insert_user> --opti_password <insert_pw> --instance_name "Consolinno HEMS"
        gen-virtual-hems
        run-virtual-hems
        ```
        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.
        
        
        ### Modbus Simulators
        You can simulate Modbus/TCP devices (based on nymea-plugins-modbus register definition) by using the following options:
        
             gen-virtual-hems --modbus-device alphainnotec --modbus-hostname AITHeatpump
        
        This simulates a alpha innotec heatpump and you'll be able to use the according integration plugin. See `--help` for more information. All Modbus/TCP devices in the `nymea-plugins-modbus` project should be made available automatially by our GitLab CI.
        
        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)
        
        
        ### Further customization 
        The `gen-virtual-hems` script allows many customizations:
        
            gen-virtual-hems --install-packages nymea-plugin-sungrow --initial-upgrade --modbus-device sungrow --modbus-hostname SUNGROW 
            run-virtual-hems
        
        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
