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

Growatt modbus serial #23

Open
okanano opened this issue Feb 7, 2024 · 5 comments
Open

Growatt modbus serial #23

okanano opened this issue Feb 7, 2024 · 5 comments

Comments

@okanano
Copy link

okanano commented Feb 7, 2024

Hi,

I'm creating a new integration to Growatt Model M6000HX-48-BP using Home Assistant and serial port /dev/ttyUSB0. Once I defined the serial port parameters I checked the log and found the following error:

WARNING (MainThread) [custom_components.growatt_local.API.growatt] Inverter Modbus version not default supported.

Any hints?

@Saentist
Copy link

Saentist commented Feb 8, 2024

Under "Serial" what are you men RS232 ?
Because Growatt use Modbus RS485

@okanano
Copy link
Author

okanano commented Feb 9, 2024

Under "Serial" what are you men RS232 ? Because Growatt use Modbus RS485

I'm using RS485, I mean Serial during the configuration as Communication Layer, then I defined the serial port parameters, but I checked the log and found this warning:

WARNING (MainThread) [custom_components.growatt_local.API.growatt] Inverter Modbus version not default supported.

@WouterTuinstra
Copy link
Owner

The full logs should actually give you more info about the device data received.

You could also make an example.py with the following code which should be located in in the growatt_local/API folder.
In order to run it make sure you have the dependencies installed

import asyncio
from growatt import GrowattSerial, get_device_info 

growatt = GrowattSerial("/dev/ttyUSB0") # optional other serial port configrations
    
    1 # Inverter modbus adress 


async def main():
    await growatt.connect()
    modbus_address = 1 # default address should be 1 but depends on inverter
    result = await get_device_info(growatt, modbus_address)

    print(result)

asyncio.run(main())

If the result from the above example is nothing check modbus_address or the physical connection

@okanano
Copy link
Author

okanano commented Feb 10, 2024

The full logs should actually give you more info about the device data received.

You could also make an example.py with the following code which should be located in in the growatt_local/API folder. In order to run it make sure you have the dependencies installed

import asyncio
from growatt import GrowattSerial, get_device_info 

growatt = GrowattSerial("/dev/ttyUSB0") # optional other serial port configrations
    
    1 # Inverter modbus adress 


async def main():
    await growatt.connect()
    modbus_address = 1 # default address should be 1 but depends on inverter
    result = await get_device_info(growatt, modbus_address)

    print(result)

asyncio.run(main())

If the result from the above example is nothing check modbus_address or the physical connection

Hi @WouterTuinstra,

I created and executed the python file, and got the following error:

WARNING growatt:368 Inverter Modbus version not default supported.
Check full logs to get device information using the supported protocols.
None

@WouterTuinstra
Copy link
Owner

Off course annoying Python default logging starts at warning while on info level it would actually show you the device info it gets. Do you get to the device info screen? because if configure your protocol it should make a entry.

Only other reason I can think of does Home Assistant have rights to access to the device /dev/ttyUSB0?

import asyncio
from growatt import GrowattSerial, get_device_info 
import logging

logging.basicConfig(level=logging.INFO)

growatt = GrowattSerial("/dev/ttyUSB0") # optional other serial port configrations
    
    1 # Inverter modbus adress 


async def main():
    await growatt.connect()
    modbus_address = 1 # default address should be 1 but depends on inverter
    result = await get_device_info(growatt, modbus_address)

    print(result)

asyncio.run(main())

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

3 participants