In short I have this WIFI-heater from Adax that I would like to command to change the temperature via theLocal API
(link)
Snippet of most important information on the above mentioned site:
I am trying to get a HTTP get request done via Loxone but I don't seem to get it working. I added printscreens of what I have in Loxone thus far. I probably need the Unix time
from Loxone but I can't wrap my head around how to import it into my request.
I programmed the same request in a Python script and everything is going flawlessly. (code below)
This leads me to believe that there probably is a problem with the concept unix time that is required to run the command.
I'm planning on making a full HowTo about this adventure, so any help here would be great for the community aswel

Working Python-code
-------------------------
#! /usr/bin/bash python3 # controls heater # install dependencies with: pip install bleak requests import http.client import urllib import time import requests import urllib3 HEATER_IP = '192.xxxxxxx # replace with your heater IP from the prepare_demo HEATER_TOKEN = 'xxxxxxx' # replace with your secure password from the prepare_demo def get_status(): url = 'https://' + HEATER_IP + '/api' payload = { 'command': 'stat', 'time': int(time.time()) } headers = { 'Authorization': 'Basic ' + HEATER_TOKEN } response = requests.get(url, params = payload, headers = headers, timeout = 15, verify = False) response_json = response.json() target_temperature = response_json["targTemp"] current_temperature = response_json["currTemp"] print('Current temperature %d, target temperature: %d \n' % (current_temperature, target_temperature)) urllib3.disable_warnings() # heater uses self signed certificate get_status() exec(open('PushoverDown.py').read())
Kommentar