wasilukm / hoymiles-mqtt

Send data from Hoymiles PV plant to Home Assistant without cloud
MIT License
42 stars 8 forks source link

can't set MI_ENTITIES from environment variables #15

Closed hymstra closed 11 months ago

hymstra commented 1 year ago

Description

I wanted to overload the MI_ENTITIES and PORT_ENTITIES by setting environment variables. Expecting the environment variables to replace the default. But it seems that the argument parser appends the environment variables to the default instead.

So from setting the environment variable: MI_ENTITIES=['grid_voltage', 'temperature']

I end up with: ['grid_voltage', 'grid_frequency', 'temperature', 'operating_status', 'alarm_code', 'alarm_count', 'link_status', ["'grid_voltage'"]["'temperature'"]]

Is this a bug, or am I not doing this correctly?

wasilukm commented 11 months ago

Hi, thank you for reporting this, yes this is a bug.

wasilukm commented 11 months ago

With the fix, the following should be working fine: _MI_ENTITIES='gridvoltage, temperature'