Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Info #1

Open
grydo opened this issue Dec 3, 2023 · 11 comments
Open

Info #1

grydo opened this issue Dec 3, 2023 · 11 comments

Comments

@grydo
Copy link

grydo commented Dec 3, 2023

Hi, I wanted to understand how to use esp32, how do I connect it to the charge controller?

@lucasimons
Copy link
Owner

lucasimons commented Dec 6, 2023

Hi, you have to use a rs485 converter... This is mine
IMG_20231206_071759.jpg

@grydo
Copy link
Author

grydo commented Dec 6, 2023

IMG_20231205_192359_824
This?

@lucasimons
Copy link
Owner

IMG_20231205_192359_824
This?

Yes I use the orange and orange white cable of rj45

@grydo
Copy link
Author

grydo commented Dec 6, 2023

pin 1 and pin 2 rj45?

@lucasimons
Copy link
Owner

Yes t 568B ... The first pin is orange-white and the second is orange, this two pin must be connected to rs485 converter

@grydo
Copy link
Author

grydo commented Dec 10, 2023

Thanks, I had it sorted, it happens to me that the next day it displays the incorrect values, restarting the converter everything works correctly.

@grydo
Copy link
Author

grydo commented Dec 27, 2023

mppt4880

It happens every day after the night, all the parameters are wrong.

@lucasimons
Copy link
Owner

mppt4880

It happens every day after the night, all the parameters are wrong.

Can you share your setup? Hardware and software (esphome file.yaml)

@grydo
Copy link
Author

grydo commented Dec 28, 2023

My device is atom m5 stack
my Yaml

substitutions:
device_name: mppt4880
device_description: "Monitor and control a MPPT-4880 via RS485 and send data to Home-Assistant via BT using Atom-M5"
friendly_name: "4880-MPPT"
name: mppt4880
device_id: mppt4880

esphome:
name: ${device_name}
platform: ESP32
board: m5stack-atom
platformio_options:
upload_speed: 115200

Enable logging

logger:

wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password
- ssid: !secret wifi_ssid_2
password: !secret wifi_password_2

manual_ip:
static_ip: 192.168.10.241
gateway: 192.168.10.1
subnet: 255.255.255.0
dns1: 192.168.10.1
dns2: 8.8.8.8

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:
ssid: "atom-3 Fallback Hotspot"
password: "123456789"

web_server:
port: 80

If you don't use Home Assistant please remove this api section and uncomment the mqtt component!

api:

#mqtt:

broker: 192.168.2.32

client_id: ${device_id}

discovery_retain: false

discovery_object_id_generator: device_name

captive_portal:

light:

  • platform: fastled_clockless
    chipset: WS2812B
    pin: 27
    num_leds: 1
    rgb_order: GRB
    id: status_led
    name: ${friendly_name} Light
    effects:
    • random:
    • flicker:
    • addressable_rainbow:

binary_sensor:

  • platform: gpio
    pin:
    number: 39
    inverted: true
    name: ${friendly_name} Button
    on_press:
    then:
    - light.toggle: status_led

button:
- platform: restart
id: ${device_id}_restart_button
name: "${friendly_name} Restart"

uart:
rx_pin: GPIO22
tx_pin: GPIO19
id: mod_bus
baud_rate: 9600
stop_bits: 1

modbus:
#flow_control_pin: 23
uart_id: mod_bus
id: mod_bus_mppt

modbus_controller:

  • id: mppt

    the Modbus device addr

    address: 0x1
    modbus_id: mod_bus_mppt
    command_throttle: 200ms
    setup_priority: -10
    update_interval: 5s

sensor:

- platform: modbus_controller

modbus_controller_id: mppt

name: Rated Current

address: 10009

register_type: holding

value_type: U_WORD

register_count: 1

filters:

- multiply: 0.1

  • platform: modbus_controller
    modbus_controller_id: mppt

    name: Charger Workstate
    address: 15201
    register_type: holding
    value_type: U_WORD
    register_count: 1

  • platform: modbus_controller
    modbus_controller_id: mppt

    name: MPPT state
    address: 15202
    register_type: holding
    value_type: U_WORD
    register_count: 1

  • platform: modbus_controller
    modbus_controller_id: mppt

    name: Charging state
    address: 15203
    register_type: holding
    value_type: U_WORD
    register_count: 1

  • platform: modbus_controller
    modbus_controller_id: mppt
    id: pv_input_voltage
    name: pv_input_voltage
    address: 15205
    unit_of_measurement: "V" ## for any other unit the value is returned in minutes
    register_type: holding
    value_type: U_WORD
    register_count: 1

    accuracy_decimals: 1
    icon: mdi:sine-wave
    filters:

    • multiply: 0.1
  • platform: modbus_controller
    modbus_controller_id: mppt
    id: batt_input_voltage
    name: batt_input_voltage
    address: 15206
    unit_of_measurement: "V" ## for any other unit the value is returned in minutes
    register_type: holding
    value_type: U_WORD
    register_count: 1

    accuracy_decimals: 1
    icon: mdi:sine-wave
    filters:

    • multiply: 0.1
  • platform: modbus_controller
    modbus_controller_id: mppt
    id: batt_input_current
    name: batt_input_current
    address: 15207
    unit_of_measurement: "A"
    register_type: holding
    value_type: U_WORD
    register_count: 1
    filters:

    • multiply: 0.1
      accuracy_decimals: 1
  • platform: modbus_controller
    modbus_controller_id: mppt
    id: pv_input_power
    name: pv_input_power
    address: 15208
    unit_of_measurement: "W" ## for any other unit the value is returned in minutes
    register_type: holding
    value_type: U_WORD
    register_count: 1

    accuracy_decimals: 1
    icon: mdi:sine-wave

  • platform: modbus_controller
    modbus_controller_id: mppt

    name: MPPT temperature
    address: 15209
    unit_of_measurement: "°C" ## for any other unit the value is returned in minutes
    register_type: holding
    value_type: U_WORD
    register_count: 1

#- platform: modbus_controller
#modbus_controller_id: mppt

#name: MPPT energy day
#address: 15219
#unit_of_measurement: "kWh"
#register_type: holding
#value_type: U_WORD
#register_count: 1

number:

  • platform: modbus_controller

    name: MPPT Float Volatge
    address: 10103
    value_type: U_WORD
    register_type: holding
    unit_of_measurement: "V"
    icon: mdi:timer-sand
    min_value: 25
    max_value: 56
    step: 1
    lambda: "return x * 0.1; "

  • platform: modbus_controller

    name: MPPT Absorption Volatge
    address: 10104
    value_type: U_WORD
    register_type: holding
    unit_of_measurement: "V"
    icon: mdi:timer-sand
    min_value: 25
    max_value: 56
    step: 1
    lambda: "return x * 0.1; "

  • platform: modbus_controller

    id: mppt_max_current
    name: MPPT Corrente Max
    address: 10108
    value_type: U_WORD
    register_type: holding
    unit_of_measurement: "A"
    icon: mdi:timer-sand
    min_value: 1
    max_value: 80
    step: 1
    lambda: "return x * 0.1; "
    write_lambda: |-
    ESP_LOGD("main","Modbus Number incoming value = %f",x);
    uint16_t b_capacity = x*10 ;
    payload.push_back(b_capacity);
    return x ;

@grydo
Copy link
Author

grydo commented Jan 2, 2024

new?

@lucasimons
Copy link
Owner

Sorry but i haven t any issue the parameter are all correct, have you some soldered wire? or connector not tightened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants