Problem z przesyłan...
 
Powiadomienia
Wyczyść wszystko

Pomoc Problem z przesyłaniem danych pomiędzy HA a Influxdb

4 Wpisów
2 Użytkownicy
0 Reactions
665 Wyświetleń
(@marekbb)
Wpisów: 2
Świeżak
Autor tematu
 

Dzień dobry, zaczynam zabawę z HA. Mam zainstalowane na VM xen HA na Debian11. Dane zbieram poprzez ESP8266 z DELY BMS 14s
Konfiguracja to:
HA, ESPHOME, InfluxDB, Grafana.
Mam 2 problemy których nie jestem w stanie rozwiązać i potrzebuje pomocy.

Pierwszy to brak odczytu danych z pierwszych cell baterii - tak jak by było jakieś ograniczenie - jeżeli w pliku bms.yaml mam liczbę celi np 8 to jest ok. Jak mam 14 to pierwsze są pomijane.

bms.yaml

esphome:
  name: bms

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "2uXSaYo2EE+Sm2hxlpaa51cno3bgqUQB3cJG9PGX6q0="

ota:
  password: "3c2b7e4360d158a3c28cd56d02552eab"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bms Fallback Hotspot"
    password: "0jYIDlmrMVJG"

captive_portal:

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 9600

daly_bms:
  update_interval: 60s

sensor:
  - platform: daly_bms
    voltage:
      name: "Battery Voltage"
    current:
      name: "Battery Current"
    battery_level:
      name: "Battery Level"
    max_cell_voltage:
      name: "Max Cell Voltage"
    max_cell_voltage_number:
      name: "Max Cell Voltage Number"
    min_cell_voltage:
      name: "Min Cell Voltage"
    min_cell_voltage_number:
      name: "Min Cell Voltage Number"
    remaining_capacity:
      name: "Remaining Capacity"
    cells_number:
      name: "Cells Number"
    temperature_1:
      name: "Temperature 1"
    cell_1_voltage:
      name: "Cell 1 Voltage"
    cell_2_voltage:
      name: "Cell 2 Voltage"
    cell_3_voltage:
      name: "Cell 3 Voltage"
    cell_4_voltage:
      name: "Cell 4 Voltage"
    cell_5_voltage:
      name: "Cell 5 Voltage"
    cell_6_voltage:
      name: "Cell 6 Voltage"
    cell_7_voltage:
      name: "Cell 7 Voltage"
    cell_8_voltage:
      name: "Cell 8 Voltage"
    cell_9_voltage:
      name: "Cell 9 Voltage"
    cell_10_voltage:
      name: "Cell 10 Voltage"
    cell_11_voltage:
      name: "Cell 11 Voltage"
    cell_12_voltage:
      name: "Cell 12 Voltage"
    cell_13_voltage:
      name: "Cell 13 Voltage"
    cell_14_voltage:
      name: "Cell 14 Voltage"

text_sensor:
  - platform: daly_bms
    status:
      name: "BMS Status"


binary_sensor:
  - platform: daly_bms
    charging_mos_enabled:
      name: "Charging MOS"
    discharging_mos_enabled:
      name: "Discharging MOS"

Log z ESP z pominiętymi celami od 1 do 6

INFO Reading configuration  usunięty link 
INFO Starting log output from bms.local using esphome API
INFO Successfully connected to bms.local
[22:22:52][I][app:102]: ESPHome version 2022.11.1 compiled on Nov 19 2022, 21:45:47
[22:22:52][C][wifi:504]: WiFi:
[22:22:53][C][wifi:362]:   Local MAC: 68:C6:3A:F8:67:E1
[22:22:53][C][wifi:363]:   SSID: 'AP01-493'[redacted]
[22:22:53][C][wifi:364]:   IP Address: 192.168.12.78
[22:22:53][C][wifi:365]:   BSSID: 74:83:C2:8A:39:ED[redacted]
[22:22:53][C][wifi:367]:   Hostname: 'bms'
[22:22:53][C][wifi:369]:   Signal strength: -64 dB ▂▄▆█
[22:22:53][C][wifi:373]:   Channel: 1
[22:22:53][C][wifi:374]:   Subnet: 255.255.255.0
[22:22:53][C][wifi:375]:   Gateway: 192.168.12.1
[22:22:53][C][wifi:376]:   DNS1: 192.168.12.1
[22:22:53][C][wifi:377]:   DNS2: 8.8.8.8
[22:22:53][C][logger:293]: Logger:
[22:22:53][C][logger:294]:   Level: DEBUG
[22:22:53][C][logger:295]:   Log Baud Rate: 115200
[22:22:53][C][logger:296]:   Hardware UART: UART0
[22:22:53][C][uart.arduino_esp8266:102]: UART Bus:
[22:22:53][C][uart.arduino_esp8266:103]:   TX Pin: GPIO1
[22:22:53][C][uart.arduino_esp8266:104]:   RX Pin: GPIO3
[22:22:54][C][uart.arduino_esp8266:106]:   RX Buffer Size: 256
[22:22:54][C][uart.arduino_esp8266:108]:   Baud Rate: 9600 baud
[22:22:54][C][uart.arduino_esp8266:109]:   Data Bits: 8
[22:22:54][C][uart.arduino_esp8266:110]:   Parity: NONE
[22:22:54][C][uart.arduino_esp8266:111]:   Stop bits: 1
[22:22:54][C][uart.arduino_esp8266:113]:   Using hardware serial interface.
[22:22:54][W][uart.arduino_esp8266:127]:   You're using the same serial port for logging and the UART component. Please disable logging over the serial port by setting logger->baud_rate to 0.
[22:22:54][C][daly_bms:025]: Daly BMS:
[22:22:54][C][captive_portal:088]: Captive Portal:
[22:22:54][C][mdns:103]: mDNS:
[22:22:54][C][mdns:104]:   Hostname: bms
[22:22:54][C][ota:093]: Over-The-Air Updates:
[22:22:54][C][ota:094]:   Address: bms.local:8266
[22:22:54][C][ota:097]:   Using Password.
[22:22:54][C][api:138]: API Server:
[22:22:54][C][api:139]:   Address: bms.local:6053
[22:22:55][C][api:141]:   Using noise encryption: YES
[22:23:43][D][sensor:126]: 'Cell 7 Voltage': Sending state 3.61200 V with 3 decimals of accuracy
[22:23:43][D][sensor:126]: 'Cell 8 Voltage': Sending state 3.61200 V with 3 decimals of accuracy
[22:23:43][D][sensor:126]: 'Cell 9 Voltage': Sending state 3.61200 V with 3 decimals of accuracy
[22:23:43][D][sensor:126]: 'Cell 10 Voltage': Sending state 3.61200 V with 3 decimals of accuracy
[22:23:43][D][sensor:126]: 'Cell 11 Voltage': Sending state 3.61200 V with 3 decimals of accuracy
[22:23:43][D][sensor:126]: 'Cell 12 Voltage': Sending state 3.61200 V with 3 decimals of accuracy
[22:23:43][D][sensor:126]: 'Cell 13 Voltage': Sending state 3.61100 V with 3 decimals of accuracy
[22:23:43][D][sensor:126]: 'Cell 14 Voltage': Sending state 3.60800 V with 3 decimals of accuracy
[22:23:43][D][sensor:126]: 'Temperature 1': Sending state 8.00000 °C with 0 decimals of accuracy
[22:23:44][D][sensor:126]: 'Battery Voltage': Sending state 50.50000 V with 1 decimals of accuracy
[22:23:44][D][sensor:126]: 'Battery Current': Sending state 0.00000 A with 1 decimals of accuracy
[22:23:44][D][sensor:126]: 'Battery Level': Sending state 73.70000 % with 1 decimals of accuracy
[22:23:44][D][sensor:126]: 'Max Cell Voltage': Sending state 3.61200 V with 2 decimals of accuracy
[22:23:44][D][sensor:126]: 'Max Cell Voltage Number': Sending state 12.00000  with 0 decimals of accuracy
[22:23:44][D][sensor:126]: 'Min Cell Voltage': Sending state 3.60800 V with 2 decimals of accuracy
[22:23:44][D][sensor:126]: 'Min Cell Voltage Number': Sending state 14.00000  with 0 decimals of accuracy

 Problem drugi to taki że dane z ESP BMS do InfluxDB są przesyłane jednorazowo tylko przy restarcie HA potem ich nie widać w influxdb.

configuration.yaml

influxdb:
  host: a0d7b954-influxdb
  port: 8086
  username: homeassistant
  password: homeassistant
  max_retries: 3
  default_measurement: state

 

 
Dodane : 19/11/2022 10:37 pm
krskrab
(@krskrab)
Wpisów: 47
Praktykant
 

Nie znam się ale:

Dodane przez: @marekbb

Signal strength: -64 dB ▂▄▆█

Jest słabym sygnałem.

Dodane przez: @marekbb

update_interval: 60s

Jesteś pewny, że "s" powinno być po 60 sekundach 

 
Dodane : 20/11/2022 10:53 am
(@marekbb)
Wpisów: 2
Świeżak
Autor tematu
 

@krskrab uważam że sygnał jest poprawny, interval jest ok. Pierwszy problem rozwiązałem ustawiając bufor dla uart

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 9600
  rx_buffer_size: 1024
 
Dodane : 20/11/2022 12:29 pm
krskrab
(@krskrab)
Wpisów: 47
Praktykant
 

@marekbb 

update_interval: 5s nie powinien dotyczyć platformy sensorów?

Na tej zasadzie (strzelam po omacku)

sensor:
  - platform: daly_bms
    voltage:
      name: "Battery Voltage"
    current:
      name: "Battery Current"
...
    update_interval: 5s

konfiguracja z netu

uart:
  tx_pin: GPIO17 #TX do złącza B  TX0 - GPIO1  TX2 - GPIO17
  rx_pin: GPIO16 #RX do złącza A  RX0 - GPIO3  RX2 - GPIO16
  baud_rate: 9600
  stop_bits: 2


sensor:
  - platform: pzemdc
    current:
      name: "PZEM-017 Current"
    voltage:
      name: "PZEM-017 Voltage"
    power:
      name: "PZEM-017 Power"
    update_interval: 5s
 
Dodane : 20/11/2022 12:47 pm
Udostępnij: