hoymiles-wifi/hoymiles_wifi/__main__.py

23 lines
609 B
Python
Raw Normal View History

2023-11-17 11:45:17 +00:00
from hoymiles_wifi.inverter import Inverter
2023-11-17 11:10:33 +00:00
import time
def main():
# Replace 'your_inverter_ip' with the actual IP address or hostname of your inverter
inverter = Inverter('192.168.1.190')
try:
while True:
response = inverter.update_state()
if response:
print(f"Inverter State: {response}")
else:
print("Unable to retrieve inverter state")
# Sleep for a while before the next update
time.sleep(60)
except KeyboardInterrupt:
print("Exiting.")
if __name__ == "__main__":
2023-11-17 11:45:17 +00:00
main()