Git Product home page Git Product logo

venus.dbus-shellyplug's Introduction

dbus-shellyPlug

Integrate Shelly energy meters 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 a Shelly device as power meter to the VenusOS and GX devices from Victron.

Pictures

Install & Configuration

Get the code

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

The following script should do everything for you:

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

Before installing a new version, uninstall the installed version:

/data/dbus-shellyPlug/uninstall.sh

Change config.ini

Within the project there is a file /data/dbus-shellyPlug/config.ini. Create a new section for each Shelly device to be created.

Section Config value Explanation
Shelly[n] Deviceinstance Unique ID identifying Shelly device in Venus OS
Shelly[n] Interval Poll interval for meter data

Shelly settings

The following settings are available in the device settings menu inside Venus OS:

Config value Explanation
Role Valid values Grid meter, PV inverter, Generator or AC load: mode of operation for the energy meter
Position Only for PV inverter. Valid values AC input 1, AC input 2 or AC output: Position where the Shelly device is connected.
Phase Valid values L1, L2 or L3: represents the phase where the Shelly device is connected
Meter Index Measurement channel on multi-channel power meters.
IP Address IP address of the Shelly device
User Name Username for htaccess login - leave blank if no username/password required
Password Password for htaccess login - leave blank if no username/password required
Show Temperature Add the temperature sensor of the Shelly device as additional device in Venus OS
Reverse Flow Reverses the indicated direction of energy flow.

Used documentation

venus.dbus-shellyplug's People

Contributors

telekatz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mcfrojd

venus.dbus-shellyplug's Issues

Shelly EM support?

Any chanse of support for the Single phase Shelly EM?
Maybe i colud support with some data from the EM?

I have tested most of the shelly script out there and yours is by far the best one imo.
Your log handeling and what happens when you disconnect the shellys is superior to the others i have tested.

Since i use mine in a motorhome where you connect and disconnect on a Daily basis, your script is by far the most stable one.

No MeterIndexSelector for ShellyPlus2PM - Shelly Plus2PM support ?

Thanks for the VenusOS-Addons.

A ShellyPlus1PM works OK, but with an ShellyPlus2PM no "MeterIndex" is showing.
The "switch:0"-Values are OK, but without the "MeterIndex Selector", "switch:1" is not possible to select - do you have an idea ?

Result of
http://192.168.1.1/rpc/Shelly.GetStatus
is:

{"ble":{},"cloud":{"connected":true},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"mqtt":{"connected":false},"switch:0":{"id":0, "source":"WS_in", "output":false, "apower":0.0, "voltage":227.7, "freq":50.0, "current":0.000, "pf":0.00, "aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1704054510}, "ret_aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1704054510},"temperature":{"tC":35.1, "tF":95.1}},"switch:1":{"id":1, "source":"init", "output":true, "apower":0.0, "voltage":227.8, "freq":50.0, "current":0.127, "pf":0.00, "aenergy":{"total":3310.837,"by_minute":[0.000,0.000,0.000],"minute_ts":1704054510}, "ret_aenergy":{"total":1124.582,"by_minute":[0.000,0.000,0.000],"minute_ts":1704054510},"temperature":{"tC":35.1, "tF":95.1}},"sys":{"mac":"123456789012","restart_required":false,"time":"21:28","unixtime":1704054511,"uptime":16387,"ram_size":244424,"ram_free":129804,"fs_size":458752,"fs_free":131072,"cfg_rev":16,"kvs_rev":2,"schedule_rev":0,"webhook_rev":0,"available_updates":{},"reset_reason":3},"wifi":{"sta_ip":"192.168.1.1","status":"got ip","ssid":"ssid","rssi":-62},"ws":{"connected":false}}

VenusOS v3.13, venus.dbus-shellyPlug (Version 31.12.2023)

AC Load is not shown in GUI and kWh seems to be wrong.

Hey,
first thanks a lot for this cool project.

My system is built with a

  • MPPT 100/30 Charger
  • BMV 712 battery monitor
  • Inverter that has no connection to the victron (!)

It is a stand alone system with no connection to grid in a garden.

As I´d linke to know, how much energy is drawn via 240VAC (the inverter) and via DC (I also have some DC loads) I thought I use your script with a Shelly PRO 1EM and configure "has DC System" in the Venus OS.

The readings show up :
image

The GUI shows:
image

What is a bit strange :

  • after 50 minutes with a load of 1300W the kWh is only. 0,02kWh
  • the ACload does not show up in the GUI
  • the complete power drawn is regarded as DC load (the difference between 1300W and 1450W is the efficiency of the inverter.

Is there any chance that the AC load shows up in the GUI?
Where is my fual tin thinking regarding the kWh ?

Can I assist in any way by logs or something else?

Greets from Stuttgart - Germany
Sven

High amount of kWh "counted" at random times

Hello,

the problem are random energy amounts that are counted over the day. Mostly it happens one time a day.

I run 2 Shelly Plug S as PV inverter and the newest version of the driver is installed. The connection of both Shelly Plugs is weak and they are placed side by side.

Victron_historical_data

You can see the spike which is added as solar energy. At the same time the consumption rises because the imaginary energy did not leave the network.
You can not see the energy in the Victron remote console, in the graphs of the Shelly Plugs in VRM or in the Shelly Cloud.

Could this be a driver problem?

Shelly Plus1PM support ?

I can get data from all my ShellyPlugs, thank you.
What is not working is getting data from the Plus1PM.

https://shelly-api-docs.shelly.cloud/gen2/Devices/ShellyPlus1PM

Result of

http://192.168.178.202/rpc/Shelly.GetStatus

is:

{"ble":{},"cloud":{"connected":true},"input:0":{"id":0,"state":false},"mqtt":{"connected":false},"switch:0":{"id":0, "source":"init", "output":true, "apower":28.2, "voltage":224.4, "current":0.256, "aenergy":{"total":66102.508,"by_minute":[276.255,473.929,474.905],"minute_ts":1678533754},"temperature":{"tC":51.0, "tF":123.8}},"sys":{"mac":"3C6105799168","restart_required":false,"time":"12:22","unixtime":1678533756,"uptime":234413,"ram_size":234492,"ram_free":156592,"fs_size":458752,"fs_free":98304,"cfg_rev":14,"kvs_rev":0,"schedule_rev":0,"webhook_rev":0,"available_updates":{}},"wifi":{"sta_ip":"192.168.178.202","status":"got ip","ssid":"Skynet","rssi":-31},"ws":{"connected":false}}

A selector between gen1 / gen2 would be great !

install.sh script not fully woring on Venus OSv3.0?

Hi,
if it´s possible that your script dos not work on the Venus OS v3.0?
on installation process i got a failer: So in the GUI i can not configure the ip etc...

root@raspberrypi2:~# wget https://github.com/telekatz/venus.dbus-shellyPlug/arch ive/refs/heads/main.zip
--2023-07-18 07:59:15-- https://github.com/telekatz/venus.dbus-shellyPlug/archi ve/refs/heads/main.zip
unzip main.zip "venus.dbus-shellyPlug-main/*" -d /data
mv /data/venus.dbus-shellyPlug-main /data/dbus-shellyPlug
chmod a+x /data/dbus-shellyPlug/install.sh
/data/dbus-shellyPlug/install.sh
rm main.zipResolving github.com... 140.82.121.4
Connecting to github.com|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/Telekatz/venus.dbus-shellyPlug/zip/refs/he ads/main [following]
--2023-07-18 07:59:16-- https://codeload.github.com/Telekatz/venus.dbus-shellyP lug/zip/refs/heads/main
Resolving codeload.github.com... 140.82.121.9
Connecting to codeload.github.com|140.82.121.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/zip]
Saving to: ‘main.zip’

main.zip [ <=> ] 280.19K 1.29MB/s in 0.2s

2023-07-18 07:59:17 (1.29 MB/s) - ‘main.zip’ saved [286913]

root@raspberrypi2:# unzip main.zip "venus.dbus-shellyPlug-main/*" -d /data
Archive: main.zip
creating: venus.dbus-shellyPlug-main/
inflating: venus.dbus-shellyPlug-main/LICENSE
inflating: venus.dbus-shellyPlug-main/README.md
inflating: venus.dbus-shellyPlug-main/config.ini
creating: venus.dbus-shellyPlug-main/img/
inflating: venus.dbus-shellyPlug-main/img/device.png
inflating: venus.dbus-shellyPlug-main/img/deviceInfo.png
inflating: venus.dbus-shellyPlug-main/img/deviceList.png
inflating: venus.dbus-shellyPlug-main/img/settings.png
inflating: venus.dbus-shellyPlug-main/install.sh
creating: venus.dbus-shellyPlug-main/qml/
inflating: venus.dbus-shellyPlug-main/qml/PageAcInSetup.diff
inflating: venus.dbus-shellyPlug-main/restart.sh
creating: venus.dbus-shellyPlug-main/service/
inflating: venus.dbus-shellyPlug-main/service/run
inflating: venus.dbus-shellyPlug-main/shellyPlug.py
inflating: venus.dbus-shellyPlug-main/uninstall.sh
root@raspberrypi2:
# mv /data/venus.dbus-shellyPlug-main /data/dbus-shellyPlug
root@raspberrypi2:# chmod a+x /data/dbus-shellyPlug/install.sh
root@raspberrypi2:
# /data/dbus-shellyPlug/install.sh
Restore PageAcInSetup.qml
patching file /opt/victronenergy/gui/qml/PageAcInSetup.qml
Hunk 1 FAILED 90/90.
onValueChanged: role.possibleValues = getRoleList(value)
}

  •   VBusItem {
    
  •           id: instance
    
  •           bind: Utils.path(root.bindPrefix, "/DeviceInstance")
    
  •   }
    
  •   model: VisualItemModel {
              MbItemOptions {
                      id: role
    

root@raspberrypi2:~# rm main.zip

Error when installing on Venus 3.10-8

root@raspberrypi4:/# /data/dbus-shellyPlug/install.sh
Restore PageAcInSetup.qml
patching file /opt/victronenergy/gui/qml/PageAcInSetup.qml
Hunk 1 FAILED 90/90.
onValueChanged: role.possibleValues = getRoleList(value)
}

  • VBusItem {
  •   id: instance
    
  •   bind: Utils.path(root.bindPrefix, "/DeviceInstance")
    
  • }
  • model: VisualItemModel {
    MbItemOptions {
    id: role

Shelly Disappeared from Victron GUI

Hi i have installed the script, seen it in the Victron GUI and put my user name and the password and the shelly has now disappeared.
I have reinstalled the script getting it to over write but the shelly is not coming back on the GUI of the Victron device page. I can't seem to totally delete the script so it does not have the init file in nano.
My password is composed of 32 characters with an @ and my user name an email address i'm not sure if that is the issue?
Is there a way that i can remove the whole install and start again as the uninstall script does not seen to be removing anything?

Gui incomplete

Hey,

just found your script and is exactly what I need :)

However, unfortunately there is an error during installation:

svc: warning: unable to chdir to /service/gui: file does not exist

The GUI of everything looks as described - except the device settings. Beside "role" it is completely empty :(

image

Any idea or manual steps to resolve? (I tried to create the folder manually, but it doesn't seem the correct location)

Position not saved

I have two Plug S on AC-Out, and set so in den GUI.
After a reboot of the VenusOS they are back on AC-In1.
I use Venus OS v3.01.

The Pv inverter is not shown in the graphical representation

Hi Telekatz,

First many thanks for this implementation of Shelly Plug S. It works fine. What is the reason the new device is not represented in the graphical overview? Do I have to do a setup? Many thanks for some advice in advance.

Best regards Erich

IMG_0907

Enhancements

Hi,
I'm a fan of your package. It is really great. Good Work!

Maybe you can add a hint to your readme / configuration section. If you have an ip like xxx.xxx.xxx.xx (e.g. 192.168.178.32) you have to fill an zero to get the format .xxx (e.g. .032). I think that is better for all users that are no network nerds ;-)

Some shelly plugs also have an internal temperature sensor. Would it be possible to register the shelly device also as tempearture sensor?

Tim

Change power value in positiv value / add Charger

Hello,

Is it possible to integrate Shelly as a charging controller? I have a shelly 2 p.m. 1 channel for charging the battery and the second for controlling the PV inverter.

The second problem is that the value of channel 2 power (inverter) is negative. it's possible to switch this to a positive value?

Thx.
Stef

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.