syssi / esphome-soyosource-gtn-virtual-meter

ESPHome component to simulate the current clamp to control the Soyosource GTN1200 limiter
Apache License 2.0
78 stars 21 forks source link

Soyosource doesn't respond on RS485 connection #81

Closed dowermyr closed 1 year ago

dowermyr commented 1 year ago

Hi! Everything is now set up but I don't get any coomunication from the inverter. Only the TX diod is blinking. This is my setup:

substitutions:
  name: soyosource-l3
  device_description: "Monitor a Soyosource GTN and control the power output on demand both via RS485"
  external_components_source: github://syssi/esphome-soyosource-gtn-virtual-meter@main
  tx_pin: GPIO1
  rx_pin: GPIO3

esphome:
  name: ${name}
  comment: ${device_description}
  project:
    name: "syssi.esphome-soyosource-gtn-virtual-meter"
    version: 1.1.0

esp8266:
  board: nodemcuv2

external_components:
  - source: ${external_components_source}
    refresh: 0s

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

ota:

# If you use Home Assistant please remove this `mqtt` section and uncomment the `api` component!
#mqtt:
#  broker: !secret mqtt_host
#  username: !secret mqtt_username
#  password: !secret mqtt_password
#  id: mqtt_client

logger:
  baud_rate: 0

uart:
  baud_rate: 4800
  tx_pin: ${tx_pin}
  rx_pin: ${rx_pin}

soyosource_modbus:
  # Optional settings
  #
  # The name is used as prefix for some log messages and should
  # help to distinguish between different instances/devices
  name: inverter_l3

soyosource_inverter:

soyosource_virtual_meter:
  # The state of this sensor (instantaneous power in watt) is used as source
  power_id: powermeter

  # Optional settings
  power_sensor_inactivity_timeout: 20s
  power_demand_calculation: NEGATIVE_MEASUREMENTS_REQUIRED
  min_power_demand: 0
  max_power_demand: 900
  # Split/distribute the power demand if you have multiple inverters attached to the same RS485 bus
  power_demand_divider: 1
  # A positive buffer value (10) tries to avoid exporting power to the grid (demand - 10 watts)
  # A negative buffer value (-10) exports power to the grid (demand + 10 watts)
  buffer: 10
  # The operation_mode_id sensor is expected here. Passing the operation_mode won't work
  # The state is used to suspend the limiter if the operation mode of the inverter isn't 0x0 (normal)
  operation_mode_id: operation_mode_id

  # The update interval is important and defaults to 3 seconds. If the demand is sent too frequently
  # or rarely the interverter stops. TODO: Identify and validate the lower and upper update limit
  update_interval: 3s

binary_sensor:
  - platform: soyosource_inverter
    fan_running:
      name: "${name} fan running"

sensor:
  - platform: soyosource_virtual_meter
    power_demand:
      name: "${name} power demand"

  - platform: soyosource_inverter
    operation_mode_id:
      name: "${name} operation mode id"
      id: operation_mode_id
    battery_voltage:
      name: "${name} battery voltage"
    battery_current:
      name: "${name} battery current"
    battery_power:
      name: "${name} battery power"
    ac_voltage:
      name: "${name} ac voltage"
    ac_frequency:
      name: "${name} ac frequency"
    temperature:
      name: "${name} temperature"

  # mqtt subscribe example
 # - id: powermeter
 #   internal: true
 #   platform: mqtt_subscribe
 #   name: "${name} instantaneous power consumption"
 #   topic: "smartmeter/sensor/groundfloor/obis/1-0:16.7.0/255/value"
 #   accuracy_decimals: 2
 #   unit_of_measurement: W
 #   device_class: power
 #   filters:
 #     - throttle_average: 15s

#  # import smartmeter reading from homeassistant
#  # requires the "api" component see above
  - platform: homeassistant
    id: powermeter
    name: "${name} smartmeter"
    entity_id: sensor.smartmeter_l3
    filters:
      - throttle_average: 10s

text_sensor:
  - platform: soyosource_inverter
    operation_mode:
      name: "${name} operation mode"
  - platform: soyosource_virtual_meter
    operation_mode:
      name: "${name} operation mode"

number:
  - platform: soyosource_virtual_meter
    manual_power_demand:
      name: "${name} manual power demand"
    max_power_demand:
      name: "${name} max power demand"
      initial_value: 600
      restore_value: true

switch:
  - platform: soyosource_virtual_meter
    manual_mode:
      name: "${name} manual mode"
      restore_mode: RESTORE_DEFAULT_ON
    emergency_power_off:
      name: "${name} emergency power off"
      restore_mode: RESTORE_DEFAULT_OFF
# Enable Home Assistant API
api:
syssi commented 1 year ago

Awesome! Take your time and please try to use the level shifter. It will give your ESP a long life. ;-)

dowermyr commented 1 year ago

Do you think I should use GPIO1 and 3 for the RS485 or go with some others?

syssi commented 1 year ago

Please use the hardware UART (GPIO1/3) for the display port connection because of the higher baudrate. SoftwareSerial works better on low baudrates.

dowermyr commented 1 year ago

Ok. But then I need to disable the logger, right ?

syssi commented 1 year ago

Correct. You can still consume/view log messages via WiFi.

dowermyr commented 1 year ago

The problem was the level shifter. It doesn't work with them so running without for now. Maybe order different ones. But one question : The inverter says that the limiter is connected so it can sense the rs485. But nothing happens when I change the value. Is it because I haven't connected anything on the DC side yet? Thought it would change the power output anyways? Screenshot_20221003-231005_Home Assistant

syssi commented 1 year ago

You have to attach a battery first. The operation mode must change from "Standby" to "Normal".