Hi,
I have the same problems since some days.
[‘Scriptfehler - Judo-login fehlgeschlagen in Zeile: 294’, JSONDecodeError(‘Expecting value: line 1 column 1 (char 0)’)]
The code seems to working correct. bit the request within phyton leads to a empty return.
login_response = http.request(‘GET’, f"https://www.myjudo.eu/interface/?group=register&command=login&name=login&user={username}&password={pwmd5}&nohash=Service&role=customer")
same request in browser showes the correct json.
Update: I found the solution
The judo-server now needs header information to answer correctly.
In getjudo.py codefile change following code:
add at declaration (beginning):
import requests
def judo_login(username, password):
headers = {
'Connection': 'keep-alive',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'
}
login_response = requests.get(f"https://www.myjudo.eu/interface/?group=register&command=login&name=login&user={username}&password={pwmd5}&nohash=Service&role=customer", headers=headers)
#login_response = http.request('GET', f"https://www.myjudo.eu/interface/?group=register&command=login&name=login&user={username}&password={pwmd5}&nohash=Service&role=customer")
#login_response_json = json.loads(login_response.data)
login_response_json = login_response.json()
def send_command(index, data):
headers = {
'Connection': 'keep-alive',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'
}
cmd_response = requests.get(f"https://www.myjudo.eu/interface/?group=register&command=login&name=login&user={username}&password={pwmd5}&nohash=Service&role=customer", headers=headers)
cmd_response_json = cmd_response.json()
#cmd_response = http.request('GET', f"https://www.myjudo.eu/interface/?token={mydata.token}&group=register&command=write%20data&serial_number={mydata.serial}&dt={mydata.dt}&index={index}&data={data}&da={mydata.da}&role=customer")
#cmd_response_json = json.loads(cmd_response.data)
def main():
headers = {
'Connection': 'keep-alive',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'
}
response = requests.get(f"https://www.myjudo.eu/interface/?token={mydata.token}&group=register&command=get%20device%20data", headers=headers)
response_json = response.json()
#response = http.request('GET',f"https://www.myjudo.eu/interface/?token={mydata.token}&group=register&command=get%20device%20data")
#response_json = json.loads(response.data)
headers = {
'Connection': 'keep-alive',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'
}
error_response = requests.get(f"https://myjudo.eu/interface/?token={mydata.token}&group=register&command=get%20error%20messages", headers=headers)
error_response_json = error_response.json()
#error_response = http.request('GET',f"https://myjudo.eu/interface/?token={mydata.token}&group=register&command=get%20error%20messages")
#error_response_json = json.loads(error_response.data)