ESPHome modbus Growatt ShineWiFi-S

i have 2 leds on blue and red. still not working. you need to keep the bridge between gpio0 and gnd still insert when you upload the firmware?

I kept them bridged

1 Like

Did you sort it out @Maarten1 ?

I’m also trying to flash my ShineWIFI-S but having a hard time getting it into boot mode and getting the same message as you mention.

If I short the GND and Gpio0 pins the green LED stays off and red and blue on, is this correct?

no i dont get it working.
here the same with the leds. the green led stays off red and blue ar on

I mixed up Rx/Tx and was able to flash it now using esphome-flasher.

Did you find a way to integrate the upload to PVOutput in esphome?

There is a way, but having it done by home assistant made it go down on my priority list

Well last night i flashed both of my shine sticks where flashed without any problem
i have a growatt 15kw 3phase model and a growatt 6kw 3 phase model.
But they just started and are producing, just got no outputs ;(

i used the script from @chris.huitema for my shine sticks.
When i check the webserver/log i can see this :

any ideas what to try ?
looks like the pins are mabe different on my board or ? it can’t get any data and just a few sensors from pv1 only.

Looks like it has no modbus comms to the inverter. What is the exact model number? And is the dongle the WiFi-x

thanks for the fast reply,

the models i use are :
growatt 15000tl3-s
growatt 6000tl3-s

I have a picture of the board here , it has a esp07 on it.

This is the S. Try change the baud_rate to 9600 of the red module.

1 Like

The dongle is different, but as far as i can tell they still use the same pins GPIO1 and GPIO3, and Modbus Address 0x1

Did you set the logger baud rate to 0? to prevent the logging going out through the serial port?

1 Like

Ah i might have one of the earliest versions then i guess.
I did set it on 0 to prevent it indeed like you have in the config you posted.

Now it is uploading as we speak with baud rate set to 9600

thanks both

ah yes… just went back up through the comments above… and noticed the same thing, its the baud rate

seems to work now :slight_smile:


it does give a red error in the log file and not all the info is loaded yet.
And the total lifetime output is a bit onj the high side, same as today, don’t get me wrong i would love it if this was true haha :slight_smile:

Edit: i am trying to change the multiplier untill i get values that are more real time.

Are some of the sensors not supported now with this script like the AC output current? these did use to give something in the growatt logging app.

edit: well ive been busy from this morning till now but can’t get the right multiplier formula , thought i had the right one calculated but an hour later when i checked the total in esphome and total on the inverter it was way off.

Also tried the standard growat script that can be found on the esphome.io page, this does give the values for the phases how much the voltage it etc.
But there i miss 1 phase.
Also the total day and total output is not visible there.

So for now this is all not fully working

1 Like

You will need to check the registers for your inverter and which ones are actually available

Search for your inverter model and modbus and you should find a pdf. Have a look at my notes above about the word and double words to make sure you get the right size

Most values should not need scaling except a few that are divided by 10

It seems to work now slowly ., thanks all for your time

I am having trouble to get values from the rs485 interface, hope somebody can help.
Maybe i am doing something wrong.

I have a growatt inverter MIN-3000TL-XE
connected the wifi growatt dongle which does a upload to the growatt siet, that is working fine.
But i also wanted the data from the inverter in Homeassistatnt, so i also have attached a rs485 module connected to a NODEMCU.
I used the code earlier in this post:

substitutions:
  device_name: growatt-rs485-module
  device_description: "Growatt Solar Inverter Monitoring RS485"
  friendly_name: growatt-rs485-module

esphome:
  name: ${device_name}
  platform: ESP8266
  board: esp01_1m  

# Enable logging
logger:
  level: DEBUG
  baud_rate: 0
  
# Enable Home Assistant API
api:

ota:

web_server:
  port: 80

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-"
    password: "lidjsafcgtv"

captive_portal:

preferences:
  flash_write_interval: 1h

###############################################################################    

time:
  - platform: homeassistant
    id: homeassistant_time

output:
# Blue Led
  - id: light_bl
    platform: gpio
    pin: 16
# Green Led
  - id: light_gr
    platform: gpio
    pin: 0
# Red Led
  - id: light_rd
    platform: gpio
    pin: 2
    
uart:
  - id: mod_bus
    baud_rate: 9600
    tx_pin: GPIO1
    rx_pin: GPIO3

modbus:
  id: modbus1
  uart_id: mod_bus
  flow_control_pin: GPIO4

modbus_controller:
  - id: growatt
    address: 0x1
    modbus_id: modbus1
    setup_priority: -10  

text_sensor:
  - platform: template
    name: "${friendly_name} Status"
    icon: mdi:eye
    entity_category: diagnostic
    update_interval: 10s
    lambda: |-
      if ((id(status).state) == 1) {
        return {"Normal"};
      } else if ((id(status).state) == 0)  {
        return {"Standby"};
      } else if ((id(status).state) == 2)  {
        return {"Discharge"};
      } else if ((id(status).state) == 3)  {
        return {"Fault"};
      } else if ((id(status).state) == 4)  {
        return {"Flash"};
      } else if ((id(status).state) == 5)  {
        return {"PV Charging"};
      } else if ((id(status).state) == 6)  {
        return {"AC Charging"};
      } else if ((id(status).state) == 7)  {
        return {"Combined Charging"};
      } else if ((id(status).state) == 8)  {
        return {"Combined Charging & Bypass"};
      } else if ((id(status).state) == 9)  {
        return {"PV Charging & Bypass"};
      } else if ((id(status).state) == 10)  {
        return {"AC Charging & Bypass"};
      } else if ((id(status).state) == 11)  {
        return {"Bypass"};
      } else if (id(status).state == 12)  {
        return {"PV Charge and Discharge"};
      } else {
        return {"Unknown"};
      }

sensor:
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 60s
    
  - platform: modbus_controller
    address: 0
    register_type: "read"
    internal: true
    accuracy_decimals: 0
    id: status
    
  - platform: modbus_controller
    name: "${friendly_name} Solar Energy Today"
    address: 48
    register_type: "read"
    unit_of_measurement: kWh
    device_class: energy
    state_class: total_increasing
    icon: mdi:solar-power
    value_type: U_DWORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1    

  - platform: modbus_controller
    name: "${friendly_name} Battery Discharge Energy Today"
    address: 60
    register_type: "read"
    unit_of_measurement: kWh
    device_class: energy
    state_class: total_increasing
    icon: mdi:solar-power
    value_type: U_DWORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1    

  - platform: modbus_controller
    name: "${friendly_name} AC Charge Energy Today"
    address: 56
    register_type: "read"
    unit_of_measurement: kWh
    device_class: energy
    state_class: total_increasing
    icon: mdi:solar-power
    value_type: U_DWORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1    

  - platform: total_daily_energy
    name: "${friendly_name} Grid Energy Today"
    power_id: grid_power
    unit_of_measurement: kWh
    icon: mdi:counter
    accuracy_decimals: 1
    restore: true
    filters:
    - multiply: 0.001
    
  - platform: total_daily_energy
    name: "${friendly_name} AC Ouput Energy Today"
    power_id: ac_output_power
    unit_of_measurement: kWh
    icon: mdi:counter
    accuracy_decimals: 2
    restore: true
    filters:
      - multiply: 0.001    

  - platform: modbus_controller
    id: "solar_voltage"
    name: "${friendly_name} Solar Voltage"
    address: 1
    register_type: "read"
    unit_of_measurement: V
    device_class: voltage
    state_class: measurement
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1
    
  - platform: modbus_controller
    id: "solar_current"
    name: "${friendly_name} Solar Current"
    address: 7
    register_type: "read"
    unit_of_measurement: A
    device_class: current
    state_class: measurement
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.02
    
  - platform: modbus_controller
    name: "${friendly_name} Solar Power"
    address: 3
    register_type: "read"
    unit_of_measurement: W
    device_class: energy
    icon: mdi:solar-power
    value_type: U_DWORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1

  - platform: modbus_controller
    name: "${friendly_name} AC Output Hz"
    address: 23
    register_type: "read"
    unit_of_measurement: Hz
    entity_category: diagnostic
    state_class: measurement
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.01
  
  - platform: modbus_controller
    name: "${friendly_name} AC Output Voltage"
    address: 22
    register_type: "read"
    unit_of_measurement: V
    device_class: voltage
    state_class: measurement
    entity_category: diagnostic
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1

  - platform: modbus_controller
    name: "${friendly_name} AC Output Current"
    address: 34
    register_type: "read"
    unit_of_measurement: A
    device_class: current
    state_class: measurement
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1

  - platform: modbus_controller
    name: "${friendly_name} AC Output Power"
    id: ac_output_power
    address: 9
    register_type: "read"
    unit_of_measurement: W
    device_class: energy
    state_class: measurement
    icon: mdi:flash
    value_type: U_DWORD
    accuracy_decimals: 2
    filters:
    - multiply: 0.1
  
  - platform: modbus_controller
    name: "${friendly_name} Grid Hz"
    address: 21
    register_type: "read"
    unit_of_measurement: Hz
    entity_category: diagnostic
    state_class: measurement
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.01

  - platform: modbus_controller
    name: "${friendly_name} Grid Voltage"
    address: 20
    register_type: "read"
    unit_of_measurement: V
    device_class: voltage
    state_class: measurement
    entity_category: diagnostic
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1

  - platform: modbus_controller
    name: "${friendly_name} Grid Current"
    address: 68
    register_type: "read"
    unit_of_measurement: A
    device_class: current
    entity_category: diagnostic
    state_class: measurement
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1
    
  - platform: modbus_controller
    id: grid_power
    name: "${friendly_name} Grid Power"
    address: 36
    register_type: "read"
    unit_of_measurement: W
    device_class: current
    state_class: measurement
    icon: mdi:flash
    value_type: U_DWORD
    accuracy_decimals: 2
    filters:
    - multiply: 0.1

  - platform: modbus_controller
    name: "${friendly_name} Battery Power"
    address: 77
    register_type: "read"
    unit_of_measurement: W
    device_class: power
    state_class: measurement
    entity_category: diagnostic
    icon: mdi:flash
    value_type: S_DWORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.01

  - platform: modbus_controller
    name: "${friendly_name} Load %"
    address: 27
    register_type: "read"
    unit_of_measurement: percent
    state_class: measurement
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1

  - platform: modbus_controller
    name: "${friendly_name} Battery SoC %"
    address: 18
    register_type: "read"
    unit_of_measurement: percent
    state_class: measurement
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1

  - platform: modbus_controller
    name: "${friendly_name} Inverter Temperature"
    address: 25
    register_type: "read"
    unit_of_measurement: °C
    device_class: temperature
    entity_category: diagnostic
    state_class: measurement
    icon: mdi:thermometer
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1
    
  - platform: modbus_controller
    name: "${friendly_name} PV Temperature"
    address: 32
    register_type: "read"
    unit_of_measurement: °C
    device_class: temperature
    state_class: measurement
    entity_category: diagnostic
    icon: mdi:thermometer
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1
    
  - platform: modbus_controller
    name: "${friendly_name} Bus Voltage"
    address: 19
    register_type: "read"
    unit_of_measurement: V
    device_class: voltage
    state_class: measurement
    entity_category: diagnostic
    icon: mdi:flash
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
    - multiply: 0.1

Buti don’t get any values from the inverter.

i don’t have connected the flow control pin.

This is what the log is saying:

[14:08:52][C][wifi:491]: WiFi:
[14:08:52][C][wifi:353]:   Local MAC: 48:55:19:0C:03:76
[14:08:52][C][wifi:354]:   SSID: [redacted]
[14:08:52][C][wifi:355]:   IP Address: 192.168.1.42
[14:08:52][C][wifi:356]:   BSSID: [redacted]
[14:08:52][C][wifi:358]:   Hostname: 'growatt-rs485-module'
[14:08:52][C][wifi:360]:   Signal strength: -54 dB ▂▄▆█
[14:08:52][C][wifi:364]:   Channel: 4
[14:08:52][C][wifi:365]:   Subnet: 255.255.255.0
[14:08:52][C][wifi:366]:   Gateway: 192.168.1.1
[14:08:52][C][wifi:367]:   DNS1: 192.168.1.1
[14:08:52][C][wifi:368]:   DNS2: 0.0.0.0
[14:08:52][C][logger:275]: Logger:
[14:08:52][C][logger:276]:   Level: DEBUG
[14:08:52][C][logger:277]:   Log Baud Rate: 0
[14:08:52][C][logger:278]:   Hardware UART: UART0
[14:08:52][C][uart.arduino_esp8266:102]: UART Bus:
[14:08:52][C][uart.arduino_esp8266:103]:   TX Pin: GPIO1
[14:08:52][C][uart.arduino_esp8266:104]:   RX Pin: GPIO3
[14:08:52][C][uart.arduino_esp8266:106]:   RX Buffer Size: 256
[14:08:52][C][uart.arduino_esp8266:108]:   Baud Rate: 9600 baud
[14:08:52][C][uart.arduino_esp8266:109]:   Data Bits: 8
[14:08:52][C][uart.arduino_esp8266:110]:   Parity: NONE
[14:08:52][C][uart.arduino_esp8266:111]:   Stop bits: 1
[14:08:52][C][uart.arduino_esp8266:113]:   Using hardware serial interface.
[14:08:52][C][modbus:155]: Modbus:
[14:08:52][C][modbus:156]:   Flow Control Pin: GPIO4
[14:08:52][C][modbus:157]:   Send Wait Time: 250 ms
[14:08:52][C][gpio.output:010]: GPIO Binary Output:
[14:08:52][C][gpio.output:011]:   Pin: GPIO16
[14:08:52][C][gpio.output:010]: GPIO Binary Output:
[14:08:52][C][gpio.output:011]:   Pin: GPIO0
[14:08:52][C][gpio.output:010]: GPIO Binary Output:
[14:08:52][C][gpio.output:011]:   Pin: GPIO2
[14:08:52][C][template.text_sensor:021]: Template Sensor 'growatt-rs485-module Status'
[14:08:52][C][homeassistant.time:010]: Home Assistant Time:
[14:08:52][C][modbus_controller.sensor:010]: modbus_controller.sensorModbus Controller Sensor 'status'
[14:08:52][C][modbus_controller.sensor:010]: modbus_controller.sensor  Accuracy Decimals: 0
[14:08:52][C][modbus_controller.sensor:010]: modbus_controller.sensorModbus Controller Sensor 'growatt-rs485-module Solar Energy Today'
[14:08:52][C][modbus_controller.sensor:010]: modbus_controller.sensor  State Class: 'total_increasing'
[14:08:52][C][modbus_controller.sensor:010]: modbus_controller.sensor  Accuracy Decimals: 1
[14:08:52][C][modbus_controller.sensor:010]: modbus_controller.sensorModbus Controller Sensor 'growatt-rs485-module Battery Discharge Energy Today'
[14:08:52][C][modbus_controller.sensor:010]: modbus_controller.sensor  State Class: 'total_increasing'
INFO growatt-rs485-module.local: Error while reading incoming messages: Error while reading data: [Errno 104] Connection reset by peer
INFO Disconnected from ESPHome API for growatt-rs485-module.local
WARNING Disconnected from API
INFO growatt-rs485-module.local: Ping Failed: Error while reading data: [Errno 104] Connection reset by peer
INFO Successfully connected to growatt-rs485-module.local
[14:09:11][D][modbus_controller:029]: Modbus command to device=1 register=0x03 countdown=0 no response received - removed from send queue
[14:09:12][D][modbus_controller:029]: Modbus command to device=1 register=0x07 countdown=0 no response received - removed from send queue
[14:09:14][D][modbus_controller:029]: Modbus command to device=1 register=0x09 countdown=0 no response received - removed from send queue
[14:09:15][D][modbus_controller:029]: Modbus command to device=1 register=0x12 countdown=0 no response received - removed from send queue
[14:09:16][D][modbus_controller:029]: Modbus command to device=1 register=0x19 countdown=0 no response received - removed from send queue
[14:09:17][D][text_sensor:067]: 'growatt-rs485-module Status': Sending state 'Unknown'
[14:09:18][D][modbus_controller:029]: Modbus command to device=1 register=0x1B countdown=0 no response received - removed from send queue
[14:09:19][D][modbus_controller:029]: Modbus command to device=1 register=0x20 countdown=0 no response received - removed from send queue
[14:09:21][D][modbus_controller:029]: Modbus command to device=1 register=0x22 countdown=0 no response received - removed from send queue
[14:09:22][D][modbus_controller:029]: Modbus command to device=1 register=0x24 countdown=0 no response received - removed from send queue
[14:09:23][D][modbus_controller:029]: Modbus command to device=1 register=0x30 countdown=0 no response received - removed from send queue
[14:09:25][D][modbus_controller:029]: Modbus command to device=1 register=0x38 countdown=0 no response received - removed from send queue
[14:09:26][D][modbus_controller:029]: Modbus command to device=1 register=0x3C countdown=0 no response received - removed from send queue
[14:09:27][D][text_sensor:067]: 'growatt-rs485-module Status': Sending state 'Unknown'
[14:09:28][D][modbus_controller:029]: Modbus command to device=1 register=0x44 countdown=0 no response received - removed from send queue
[14:09:29][D][modbus_controller:029]: Modbus command to device=1 register=0x4D countdown=0 no response received - removed from send queue
[14:09:37][D][text_sensor:067]: 'growatt-rs485-module Status': Sending state 'Unknown'
[14:09:43][D][modbus_controller:029]: Modbus command to device=1 register=0x00 countdown=0 no response received - removed from send queue
[14:09:44][D][modbus_controller:029]: Modbus command to device=1 register=0x03 countdown=0 no response received - removed from send queue
[14:09:45][D][modbus_controller:029]: Modbus command to device=1 register=0x07 countdown=0 no response received - removed from send queue
[14:09:47][D][modbus_controller:029]: Modbus command to device=1 register=0x09 countdown=0 no response received - removed from send queue
[14:09:47][D][text_sensor:067]: 'growatt-rs485-module Status': Sending state 'Unknown'
[14:09:48][D][modbus_controller:029]: Modbus command to device=1 register=0x12 countdown=0 no response received - removed from send queue
[14:09:49][D][modbus_controller:029]: Modbus command to device=1 register=0x19 countdown=0 no response received - removed from send queue
[14:09:51][D][modbus_controller:029]: Modbus command to device=1 register=0x1B countdown=0 no response received - removed from send queue
[14:09:52][D][modbus_controller:029]: Modbus command to device=1 register=0x20 countdown=0 no response received - removed from send queue
[14:09:54][D][modbus_controller:029]: Modbus command to device=1 register=0x22 countdown=0 no response received - removed from send queue
[14:09:55][D][modbus_controller:029]: Modbus command to device=1 register=0x24 countdown=0 no response received - removed from send queue
[14:09:56][D][modbus_controller:029]: Modbus command to device=1 register=0x30 countdown=0 no response received - removed from send queue
[14:09:57][D][text_sensor:067]: 'growatt-rs485-module Status': Sending state 'Unknown'
[14:09:58][D][modbus_controller:029]: Modbus command to device=1 register=0x38 countdown=0 no response received - removed from send queue
[14:09:59][D][modbus_controller:029]: Modbus command to device=1 register=0x3C countdown=0 no response received - removed from send queue
[14:10:01][D][modbus_controller:029]: Modbus command to device=1 register=0x44 countdown=0 no response received - removed from send queue
[14:10:02][D][modbus_controller:029]: Modbus command to device=1 register=0x4D countdown=0 no response received - removed from send queue
[14:10:02][D][sensor:126]: 'WiFi Signal Sensor': Sending state -47.00000 dBm with 0 decimals of accuracy
[14:10:07][D][text_sensor:067]: 'growatt-rs485-module Status': Sending state 'Unknown'
INFO growatt-rs485-module.local: Ping timed out!
INFO Disconnected from ESPHome API for growatt-rs485-module.local
WARNING Disconnected from API
INFO Successfully connected to growatt-rs485-module.local
[14:10:21][D][modbus_controller:029]: Modbus command to device=1 register=0x07 countdown=0 no response received - removed from send queue
[14:10:22][D][modbus_controller:029]: Modbus command to device=1 register=0x09 countdown=0 no response received - removed from send queue
[14:10:24][D][modbus_controller:029]: Modbus command to device=1 register=0x12 countdown=0 no response received - removed from send queue
[14:10:25][D][modbus_controller:029]: Modbus command to device=1 register=0x19 countdown=0 no response received - removed from send queue
[14:10:27][D][modbus_controller:029]: Modbus command to device=1 register=0x1B countdown=0 no response received - removed from send queue
[14:10:27][D][text_sensor:067]: 'growatt-rs485-module Status': Sending state 'Unknown'
[14:10:28][D][modbus_controller:029]: Modbus command to device=1 register=0x20 countdown=0 no response received - removed from send queue

Can somebody say what is wrong with this information?

i think you have the ShineWifi-X. your baud_rate: should be baud_rate: 115200

No ik have no shineWifi.
I have a Nodemcu with esphome flashed on it, and an rs485 module. I have tried 2 different rs485 modules. (RS485 to TTL) and (HW-97)

Als tried baurrates 9600 an 115200

both the same.

Maybe something wrong in the registers?