GithubHelp home page GithubHelp logo

dbus-goecharger's Introduction

dbus-goecharger

Integrate go-eCharger into Victron Energies Venus OS

Purpose

With the scripts in this repo it should be easy possible to install, uninstall, restart a service that connects the go-eCharger to the VenusOS and GX devices from Victron. Idea is inspired on @fabian-lauer and @trixing project linked below, many thanks for sharing the knowledge:

How it works

My setup (only relevant for this script)

  • 3-Phase installation
  • Venus OS on Raspberry PI 4 4GB version 1.1 - Firmware v2.84
    • No other devices from Victron connected
    • Connected to Wifi netowrk "A"
  • go-eCharger hardware version 2
    • Make sure in your go-eCharger app that api v1 is activated
    • Connected to Wifi network "A" with a known IP

Details / Process

What is the script doing:

  • Running as a service
  • connecting to DBus of the Venus OS com.victronenergy.evcharger.http_{DeviceInstanceID_from_config}
  • After successful DBus connection go-eCharger is accessed via REST-API - simply the /status is called and a JSON is returned with all details A sample JSON file from Shelly 1PM can be found here
  • Serial/MAC is taken from the response as device serial
  • Paths are added to the DBus with default value 0 - including some settings like name, etc
  • After that a "loop" is started which pulls go-eCharger data every 750ms from the REST-API and updates the values in the DBus

Thats it 😄

Restrictions

This script until now supports reading values from the go-eCharger. Writing values is supported for "Enable Charging", "Charging current" and "Max charging current". Control of go-eCharger by the victron system in "Mode" "Auto" is not supported for now and changing the value will have no effect.

Pictures

Remote Console - Overview go-eCharger - Values go-eCharger - Values SmartMeter - Device Details Victron Portal - Dashboard Victron Portal - Advanced

Install & Configuration

Get the code

Just grap a copy of the main branche and copy them to a folder under /data/ e.g. /data/dbus-goecharger. After that call the install.sh script.

The following script should do everything for you:

wget https://github.com/vikt0rm/dbus-goecharger/archive/refs/heads/main.zip
unzip main.zip "dbus-goecharger-main/*" -d /data
mv /data/dbus-goecharger-main /data/dbus-goecharger
chmod a+x /data/dbus-goecharger/install.sh
/data/dbus-goecharger/install.sh
rm main.zip

⚠️ Check configuration after that - because service is already installed an running and with wrong connection data (host) you will spam the log-file

Change config.ini

Within the project there is a file /data/dbus-goecharger/config.ini - just change the values - most important is the deviceinstance under "DEFAULT" and host in section "ONPREMISE". More details below:

Section Config vlaue Explanation
DEFAULT AccessType Fixed value 'OnPremise'
DEFAULT SignOfLifeLog Time in minutes how often a status is added to the log-file current.log with log-level INFO
DEFAULT Deviceinstance Unique ID identifying the shelly 1pm in Venus OS
ONPREMISE Host IP or hostname of on-premise Shelly 3EM web-interface

Usefull links

Discussions on the web

This module/repository has been posted on the following threads:

dbus-goecharger's People

Contributors

llarrylaffer avatar naiki92 avatar vikt0rm avatar viktoorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbus-goecharger's Issues

current.log runs full

I got issues some time ago with a 100% full /data mount and a current.log file that was >2gig of size, and therefore not addressable at all from venusos (not deleteable either). I had to reformat the /data partition to get rid of this issue.

This all happened as I didn't check the current.log which runs full and grows with an ever repeating error message.

2022-09-22 11:54:05,276 root CRITICAL Error at _update
Traceback (most recent call last):
  File "/data/dbus-goecharger/dbus-goecharger.py", line 189, in _update
    self._dbusservice['/MCU/Temperature'] = int(data['tmp'])
KeyError: 'tmp'
2022-09-22 11:54:05,484 root CRITICAL Error at _update
Traceback (most recent call last):
  File "/data/dbus-goecharger/dbus-goecharger.py", line 189, in _update
    self._dbusservice['/MCU/Temperature'] = int(data['tmp'])
KeyError: 'tmp'
2022-09-22 11:54:05,753 root CRITICAL Error at _update
Traceback (most recent call last):
  File "/data/dbus-goecharger/dbus-goecharger.py", line 189, in _update
    self._dbusservice['/MCU/Temperature'] = int(data['tmp'])
KeyError: 'tmp'

Seems it can't read the MCU's temperature. Anyway I can stop the script from doing so (no pyhthon knowledge on my side, and I don't want to crash anything)? NB: For now I just commented the line 189 out (#) and it seems to work.

Thanks

EDIT: I don't know how venusos works, but it seems there is no logrotate or something? Does your script take care of the growing log file??

Position ändern (AC-out -> AC-in)

Hallo,
die Wallbox ist bei mir auf der AC-in Seite angeschlossen und somit würde ich sie auch gerne dort visualisiert haben.
Der entsprechende Punkt (Position) wird jedoch von dem Script nicht angelegt.
Falls also jemand das gleiche Problem hat, hier zwei mögliche Lösungen:

Wenn man in dbus-goecharger.py nach Zeile 57 folgende Zeile einfügt, kann man die Darstellung variieren:
self._dbusservice.add_path('/Position', 0)
0 - AC out
1 - AC in

Etwas komfortabler geht es natürlich, wenn der entsprechende Punkt in der config.ini aufgenommen wird ...
Dafür müssen in der config.ini unter [default] folgende Zeilen ergänzt werden:

# Go-e charger AC-Position: 0 = AC out, 1 = AC in
AcPosition = 1

Und in dbus-goecharger.py hinter Zeile 27:
acPosition = int(config['DEFAULT']['AcPosition'])
sowie hinter Zeile 57 (jetzt 58):
self._dbusservice.add_path('/Position', acPosition)

Temperature causes issue

self._dbusservice['/MCU/Temperature'] = int(data['tmp'])

causes an error on the newer firmware version (055.5)

logfile owerflow

Hi,
a got a problem with my setup. Everything seems to work but the "current.log" is getting full with following error messeges and the display on VRM ist frozen.

2023-09-27 14:22:49,617 root INFO Start
2023-09-27 14:22:49,638 root CRITICAL Error at main
Traceback (most recent call last):
File "/data/dbus-goecharger/dbus-goecharger.py", line 262, in main
pvac_output = DbusGoeChargerService(
File "/data/dbus-goecharger/dbus-goecharger.py", line 25, in init
config = self._getConfig()
File "/data/dbus-goecharger/dbus-goecharger.py", line 80, in _getConfig
config.read("%s/config.ini" % (os.path.dirname(os.path.realpath(file))))
File "/usr/lib/python3.8/configparser.py", line 697, in read
self._read(fp, filename)
File "/usr/lib/python3.8/configparser.py", line 1082, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: '/data/dbus-goecharger/config.ini', line: 2
'AccessType = OnPremise\n'
2023-09-27 14:22:52,669 root INFO Start
2023-09-27 14:22:52,681 root CRITICAL Error at main
Traceback (most recent call last):
File "/data/dbus-goecharger/dbus-goecharger.py", line 262, in main
pvac_output = DbusGoeChargerService(
File "/data/dbus-goecharger/dbus-goecharger.py", line 25, in init
config = self._getConfig()
File "/data/dbus-goecharger/dbus-goecharger.py", line 80, in _getConfig
config.read("%s/config.ini" % (os.path.dirname(os.path.realpath(file))))
File "/usr/lib/python3.8/configparser.py", line 697, in read
self._read(fp, filename)

20230927_135742908_iOS

Can someone help me?

Support for EVCC in addition to your specific wallbox?

Hello,

I am searching an option to add my Wallbe Pro and so I am thinking about to fork your implementation,
but then I thought maybe we could add the opensource project evcc.io as a configuration.
So second data source. Then you would allow to inject more or less every wallbox which is available at the moment.

What do you think?

Best regards
Sebastian

Ladestatus und Ladezeit werden nicht aktualisiert

Hi,

installiert nach Anleitung direkt auch dem Multiplus, dennoch werden Status (Verbunden, nicht verbunden) und Ladezeit nicht angezeigt.

Hat jemand eine Idee? Auch ist die Anzeige im Dashboard bei Victron überlagert?!

Das Log läuft mit folgendem Fehler voll:

2023-03-06 07:45:44,820 root CRITICAL Error at _update
Traceback (most recent call last):
  File "/data/dbus-goecharger/dbus-goecharger.py", line 189, in _update
    self._dbusservice['/MCU/Temperature'] = int(data['tmp'])
KeyError: 'tmp'
2023-03-06 07:45:45,127 root CRITICAL Error at _update
Traceback (most recent call last):
  File "/data/dbus-goecharger/dbus-goecharger.py", line 189, in _update
    self._dbusservice['/MCU/Temperature'] = int(data['tmp'])
KeyError: 'tmp'
2023-03-06 07:45:45,350 root CRITICAL Error at _update
Traceback (most recent call last):
  File "/data/dbus-goecharger/dbus-goecharger.py", line 189, in _update
    self._dbusservice['/MCU/Temperature'] = int(data['tmp'])
KeyError: 'tmp'
2023-03-06 07:45:45,646 root CRITICAL Error at _update
Traceback (most recent call last):
  File "/data/dbus-goecharger/dbus-goecharger.py", line 189, in _update
    self._dbusservice['/MCU/Temperature'] = int(data['tmp'])
KeyError: 'tmp'
2023-03-06 07:45:45,844 root CRITICAL Error at _update
Traceback (most recent call last):
  File "/data/dbus-goecharger/dbus-goecharger.py", line 189, in _update
    self._dbusservice['/MCU/Temperature'] = int(data['tmp'])
KeyError: 'tmp'

Bildschirm­foto 2023-03-06 um 08 34 25

How to deinstall

Hey!
Thanks for your work!
Sadly my Victron MP2 GX is overloaded and its even not possible to do any firmware update anymore. Thats why I have to deinstall severall shelly and the go-e from the venus OS.
How can I deinstall your code?
BR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.