You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running the code from interactive window.
I connected to inverter. It was properly recognized as ET - it is GW8KN-ET.
But then I run this code:
sch3 = await inverter.read_setting("eco_mode_3")
result = await inverter.write_setting("eco_mode_3", sch3)
and get a ValueError:
ValueError Traceback (most recent call last)
Cell In[26], [line 1](vscode-notebook-cell:?execution_count=26&line=1)
----> [1](vscode-notebook-cell:?execution_count=26&line=1) result = await inverter.write_setting("eco_mode_3", sch3)
File c:\Users\(...)\.venv\Lib\site-packages\goodwe\et.py:669, in ET.write_setting(self, setting_id, value)
[667](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/et.py:667) setting = self._settings.get(setting_id)
[668](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/et.py:668) if setting:
--> [669](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/et.py:669) await self._write_setting(setting, value)
[670](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/et.py:670) else:
[671](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/et.py:671) if setting_id.startswith("modbus"):
File c:\Users\dozmi\source\repos\goodweplc\.venv\Lib\site-packages\goodwe\et.py:682, in ET._write_setting(self, setting, value)
[680](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/et.py:680) raw_value = setting.encode_value(value, response.response_data()[0:2])
[681](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/et.py:681) else:
--> [682](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/et.py:682) raw_value = setting.encode_value(value)
[683](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/et.py:683) if len(raw_value) <= 2:
[684](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/et.py:684) value = int.from_bytes(raw_value, byteorder="big", signed=True)
File c:\Users\dozmi\source\repos\goodweplc\.venv\Lib\site-packages\goodwe\sensor.py:707, in Schedule.encode_value(self, value, register_value)
[705](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/sensor.py:705) if self.read_value(ProtocolResponse(value, None)):
[706](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/sensor.py:706) return value
--> [707](file:///C:/Users/(...)/.venv/Lib/site-packages/goodwe/sensor.py:707) raise ValueError
ValueError:
Seems like if self.read_value(ProtocolResponse(value, None)): is evaluating to False.
This settings is definitely available in the SolarGo app. Any hints?
The text was updated successfully, but these errors were encountered:
I'm running the code from interactive window.
I connected to inverter. It was properly recognized as ET - it is GW8KN-ET.
But then I run this code:
and get a ValueError:
Seems like
if self.read_value(ProtocolResponse(value, None)):
is evaluating to False.This settings is definitely available in the SolarGo app. Any hints?
The text was updated successfully, but these errors were encountered: