Git Product home page Git Product logo

shm-et340's Introduction

Victron Faker

This small program emulates the ET340 Energy Meter in a Victron ESS System. It reads values from an existing SMA Home Manager 2.0, and publishes the result on dbus as if it were the ET340 meter.

Use this at your own risk, I have no association with Victron or SMA and am providing this for anyone who already has these components and wants to play around with this.

I use this privately, and it works in my timezone, your results may vary

Setup

First ensure that this will work: Try out https://github.com/mitchese/sma_home_manager_printer which will run on your Victron GX device and try to connect to the SMA meter. The above test program does not publish its result on dbus for use by victron, only prints out the result for your verification. It should be relatively safe to test with.

If the sma_home_manager_printer works and shows consistent/reliable result, then you can install this in the same way.

You don't need to compile the source code if you don't want to (see compiling below). Head over to the releases and download the latest version. then:

While this is running, you should see correct values for a grid meter in your Venus UI:

Venus GX UI

On the console of your GX device, you should see regular updates, around once per second:

root@victronvenusgx:~# ./shm-et340
INFO[0000] Successfully connected to dbus and registered as a meter... Commencing reading of the SMA meter
INFO[0000] Meter update received: 6677.15 kWh bought and 3200.45 kWh sold, 681.3 W currently flowing
INFO[0001] Meter update received: 6677.15 kWh bought and 3200.45 kWh sold, 694.1 W currently flowing
INFO[0002] Meter update received: 6677.15 kWh bought and 3200.45 kWh sold, 686.3 W currently flowing

If this does not work, try to export LOG_LEVEL="debug" first, which should print out significantly more information on what's happening.

Starting at boot

The above steps will start it once, which will run until the next reboot. Doing the following will start it on every boot

Thanks to ricott for the tip here. The full description of how to start on boot can be found here. Basically, add the call to /data/rc.local.

Mine tried to start before the network was up, which resulted in an error and it not starting. To 'fix' this, I just wait 15s in the rc.local before trying to start the script ... not great but it works.

root@beaglebone:~# cat /data/rc.local
!#/bin/bash

sleep 15
setsid /data/home/root/shm-et340 > /dev/null 2>/dev/null &

root@beaglebone:~# ls -l /data/rc.local
-rwxr-xr-x    1 root     root            81 Feb 18 15:38 /data/rc.local

Compiling from source

For windows, and more detailed instructions, head on over to Schnema1's fork

To compile this for the Venus GX (an Arm 7 processor), you can easily cross-compile with the following:

GOOS=linux GOARCH=arm GOARM=7 go build

Additional Info

For more details, see the thread on the Victron Energy community forums here:

https://community.victronenergy.com/questions/49293/alternative-to-et340-mqtt-sma-home-manager.html

TODO

  • Setup a start/stop script and describe how to install as a system service
  • Make builds and releases automatic
  • Test against fw upgrades of the Venus OS
  • Handle a power failure of the Home manager (or other network issues preventing updates)

shm-et340's People

Contributors

mitchese avatar

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.