svenerbe / ecoflow_dynamic_power_adjustment

Service Description: EcoFlow Device API Integration for Power Stream Control
44 stars 3 forks source link

ModuleNotFoundError: import of sys not allowed #2

Closed DauntlessEagle closed 2 months ago

DauntlessEagle commented 2 months ago

Not sure if this is an issue with my dev account, have filled in Access Key, Secret Key and "SN" fields as per guide but get the following error? does this look like it is unable to call the cmdCode = 'WN511_SET_PERMANENT_WATTS_PACK' from my account?

Sorry if this is a silly question, thank you.

2024-04-09 10:20:10.278 ERROR (MainThread) [custom_components.pyscript.file.set_ef_powerstream_custom_load_power] Exception in </config/pyscript/set_ef_powerstream_custom_load_power.py> line 16: import sys ^ ModuleNotFoundError: import of sys not allowed

Line 16 refers to

import sys

svenerbe commented 2 months ago

Looks like your pyscript is not working. Line 16 is the first line of the code..

Please check you pyscript and follow the install steps on Pyscript GitHub Repository

DauntlessEagle commented 2 months ago

Looks like your pyscript is not working. Line 16 is the first line of the code..

Please check you pyscript and follow the install steps on Pyscript GitHub Repository

Thanks, have done this and I no longer appear to be getting any errors in the logs, but my entity does not appear, any other ideas? Thanks

svenerbe commented 2 months ago

what you mean with "but my entity does not appear"? can you now found the new service in example automation definition? like this: image

DauntlessEagle commented 2 months ago

Thank you, I see where I went wrong I copied the code incorrectly and a few lines were out of place. Have re created from scratch and all working :) thanks for your help