With the newly added section I would be at 4 relays just for the solenoids controlling the garden irrigation, not talking about the pump and other related stuff. In the previous design I used three of the extension relays outputs (one relay per solenoid). The main reason for this update is an additional section/solenoid valve added to the system which I want to control with Loxone. With the new page selected press F5 and add a switch block for each relay, I name it Relay 1,2….This post is an update of an earlier article I did for garden irrigation.Next step create a new page name it, assignee it to a category and a room.In the same way edit the preferences edit the name, assignee it a category and a room and set the command for ON and OFF, in this care I had for ON /out1/on and for OFF /out1/off. Now we have to create the VQ Command for each relay, click on your new VQ to select it and on the top bar menu add a VQ Command.Once the VQ is created make sure is selected and in the Preferences window situated on the left side change the name, assignee it to a room and add the RaspberryPi ip address and port.In the Loxone Config app “I am using the windows version 11.1.9.14 at the time of writing this tutorial” click and select Virtual Outputs and then in the top menu bar click on Virtual Outputs (VQ) to add it to the miniserver.The scripts can be modified and adapt for all the GPIO pins.Var x = document.getElementById("myNumber").value ĭocument.getElementById("demo").innerHTML = x Now the Python code is done we have to edit the inex.html file, remember for the Loxone you don’t need it :.#-Do not forget to change to your ip address and portĪpp.run(host='192.168.1.128', port=8008, debug=True) #-to access the GPIO status of our relay1(): #-This part of the program is only for Loxone #-and the Loxone direct actionn(deviceName, action): #-This part of the code will be used by the web page #-Create the action link for each OUTPUT/relays Return render_template('index.html', **templateData) #-Read and save the status of each OUTPUT #-Declare the all OUTPUT's and set them to HIGH #-GPIO pins virtual status helps to display Create the html.py file by typing in the terminal the following command. Sleep 20 # for pi4 amd for pi0w 60seconds #some applications need to wait for PI to fully start and then run the code
0 Comments
Leave a Reply. |