question

jjahn avatar image
jjahn asked

Monitor ESS in realtime using Smartwatches and Arduino

I wanted live and up-to-date data on PV production, battery usage, grid usage and other stats that I did not get from the VRM portal, or only with several minutes of delay. Opening up the remote VenusGX UI also didn't scratch that itch, even though the data was updated much faster.

So I decided to pull that information from the VenusGX without having to modify it, and display that data on various displays around the house. Among the key features are updates every 60 seconds, histograms for various data types, and a animated display of the power flow.




If you want to do the same, this is what you need:

x) A Raspberry Pi or similar linux computer that has some webserver, php and bash on it.

x) An M5 Stack or an ESP32 with E-Ink display or a Samsung S3 or Galaxy Watch.

x) A bit of time ;)


The software can be found at the following repositories:


https://github.com/josefjahn/energydisplay-backend

This is the backend that pulls the data from the Victron system via SSH. No change to Victron equipment is required, you only have to set a root password via the remote console, and enter that password (and the VenusGX IP address) in the php script. Note that you can expose this information to the internet, or you can keep it within your LAN. You are in full control here.


https://github.com/josefjahn/energydisplay

This is arduino code for pulling the latest data from the backend and driving an E-Ink display. The display updates once ever 5 minutes to preserve the display's lifetime, and with that update rate you should be good for at least 10 years.






https://github.com/josefjahn/energydisplay-m5

This is arduino code for an M5-Stack. This handy little device is very cheap but offers a nice display and a few buttons so you can toggle various information displays.











https://github.com/josefjahn/SolarStatus-Gear

This is code for a Samsung Tizen smartwatch. It recreates the same user interface but uses HTML and CSS for everything. There's a second repo at https://github.com/josefjahn/SolarStatusWidget-Gear with a widget version so you can build whatever you prefer - or you can combine both into one package using Tizen Studio.



Let me know what you think, and patches are welcome!



ESSmonitoringarduinosmartwatch
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ commented ·

Wow!! Very nice

2 Likes 2 ·
6 Answers
Guy Stewart (Victron Community Manager) avatar image
Guy Stewart (Victron Community Manager) answered ·

Hi jjan,

Thank you for sharing this project here!

You have got us thinking about how we can set this community up to also better to support the developers working with Victron equipment.

If you have some ideas please let us know.

I am travelling at the moment, but will be testing some eInk displays when I get home.

There are new technologies being tested now at Victron to give users even better access to their system information.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Tim from Eat Sleep Van avatar image
Tim from Eat Sleep Van answered ·

A simple JSON Api on the colour controller would be amazing. And not just read values, but include ability to control simple things e.g. turn inverter on/off, set the tank levels manually, turn the relay on/off, change the AC current limit. In the meantime we can read from the VRM portal, but this only works if we have internet. I'm in a mobile home, so not always true. I'll also try using ModBUS, but I suspect SSH'ing into the colour controller and issuing commands that way might be easiest in the meantime.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

hobohome avatar image hobohome commented ·

Very nice project!

MQTT client is very easy to implement on an esp32. Look for the “pubsub” library.


1 Like 1 ·
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered ·

Hi ipearx; are you familiair with the mqtt API? Its available on websockets as well: perfect to access from within a webbrowser.


Here the server side code:

https://github.com/victronenergy/dbus-mqtt/blob/master/README.md


And here is a client:

https://github.com/victronenergy/venus-html5-app


Note that the internal data bus on Venus is D-Bus, so that mqtt server is nothing more than an interface onto D-Bus. As is modbustcp and so forth.

So, main documentation on available parameters is the dbus one:

https://github.com/victronenergy/venus/wiki/dbus


And, besides the documentation; I strongly recommend to use dbus-cli on ssh to browse around the available data.

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jjahn avatar image jjahn commented ·

I can confirm that querying dbus via ssh works great. Example commands and results can be found on top of the backend php script on my github too.

Results take a second or two but i found no adverse effects on the system.

1 Like 1 ·
Tim from Eat Sleep Van avatar image Tim from Eat Sleep Van commented ·

Ah ha, no I wasn't aware of MQTT, I'll have a play, thanks!

0 Likes 0 ·
markus avatar image
markus answered ·

Hi jjahn,

Very nice!!! Thank you for sharing this, good work!


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jjahn avatar image
jjahn answered ·

Small update, the E-ink version now has the watchdog enabled so it doesn't stop working every few days. The ESP32 Arduino Wifi library isn't really meant to run for long periods of time it seems.

I also added a project for an extractor/ingress fan control system which compares humidity with outside data for getting cool air inside, as well as a separate temperature driven extractor fan.

https://github.com/josefjahn/fancontrol


2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

ben avatar image ben ♦ commented ·

Great idea!

I'm curious about your e-ink/ESP32 implementation. Do you have any power consumption data you could share? I'm interested in a "remote" display that would have to run on a small battery. I wonder if it is realistic to get three or four months of runtime with such a setup, maybe by shutting down the radio as much as possible and reducing the polling interval to minutes rather than seconds?

0 Likes 0 ·
jjahn avatar image jjahn ben ♦ commented ·

The e-ink display uses 26.4mW for about 3 seconds for a single refresh. Idle power draw is listed as <0.017mW. The ESP32 has several power saving modes, light sleep is 0.8mA, deep sleep is between 5 and 150uA, during awake mode it's around 30mA. During Wifi activity, you can expect between 90 and 240mA current draw. A typical reload of the data uses only 2-3 seconds of WiFi.

Note that you should not refresh the display too often anyway since that reduces its lifespan. I refresh every 5 minutes and that is plenty, and means the display should not have problems for at least 7 years if I remember correctly.

I have no measurements since I run this off of mains, but I think if you strap a 3000mAh LiPo on this, you should be good for many months.

1 Like 1 ·
jjahn avatar image
jjahn answered ·

https://github.com/josefjahn/energydisplay-backend has been updated with additional values that can be stored into elasticsearch for visualizing overall system efficiency and system waste energy. This is calculated from the energy sum and illustrates how many watts are lost in the conversion, how many percent of the PV energy are wasted in heat, etc.


Note that the losses are exaggerated by the fact that when using BYD batteries, the battery current isn't updated as frequently and small current values may be reported as 0, so take this with a grain of salt during times of low sunlight.


1552479785209.png (72.1 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Additional resources still need to be added for this topic

What is ESS training video

ESS Quick Installation Guide

ESS design and installation manual