Page 1 of 1

BUVA QStream 2, with webservice (wifi module)

Posted: Thursday 08 June 2023 23:39
by elmardam
Hi all,

hopefully some of you can help me out, since i dont have any scipting skills.. and im really struggling..
So, i have a Buva Qstream 2 (mechanical ventilation), which has a wifi module and running a webservice. mainly for the app for my phone (the buva qstream app)
You can control airflow with the app, add schedules etc. It also measures air quality.

I want to create a new graph for the airquality, when i browse to: <ipadres.\AQI i get:

{
"Value": "5"
}

in response.. But what ever i try... i can't get this into a graph.. i would really appreciate it, if one of you can put me in the right directions.

If any of you also have this mechanical ventilation, you might be ingerested in this node red implementation:
https://flows.nodered.org/flow/8b17644c ... 3422f48071

Kind Regards, Elmar

Re: BUVA QStream 2, with webservice (wifi module)

Posted: Thursday 08 June 2023 23:48
by elmardam
import requests

url_website = 'http://192.168.1.229/AQI' # URL van de website die de waarde bevat
url_domoticz = 'http://192.168.1.100:81/json.htm' # URL van Domoticz API

response = requests.get(url_website)

if response.status_code == 200:
value = response.json()['Value'] # Pas dit aan op basis van de werkelijke JSON-structuur
parameters = {
'type': 'command',
'param': 'udevice',
'idx': '1248',
'nvalue': 0,
'svalue': str(value)
}

response_domoticz = requests.get(url_domoticz, params=parameters)

if response_domoticz.status_code == 200:
print("Waarde succesvol toegevoegd aan de Domoticz-grafiek.")
else:
print("Er is een probleem opgetreden bij het toevoegen van de waarde aan de Domoticz-grafiek.")
else:
print("Kan de waarde niet ophalen van de website.")