kindr007 / victronsmartshunt-esphome Goto Github PK
View Code? Open in Web Editor NEWSmartShunt ve.direct to ESPHOME node
License: MIT License
SmartShunt ve.direct to ESPHOME node
License: MIT License
Hello to everyone,
I installed my second battery pack with second Victron Smart shunt. I set-up the esp8266 as the first one, and i pasted same code of the first one, but doesn't work.
In the working one, there are 38 items, and in the new one there is only one entity.
Would same one help me to find the problem?
Thank you for your help
Hello,
i just wanted to ask if the victron BMV 700 is supported.
Victron itself says that the smartshunt is a BMV 712 just without display and potential free relay.
The BMV 700 is a BMV 712, just without bluetooth and the ability to measure the middle voltage of a battery bank.
So it should not be so hard to support it, if it doesnt work right now, should it?
In best case you should pick the same as the MPPT project: MIT.
the other threat was close.
sorry if I doble posted.
in regars of issue #33
I got this device and it resets to 100% every single day between 8 am and 9 am, also my %SoC
has some really weird spikes of 900%.
i dont think that is the yaml code but definitely theres something wrong.
I have connected the posisitve of the smart shunt to the positive of the batterty and the shart shunt in series with the load and the smartshunt TX to esp8266 D7. no GND to the VE.DIRECT port, but that doesnt eplain why the smart shunt restest to 100% by itself.
my yaml code
esphome:
name: "${lower_devicename}"
platform: ESP8266
board: d1_mini
comment: "Monitor and a Victron Smart Shunt via TTL"
external_components:
- source: github://KinDR007/VictronSmartShunt-ESPHOME@main
refresh: 0s
substitutions:
lower_devicename: "smartshunt"
devicename: "SmartShunt"
config_version: "v2021.06.02.001"
wifi_fast_connect: "true"
accuracy: "3"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
manual_ip:
static_ip: 192.168.0.23
gateway: 192.168.0.1
subnet: 255.255.255.0
dns1: 192.168.0.1
dns2: 8.8.8.8
ap:
ssid: "${devicename} Hotspot"
password: !secret wifi_ap_password
captive_portal:
logger:
baud_rate: 0
api:
ota:
web_server:
port: 80
time:
- platform: homeassistant
uart:
id: uart_0
tx_pin: D8
rx_pin: D7
baud_rate: 19200
stop_bits: 1
data_bits: 8
parity: NONE
rx_buffer_size: 256
victron_smart_shunt:
uart_id: uart_0
sensor:
- platform: victron_smart_shunt
battery_voltage:
name: "Battery Voltage"
id: bv
accuracy_decimals: ${accuracy}
battery_current:
name: "Battery Current"
id: bc
accuracy_decimals: ${accuracy}
instantaneous_power:
name: "instantaneous power"
id: instantaneous_power
filters:
- multiply: 0.001
unit_of_measurement: kWh
accuracy_decimals: ${accuracy}
time_to_go:
name: "time to go"
id: time_to_go
consumed_amp_hours:
name: "consumed amp hours"
id: consumed_amp_hours
unit_of_measurement: Ah
accuracy_decimals: ${accuracy}
min_battery_voltage:
name: "Min battery voltage"
id: min_battery_voltage
accuracy_decimals: ${accuracy}
max_battery_voltage:
name: "Max battery voltage"
id: max_battery_voltage
accuracy_decimals: ${accuracy}
amount_of_charged:
name: "Amount of charged"
id: amount_of_charged
filters:
- multiply: 0.000001
unit_of_measurement: MWh
device_class: energy
state_class: total_increasing
accuracy_decimals: ${accuracy}
bmv_alarm_text:
name: "BMV alarm"
id: bmv_alarm
last_full_charge:
name: "Time since last full charge"
id: last_full_charge
deepest_discharge:
name: "Depth of the deepest discharge"
id: deepest_discharge
unit_of_measurement: Ah
accuracy_decimals: ${accuracy}
last_discharge:
name: "Depth of the last discharge"
id: last_discharge
unit_of_measurement: Ah
accuracy_decimals: ${accuracy}
state_of_charge:
id: state_of_charge
name: "SoC"
discharged_energy:
name: "Amount of discharged energy"
id: discharged_energy
filters:
- multiply: 0.000001
unit_of_measurement: MWh
device_class: energy
state_class: total_increasing
accuracy_decimals: ${accuracy}
- platform: template
name: " ${devicename} discharge "
filters:
- multiply: 0.001
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
accuracy_decimals: ${accuracy}
lambda: |-
float i = id(consumed_amp_hours).state;
float e = id(bv).state;
float w = 0.0;
if (i < 0) {
w = i * e;
}
return {w * -1} ;
- platform: template
name: " ${devicename} charge "
filters:
- multiply: 0.001
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
accuracy_decimals: ${accuracy}
lambda: |-
float i = 792 + id(consumed_amp_hours).state;
float e = id(bv).state;
float w = 0.0;
if (i > 0) {
w = i * e;
}
return {w} ;
- platform: template
name: " ${devicename} Rem. Capacity "
unit_of_measurement: Ah
device_class: energy
state_class: total_increasing
lambda: |-
if (id(state_of_charge).state) {
return 792 * (id(state_of_charge).state * 0.01f);
}
return NAN;
switch:
- platform: restart
icon: mdi:reload-alert
name: "${devicename} Restart"
Best Regards,
M.
It is possible to combine both projects? Could you point out the differences of the protocols?
Hi,
I've spent hours trying trying to make this work, but no such luck. Do I have a defective board?
Arduino: 1.8.15 (Windows 10), Board: "SparkFun ESP32 Thing, 80MHz, Default, 921600, None"
C:\Users\kevin\OneDrive\Documents\SmartShuntWiFi\SmartShuntWiFi.ino:138:32: warning: multi-character character constant [-Wmultichar]
val = Vser.readStringUntil('\r\r\n'); // this is the line that reads the value of the label
^
C:\Users\kevin\OneDrive\Documents\SmartShuntWiFi\SmartShuntWiFi.ino: In function 'void loop()':
C:\Users\kevin\OneDrive\Documents\SmartShuntWiFi\SmartShuntWiFi.ino:138:40: warning: large integer implicitly truncated to unsigned type [-Woverflow]
val = Vser.readStringUntil('\r\r\n'); // this is the line that reads the value of the label
^
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-frame-address'
c:/users/kevin/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find crt1-sim.o: No such file or directory
c:/users/kevin/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find _vectors.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "WiFiUdp.h"
Used: C:\Users\kevin\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
Not used: C:\Users\kevin\OneDrive\Documents\Arduino\libraries\WiFi
Not used: C:\Users\kevin\OneDrive\Documents\Arduino\libraries\WiFiEspAT
Multiple libraries were found for "SoftwareSerial.h"
Used: C:\Users\kevin\OneDrive\Documents\Arduino\libraries\EspSoftwareSerial
Not used: C:\Users\kevin\OneDrive\Documents\Arduino\libraries\espsoftwareserial-master
exit status 1
Error compiling for board SparkFun ESP32 Thing.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
has anyone tried to use the new smartshunt model
SHU065150050 IP65 . its waterproof and the ve. direct is a cable instead of a port
thanks
Miguel
hello, Im trying to create a temple to display my battery
remaining capacity in Ah.
here is my code:
- platform: template
name: " ${devicename} rem. capacity "
id: rc
unit_of_measurement: Ah
device_class: energy
state_class: total_increasing
accuracy_decimals: ${accuracy}
lambda: |-
float i = 0.0;
float e = id(bv).state;
float w = id(kWhc).state;
if (w > 0) {
i = w / e;
}
return {i};
but I get the flollowing error:
I do have a similar template for battery charge in kWh and that one works:
- platform: template
name: " ${devicename} charge "
id: kWhc
filters:
- multiply: 0.001
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
accuracy_decimals: ${accuracy}
lambda: |-
float i = 264 + id(consumed_amp_hours).state;
float e = id(bv).state;
float w = 0.0;
if (i > 0) {
w = i * e;
}
return {w};
I just added the id:kWhc to name: " ${devicename} charge "
please advice.
best regards,
Miguel
Hello,
is there a way to get the current status (open or closed) of the relay from an BMV 700?
Thank you
so everything works and uploads fine but I can not for the life of me get it to show anything from the BMV everything is unavailable I've changed pins and everything I can think of. I checked the voltage and I should be correct haha. Has anyone gotten anything other than the smart shunt to read?
Hi thanks for your great job to ESPhomify this Victron device. Seems Victron released the BLE protocol:
https://community.victronenergy.com/questions/93919/victron-bluetooth-ble-protocol-publication.html
Maybe there is a hope to add it in your current implementation ?
Sébastien
hello sir,
For a project, I have to find a way to import individual data from the smart shunt. To get the data dump in the first place I have used python code from Github. Using a VE direct cable I was able to get data every second. The problem is that I only need the voltage, current, power and SOC and not all data that the smart shunt sends every second. Do you have an idea how to only get the right data from the data dump?
All information that I used to get the data from the smart shunt you can find here karioja/vedirect.
your sincerely,
livestyle4
Hello,
First of all, this is awesome. Thanks for putting this together, worked like a charm.
I have a VictronSmartShunt with a temperature sensor connected to the aux, would it be possible to pull temperature?
Cheers,
Dick
I had no problem adding the setup info and connecting to my MQTT broker to my ESP32 but could not find anywhere that ESPHome would allow me to add a global throttle. Rather than add a throttle to each topic, I ended up using your VictronMPPT-ESPHOME/smartshunt-esp8266-example.yaml and modifying it for an ESP32 (it's working great even though I find the MQTT topic structure to be rather long-winded).
I tried this first as I only have the SmartShunt and was using the ESP32 but it didn't suit my needs without being able to throttle down the runaway messages I was getting.
Do you agree to rename this component to victron_smart_shunt
? Without the name clash between VictronMPPT-ESPHOME
and VictronSmartShunt-ESPHOME
both components could be used simultaneously at the same ESP (on different UARTs).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.