collect outside temperature

This commit is contained in:
2025-10-21 20:19:13 +02:00
parent 531506cfe4
commit 069b8b3e0e
3 changed files with 64 additions and 5 deletions
+3 -3
View File
@@ -94,15 +94,15 @@ def send_response(box_url: str, username: str, challenge_response: str) -> str:
return xml.find("SID").text
def main():
url = "http://192.168.22.4"
host = "http://192.168.22.4"
username = "fritz6632"
password = "body9517"
sid = get_sid(url, username, password)
sid = get_sid(host, username, password)
print(f"Successful login for user: {username}")
print(f"sid: {sid}")
ain = 116570135300
cmd = "gettemperature"
with urllib.request.urlopen(f"{url}/webservices/homeautoswitch.lua?ain={ain}&switchcmd={cmd}&sid={sid}") as f:
with urllib.request.urlopen(f"{host}/webservices/homeautoswitch.lua?ain={ain}&switchcmd={cmd}&sid={sid}") as f:
value = float(f.read().decode())/10
print(f"{cmd}: {value} °C")