Fabian-Schmidt / esphome-victron_ble

Use official Victron BLE endpoint for fetching data from Victron devices via Bluetooth LE via ESPHome.
GNU General Public License v3.0
152 stars 15 forks source link

Slow polling of data. #32

Closed rowlest closed 8 months ago

rowlest commented 8 months ago

I have managed to get it connected and integrated but the update frequency over bluetooth is very slow ranging from 1 minute to 10 minutes. Whilst the total consumption seem to be ok doesnt help with live data eg load monitoring which is possible with the victron bluetooth app. Is it possible to increase polling frequency?

Fabian-Schmidt commented 8 months ago

Which victron device are you using? Shunts are known to have bad reception. And which ESP32 board are you using. Some ESP32 boards just have very poor reception. If you combine this it might explain your problem.

The component is using the same method as the victron app on the overview page. Is the overview page updated more frequently?

While you are in the victron app and connected to the device no announcement data is generated.

Last point if you have too many Bluetooth devices the esp gets flooded and can't process all messages. You should a message in the log if this happens.

rowlest commented 8 months ago

Thank you for the prompt reply.

I have a victron 100/20 MPPT and a Smart Shunt. I have a esp32-c3-devkitm-1 and raspbery pi4 for HA
So from what i have been able to tell its polling every 5 minutes. The app on the instant readout has only a marginal delay <5 secs.

'While you are in the victron app and connected to the device no announcement data is generated.' Very good to know but the polling is pretty consistent over an hour.

Only 2 devices shouldn't overload the esphome right?

Fabian-Schmidt commented 8 months ago

Can you try moving the ESP device closer to the victron device?

Can you provide the log of the esp?

I don't have tested it with an ESP32-c3. With a similar setup and an regular ESP32 I receive updates every few seconds exactly like in the victron app.

For Bluetooth devices it does not matter how many devices are used by the ESP but how many are in the radio range and broadcast messages. As every single message received by the ESP must be validated if it is a victron message.

rowlest commented 8 months ago

I place the esp device about 30cm away so should exclude that. No other bluetooth devices around it's all in a caravan. Good to know that it should update within seconds. I'll keep trying to preserve to increase the update times. Thank you again. I'll keep you posted to see if I had any luck.

Fabian-Schmidt commented 8 months ago

Can you provide a log from the ESPHome? Maybe there is an issue with the ESP32-C3.

rowlest commented 8 months ago

UPDATE: I wiped everything and started again now data is pretty much live! Not sure what what causing it but all working well. Cheers