Victron Energy VEDirect Bluetooth

Since you did get as far as installing the base esphome on your device then yes, just paste the rest of the code then you can save the file. Then hit the 3 dots and Validate. If no errors do “Install” and “Wirelessly”.

1 Like

Thanks, went to try that but the device will no longer connect to wifi. No idea what the problem is, it connected yesterday as you saw with my images above.

I connected it to my Mac again and looked at the log .

It keeps scanning for networks, finding them, not connecting and timing out. According to the log it is seeing network with good signal strength but won’t connect.

[I][wifi:257]: WiFi Connecting to 'Telstra25BEB0'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(esphome-web-82e879): lwIP error -16 on interface st (index 0)
[W][wifi:549]: Error while connecting to network.
[I][wifi:257]: WiFi Connecting to 'Telstra25BEB0'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(esphome-web-82e879): lwIP error -16 on interface st (index 0)
[W][wifi:543]: Timeout while connecting to WiFi.
[D][wifi:386]: Starting scan...
[D][wifi:401]: Found networks:
[I][wifi:444]: - 'Telstra25BEB0' [redacted]▂▄▆█
[D][wifi:446]:     Channel: 11
[D][wifi:447]:     RSSI: -31 dB
[I][wifi:444]: - 'Telstra25BEB0' [redacted]▂▄▆█
[D][wifi:446]:     Channel: 2
[D][wifi:447]:     RSSI: -59 dB
[I][wifi:444]: - 'Telstra25BEB0' [redacted]▂▄▆█
[D][wifi:446]:     Channel: 1
[D][wifi:447]:     RSSI: -65 dB
[I][wifi:444]: - 'Telstra25BEB0' [redacted]▂▄▆█
[D][wifi:446]:     Channel: 1
[D][wifi:447]:     RSSI: -33 dB
[D][wifi:449]: - [redacted] [redacted]▂▄▆█
[I][wifi:257]: WiFi Connecting to 'Telstra25BEB0'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(esphome-web-82e879): lwIP error -16 on interface st (index 0)
[W][wifi:549]: Error while connecting to network.
[I][wifi:257]: WiFi Connecting to 'Telstra25BEB0'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(esphome-web-82e879): lwIP error -16 on interface st (index 0)
[W][wifi:543]: Timeout while connecting to WiFi.

Lather, rise, repeat.

OK, update, after a long time it seems to have connected. Not particularly reassuring that it drops offline for so long, especially if I hope to use it for battery monitoring.

Will give the yaml code update a crack.

OK, I pasted in the yaml code at the end and used the validate option. It says it’s invalid and lists a range of errors:

First up is this:

INFO Reading configuration /config/esphome/esphome-web-82e879.yaml...
Failed config

uart: [source /config/esphome/esphome-web-82e879.yaml:33]
  - id: the_uart
    
    Cannot resolve pin name 'D7' for board esp01_1m.
    rx_pin: D7
    baud_rate: 19200
    stop_bits: 1
    data_bits: 8
    parity: NONE
    rx_buffer_size: 256

Not sure what that means. I looked up and came across this:

hoping it might shed some light for me but not really. I tried changing the line

  rx_pin: D7

with

  rx_pin: GPIO7

but that just resulted in a different error.

Next, were the following. Looks like a spelling error for this one:

  [instantaneous_power] is an invalid option for [sensor.victron_smart_shunt]. Did you mean [instanteneous_power], [panel_power]?
  instantaneous_power: 
    name: instantaneous power
    id: instantaneous_power

When I replaced it with the incorrect spelling of instanteneous for instantaneous then the error was resolved.

Then this one:

[bmv_alarm] is an invalid option for [sensor.victron_smart_shunt]. Did you mean [bmv_alarm_text]?
  bmv_alarm: 
    name: BMV alarm
    id: bmv_alarm

So I changed it to the suggested bmv_alarm_text and again the error was resolved.

Finally:

  [bmv_pid] is an invalid option for [sensor.victron_smart_shunt]. Did you mean [pid]?
  bmv_pid: 
    name: bmv - pid
    id: bmv_pid

Since pid is already defined further up in the code, I wasn’t sure what this was for, so I put hashtags in from of these lines and the error was resolved.

So now I am left with the first listed error, Cannot resolve pin name 'D7' for board esp01_1m. when I do a validation check. Bit stuck on that one.

Could you expand on what you meant when you said you started to receive harmless garbage values?
I noticed that occasionally I am seeing my battery voltage spike to 30v or drop to 0v (12v system). Im wondering if you saw similar behavior.

@wattmatters - I have a bit of feeling that many issues here are not directory related to Victron code (like initial flashing ESP modules) and thus maybe in future would be better (cleaner) to start another topic with such issues…
Now, for your WiFi issues it looks like you have several AP with the same name (working on different channels) - this might be a challenge and maybe here there are some ideas how to fix it (in therms of stability)
For your pin name “D7” issue I had it with some ESP boards. For some of them names used by producers (Like D1, D2,…) are accepted by ESPHome add-on editor and for some boards not, and then you have to use GPIOnn instead. Check this site for referencing which D pin is which GPIO for your particular board.

Thanks, yeah I don’t know enough about these issues to know what’s what.

In the end it seems to have connected. I have wifi repeaters (supplied by the ISP router supplier) so I guess they are using different channels and maybe some conflicts.

Thanks!

I had a look and it seems D7 is the same as GPIO13 (I had earlier tried GPIO7 thinking it might be wanted ot use GPIO instead of D). So I replaced D7 in the code with GPIO13 and revalidated. That error has now been resolved but the validation threw up a new error, so now need to track that one down.

This is the new error:

INFO Reading configuration /config/esphome/esphome-web-82e879.yaml...
Failed config

sensor.victron_smart_shunt: [source /config/esphome/esphome-web-82e879.yaml:52]
  platform: victron_smart_shunt
  battery_voltage: 
    name: Battery Voltage
    
    ID bv redefined! Check sensor->0->battery_voltage->id.
    id: bv
    disabled_by_default: False
    force_update: False
    unit_of_measurement: V
    icon: mdi:flash
    accuracy_decimals: 3
    device_class: voltage
  battery_current: 
    name: Battery Current
    
    ID bc redefined! Check sensor->0->battery_current->id.

I’ll look a bit more and see what I can work out for these.

I’m sure it’s painful reading my stream of ignorance!

This just seems a promising option for getting my Smart Shunt data into HA, and it is important data to me, many of my energy system automations rely on it. I get it now via an alternative but that prevents me from accessing other battery data. So I am hoping I can crack this nut, but I need some guidance.

Found the error, those two sensors were defined twice in the code I pasted in. Removed the duplicates and

INFO Reading configuration /config/esphome/esphome-web-82e879.yaml...
INFO Configuration is valid!

Yay!

Installed and got this message at the end:

INFO Successfully compiled program.
INFO Resolving IP address of esphome-web-82e879.local
INFO  -> 192.168.0.97
INFO Uploading /data/esphome-web-82e879/.pioenvs/esphome-web-82e879/firmware.bin (516080 bytes)
INFO Compressed to 357985 bytes
Uploading: [============================================================] 100% Done...

So it looks like success. Now to work on the wiring of the ESPboard to the Shunt.

Thanks all for your patience. I’m learning a lot.

Will report back once I have had a suitable opportunity for connecting the wires.

After a few stabs and a couple solder points I got things nearly as small as they can be.

Hello from new relaised i have problem with all my esp. Do you have same problem?

What’s your config? Try setting to uart1. I know I can’t OTA mine but I can flash it locally if it isn’t plugged into the Victron.

Use uart_0 in yaml configuration

1 Like


This is what’s i have

I also have the cables connected directly to my RPI without going through an ESP. I see that the ESP files refer to an external Victron component.

How do you replace that directly in the configuration.yaml file?

I have this already:

  • platform: serial
    serial_port: /dev/ttyACM0
    baudrate: 19200

Read my post again.
Use uart_0 not uart0

1 Like

As @pepe59 said you need the underscore. This was caused by an esphome update. Where uart0 worked before you now need uart_0. I think it’s important people know why this is now the issue :wink:

Hi , uart0 its private name in esphome
use some other name eg

uart:
 id: my_uart_name 



victron:
 uart_id: my_uart_name

or whatever you choose

So I sat down today having finally decided to hardwire an ESP device to my Victron to get the data and very luckily stumbled upon this post:

https://www.reddit.com/r/homeassistant/comments/13ip2mt/victron_bluetooth_devices_to_home_assistant/

Getting the data passively via Bluetooth is now possible!

It takes a little extra effort to get the Advertising Key so HA can decrypt the data, but otherwise it’s quite seamless; once you add the custom integration and restart it was even auto-discovered! I spent a while trying to get said key off of my android phone but finally gave up and went the Linux route mentioned in the Reddit post.

If the Linux bit is just too much for you, I ran across some posts (I think they might have been official Victron ones?) that mentioned they are working to make the advertising key accessible from within the app. They were relatively recent posts (earlier this year), so I’m hopeful that comes to fruition. That would make this whole process INCREDIBLY simple and straight-forward.

Here’s a screenshot of everything it’s pulling in:
image

4 Likes

That is amazing. Victron, while loving open source, has always been tight lipped about their Bluetooth. This gets the door cracked and hopefully swung fully open soon!

Awesome!!! Thankyou, I’ve been hoping for this!!!