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
170 stars 16 forks source link

Installation #29

Closed RetoLu closed 4 months ago

RetoLu commented 10 months ago

What do I need apart from the Victron product, the Raspberry PI 4 has Bluetooth? How is this installed on the Home Assistant, is there a step by step guide?

Fabian-Schmidt commented 10 months ago

Hi, this is a an ESPHome component. So you will need an ESP32. This has no relationship to raspberry and run exclusively on the ESP. I personally use my ESPHome even without Homeassistent, but the ESPHome to Homeassistent integration is easy.

I know there is another project which uses python and offers a native raspberry integration.

RetoLu commented 10 months ago

Thanks for the quick reply. Yes, this is the project https://github.com/keshavdv/victron-hacs but unfortunately it does not work with the Victron 150/35. Unfortunately I have little experience with the integration in Home Assistant. Can I do this via the ESPHome in Home Assistant like in the project https://github.com/KinDR007/VictronMPPT-ESPHOME (of course without cables). What code do I need to load it into the ESP32 via ESPHome.

Fabian-Schmidt commented 10 months ago

From my Understanding this project and https://github.com/keshavdv/victron-hacs are using the same Bluetooth Advertisement data. So if it does not work with one it will not work with the other.

That said I don't understand why the SmartSolar 150/35 is not working. If you can use the VictronConnect App and upgrade it's firmware to the latest version and activate Instant readout it should work.

For a start how to use ESPHome please take a look at the excellent guide from EspHome https://esphome.io/guides/getting_started_hassio. Whe it comes to configuration of EspHome you can start with the example from the Readme https://github.com/Fabian-Schmidt/esphome-victron_ble#example-esphome-configuration-for-victron_ble-using-smartshunt-and-smartsolar

toessfrosch commented 10 months ago

I have tried to install this. The code seems to be on the ESP32 but it is always "offline" and there is no integration with Home Assistant. 2023-11-23 17 11 30 Could I connect the esp32 via wifi with the entry in the yaml-file? wifi: ssid: Network password: pw

When I look at the LOG file via USB it looks like this: INFO ESPHome 2023.10.6 INFO Reading configuration /config/esphome/victron-mppt.yaml... INFO Starting log output from /dev/ttyUSB0 with baud rate 115200 [17:35:21][D][victron_ble:282]: [F9:A2:EC:25:65:1F] Recieved SOLAR_CHARGER message. [17:35:21][D][sensor:094]: 'Battery Voltage': Sending state 20.29000 V with 2 decimals of accuracy [17:35:21][D][sensor:094]: 'Battery Current': Sending state 0.00000 A with 3 decimals of accuracy [17:35:21][D][sensor:094]: 'Yield Today': Sending state 0.00000 kWh with 2 decimals of accuracy [17:35:21][D][sensor:094]: 'PV Power': Sending state 0.00000 W with 0 decimals of accuracy [17:35:21][D][sensor:094]: 'Load Current': Sending state -51.10000 A with 1 decimals of accuracy [17:35:21][D][text_sensor:064]: 'MPPT state': Sending state 'Bulk' [17:35:21][D][text_sensor:064]: 'MPPT Error reason': Sending state '' [17:35:21][W][component:214]: Component victron_ble took a long time for an operation (0.05 s). [17:35:21][W][component:215]: Components should block for at most 20-30ms.

Fabian-Schmidt commented 10 months ago

To connect the ESP32 with Home Assist you must have the api in the configuration. See https://esphome.io/components/api. The default ESPHome config should have a good example for it.

RetoLu commented 10 months ago

Sorry, I don't understand how to do this. A connection has been established with the entries, I believe, but the values are not arriving in Home Assistant:

esphome: name: "victron-ble"

external_components:

esp32: board: esp32dev

**wifi: ssid: network password: pw

api:**

logger: level: DEBUG

esp32_ble_tracker:

victron_ble:

sensor: MySmartSolar

Fabian-Schmidt commented 10 months ago

As you are saying the ESP32 is recorded as offline in ESPHome portal. Therefore I believe you have a problem with the base ESPHome system not properly connecting to your HomeAssistant. Instead of a problem with this component.

toessfrosch commented 10 months ago

no, with these entries (wifi: ssid: network; password: pw) it is now online. But after the integration there are no entities.

Fabian-Schmidt commented 10 months ago

Are you referring to Entities in Home Assistant?

I don't have or use Home Assistant. I believe you must import the entries from ESPHome into Home Assistant. Please check the documentation of HA https://www.home-assistant.io/integrations/esphome/#configuration you might have to manual configurate the integration.

toessfrosch commented 9 months ago

Thanks for the help With this code in ESPHome I got it to work the sensors are displayed in Homeassistant. ESPHomeCodeVictronESP8266.txt