Python client and API for monitoring and controling energy diversion devices from MyEnergi

Overview

Python client and API for monitoring and controling energy diversion devices from MyEnergi

A set of library functions and objects for interfacing with the cloud servers of MyEnergi to monitor and control their Zappi and Eddi power diversion products, supports fetching latest data, as well as changing charge modes, setting boost timers automatically from Octopus Agile pricing.

Includes the ability to run as a deamon to manage the system, automatically changing modes/priorities based on available power and other inputs, as well as control TP-LINK HS110 wifi power sockets, automaticaly querying the Nissan API for Leaf SOC data and displaying results to e-Paper display connected to a Raspberry Pi. This includes a "charge to 80%" and "automatically charge if below 20% when connected" features.

This builds heavily on https://github.com/twonk/MyEnergi-App-Api and https://myenergi.info/api-f54/

Configuration

The code can be run directly from a checkout, no install process is required however some non-core python libs might be needed.

A config file is required and should contain at least the credentials used to authenticate against the MyEnergi severs,

username: 
   
    
password: 
    

    
   

Additionally, to use the Leaf integration the you need the Nissan credentials, as well as the location of a local checkout of https://github.com/filcole/pycarwings2.git

leaf:
    username: 
   
    
    password: 
    
     
    region: 
     
      
pycarwings_path: 

     
    
   

To use the Jaguar Land Rover integration the you need to pip install jlrpy and set config file with permissions. Config includes a max SOC - set to 100 if you wish to control max SOC from this application (https://github.com/ardevd/jlrpy.git)

jlr:
    username: 
   
    
    password: 
    

    
   

For all cars it's possible to set the battery capacity and control the behaviour based on battery charge. Setting the capacity is required to perform SOC calculations, the value here should be the amount of power requried to be delived to the car to change from 0% SOC to 100% SOC, as measured by the Zappi. charge_below is the SOC value at which the Zappi will automatically change to ECO mode regardless of surplus, this allows for protection of battery against sitting at low SOC values and ensuring there's a minimum SOC available. stop_at is the value that the Zappi will change into Stop mode, again to preserve battery. charge_below and stop_at can both be set to 'null' to disable this feature.

leaf:
    capacity: 35
    charge_below: 20
    stop_at: 80

If using the Octopus Agile features it's necessary to set the region

agile:
    region: H

Finally, it's possible to apply some manual configuration to the CT clams on individual devices, for example if they are configured as 'Monitor' or 'AC Storage'. In this way I am able to have mine report figures for my iBoost although it's seen by the Zappi as a AC Battery.

If you have a 3 phase Zappi and net across phases then you need to note this in the config as below or the system will assume non-netting and take grid values from phase 1 only. You can ignore this for single phase and non-netting 3phase.

For clarity on logging or display its optional to add a name for your Zappi here too

house_data:
    
   
    :
        ectt2: 
    
     
        name: Outside Zappi
    
     
      :
        ectt3: 
      
       
        name: Garage Zappi
    net_phases1: True

      
     
    
   

Use

Most scripts can be run directly, and will print results to screen, as well as logging to logs/myenergi.log

get_zappi_boost.py

Shows the currently configured boost timers

get_zappi_history.py

Shows the historic data from the cloud. Can show both per minute data or per hour data for any specified day (if present on the servers) as well as fetching the data but reporting only daily totals.

set_zappi_mode.py

Sets the current mode of the Zappi. Currently sets the mode of all Zappis to stop, needs command line options added.

set_boost_charge.py

Sets boost timers on the Zappi. Automatically configures boost timers for the Zappi, based on Octopus Agile pricing. Accepts options for desired SOC (Nissan Leaf only), desired time, charge rate, amount of charge and to clear existing timers.

run_zappi.py

Reports current state of system to stdout, and can run as a server controlling the system.

run_zappi.py start

Launches the deamon in the background.

Will run as a server if run with no argunments and change Zappi mode automatically, use "run_zappi.py once" to simply display data and exit_

API

The API is much wider than the utilities provided, and understands most of the known endpoints, including almost all of the functionality that exists in the App. It is antipiated that most people will want to interface directly with existing applications or monitoring systems rather than using the scripts directly.

You might also like...
Python lib to control HottoH based stove devices

Project desciption This library can be used to discuss with HootoH based stove devices Actually tested and validated with a CMG Drum stove. To use thi

Python library for Seeedstudio Grove devices
Python library for Seeedstudio Grove devices

grove.py Python library for Seeedstudio Grove Devices on embeded Linux platform, especially good on below platforms: Coral Dev Board (Wiki) NVIDIA Jet

Temperature Monitoring and Prediction Using a Modified Lambda Architecture
Temperature Monitoring and Prediction Using a Modified Lambda Architecture

Temperature Monitoring and Prediction Using a Modified Lambda Architecture A more detailed write up can be seen in this paper. Original Lambda Archite

Demonstrating attacks, mitigations, and monitoring on AWS

About Inspectaroo is a web app which allows users to upload images to view metadata. It is designed to show off many AWS services including EC2, Lambd

Official Python client for the MonkeyLearn API. Build and consume machine learning models for language processing from your Python apps.

MonkeyLearn API for Python Official Python client for the MonkeyLearn API. Build and run machine learning models for language processing from your Pyt

Slack bot for monitoring your Metaflow flows!
Slack bot for monitoring your Metaflow flows!

Metaflowbot - Slack Bot for your Metaflow flows! Metaflowbot makes it fun and easy to monitor your Metaflow runs, past and present. Imagine starting a

Coin-based opinion monitoring system
Coin-based opinion monitoring system

介绍 本仓库提供了基于币安 (Binance) 的二级市场舆情系统,可以根据自己的需求修改代码,设定各类告警提示 代码结构 binance.py - 与币安API交互 data_loader.py - 数据相关的读写 monitor.py - 监控的核心方法实现 analyze.py - 基于历史数

🖥️ Python - P1 Monitor API Asynchronous Python Client

🖥️ Asynchronous Python client for the P1 Monitor

AutomaTik is an automation system for MikroTik devices with simplicity and security in mind.
AutomaTik is an automation system for MikroTik devices with simplicity and security in mind.

AutomaTik Installation AutomaTik is an automation system for MikroTik devices with simplicity and security in mind. Winbox is the main tool for MikroT

Owner
null
A modern Python client for controlling Wyze devices.

Python Wyze SDK A modern Python client for controlling Wyze devices. Whether you're building a custom app, or integrating into a third-party service l

Shaun Tarves 205 Jan 2, 2023
Polar devices Python API and CLI.

loophole - Polar devices API About Python API for Polar devices. Command line interface included. Tested with: A360 Loop M400 Installation pip install

[roscoe] 145 Sep 14, 2022
Home Assistant custom integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, officially maintained by the Tuya Developer Team.

Tuya Home Assistant Integration Home Assistant custom integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, officially mainta

Tuya 704 Jan 3, 2023
Beyonic API Python official client library simplified examples using Flask, Django and Fast API.

Beyonic API Python official client library simplified examples using Flask, Django and Fast API.

Harun Mbaabu Mwenda 46 Sep 1, 2022
wyscoutapi is an extremely basic API client for the Wyscout API (v2 & v3) for Python

wyscoutapi wyscoutapi is an extremely basic API client for the Wyscout API (v2 & v3). Usage Install with pip install wyscoutapi. To connect to the Wys

Ben Torvaney 11 Nov 22, 2022
Python API Client for Twitter API v2

?? Python Client For Twitter API v2 ?? Why Twitter Stream ? Twitter-Stream.py a python API client for Twitter API v2 now supports FilteredStream, Samp

Twitivity 31 Nov 19, 2022
Dns-Client-Server - Dns Client Server For Python

Dns-client-server DNS Server: supporting all types of queries and replies. Shoul

Nishant Badgujar 1 Feb 15, 2022
Raphtory-client - The python client for the Raphtory project

Raphtory Client This is the python client for the Raphtory project Install via p

Raphtory 5 Apr 28, 2022
Drcom-pt-client - Drcom Pt version client with refresh timer

drcom-pt-client Drcom Pt version client with refresh timer Dr.com Pt版本客户端 可用于网页认

null 4 Nov 16, 2022
A Python SDK for connecting devices to Microsoft Azure IoT services

V2 - We are now GA! This repository contains code for the Azure IoT SDKs for Python. This enables python developers to easily create IoT device soluti

Microsoft Azure 381 Dec 30, 2022