HomeGenie Forum
Automation Program Plugins and Wizard Scripting => Help => Topic started by: pinie_pinie on April 27, 2015, 09:53:03 PM
-
Hello,
I am new to the forum. Unfortunately, I can not speak English.
I am looking for my rain tank a graphical display under HomeGenie.
For the display, I use 8 GPIO ports (IN+). This show me on the level.
In the complex you will find a design and GPIO ports used.
Depending on the level the corresponding indicator will light up.
Can someone help me and write a program for this application?
Thank you for your Supports!
-
For this, the best way for me is to write a C# module with Virtual js Widget, that test the Sensor.Level of your GPIO.
If I have some free time I will try to write the beginning code for show you.
Cheers
Dani
-
Hi Dani,
Thank you for your quick response. Please do not take the GPIO name in the display.
many Greetings
Thoralf
-
Hi Thoralf,
You can find here my sample code of your needed widget for 6 GPIO.
You have to fix the GPIO name as follow :
"25 %","50 %","75 %","100 %","125 %","150 %" instead of you have to change the src code in the hgx file.
The files raintanklevel.html and raintanklevel.js have to be in the creating folder :
/usr/local/bin/homegenie/html/pages/control/widgets/DaniMail/generic
For simulation test I have create a section While( Program.IsEnabled) in the *.hgx file that you can mask after the first test of the widget.
Cheers
Dani
-
Hi Dani,
i'm excited. Unfortunately I can not test at the moment. But I'll get back after the weekend.
Thank you for your work !!!
A really great program.
Thoralf
-
Hallo Dani,
I tested the program and am thrilled. But I still have a problem.
My sensor from rain tank emits a permanent contact to ground. This is then applied to the corresponding GPIO port. For me, the tank display (On / Off) reacts only when a momentary contact to ground. After a short time the display returns to the original state.
If to the GPIO port abuts a contact to ground the display indicate the level permanently.
I understand what's wrong?
Thank you for your trouble!
-
Hi Thoralf,
Sorry but your sentence was affirmative so I understood that you find the issue.
One Question : When the level isarrive in your tank, what is the level state of the GPIO Sensor ? 1 or 0 or momentaniously 1 en after 0 ?
Fot hardware issue, I can't guide you. I think you have to control the voltage value witth mutimeter. What is the electronique hardware in the tank sensors?
-
Hi Dani,
your program is almost perfect for me.
When the water has reached the 25% contact in the tank to the indicator lights 25% permanently. If the water rises to 50% to both displays (25% and 50%) lasting shine.
This then goes on and on. The water is the contact between ground and the GPIO port.The test I take a cable from the GPIO port to GND-Port. I'm not sure how you define the state of the sensor. If the contact is open, it is my view 1. If it is closed then 0? It is important that when closed contact display lights up as long as the contact is closed. Only when the contact is open again will run out of display.
My donor is a homemade plastic pipe with insulated metal screws. These are connected to the GPIO port via cable.
Your program responds now to a brief contact and the display disappears after a short time. It only needs to be adjusted slightly so. The principle is therefore almost right.
I hope you understand my explanation. Thank you for your support !!!
-
Hi Thoralf,
This I undesstood along.
Can you join a screnshot as mine upstair when 25 % level is active ?
Because if the state is not stable we cannot do anything.
And do you mask the simulation program code in the function While( Program.IsEnabled) ? Only keep the last line Pause(x) before Compile.
Cheers
Dani
-
Hi Dani,
This is my design for simulation 25% fuel gauge. There is a stable level at the GPIO port to the cable (screwed). The display is blank. Only brief contact between the GPIO port and Ground displaying works briefly. In the complex you can find my modified hgx file. Is in the file everything changed right?
Later, I will install before Raspberry a relay board, so I have stable conditions at the GPIO port.
The display (25%) is as light continuously build on the photo 1. If I cable
to remove the display to go out.
Thank you for your support.
Thoralf
-
I have modify the code. Because you let's one part activate. In taht case I don't know what HG do with open code ?
In your screenshots, I never see the Level 1 on GPIO state. As I told you, you have to fix that hardware issue first. If the state Level is not permanent it will not work !!!
-
Hallo Dani,
have your file is loaded, and the thing works. Due to my ignorance I have the original document was not processed correctly. I'm really sorry.
In the complex you will find a current Sreenshot. My question:
Is it a great effort to adapt the hgx file so that the indicator lights at a level of "0"? It will display 25% and 50% light. The others stay out for this example.
That would be really great.
If not I have to later adjust the relay card. Thank you for your patience !!!
many thanks
Thoralf
-
I will reverse the test. And post a new file tomorrow.
-
Hi Thoralf,
You can find following, the reverse version. I modify only one line in 2 files.
Tell me if that works correctly now !
Cheers
Dani
-
Hello,
please use Widgets editor for importing exporting widgets, it's more easy then to install a new widget.
Cheers,
g.
-
Hi Dani,
Super, super ... !!!
The display works as planned. When my control is completely installed I present a brief description.
One last question on this topic: The display on my phone (app) is not
possible? But is not absolutely necessary.
Thanks for everything! In the complex is a screenshot of the 50%.
See you soon Thoralf
-
In your phone, you can use a browser. But not that widget is not show on phone Apps.
Cheers
Dani
-
When you write up your system description, please let us know what sensors you are using in the tank. I would like to have something similar for my sump pump to show normal levels and then alert if over that. I saw some ineteresting usues of distance measuring using ultrasonic sensor with a ping pong ball in a pipe :-) I was planning to do a couple float switches.
-
If you look at the schema of Thoralf in the previous page, he use only Cupper insulated cable with some screws at the level he needs. It's the conductivity of the water that make GPIO sensor of raspberry to be activate or not. Very cheeper solution.
Cheers
Dani
-
Hi,
the pipe I have poured with plastic. So that everything is watertight. The advantage: It has no moving parts in the water. My donor I have already 2 years in use. A relay board before Raspberry is ideal, then has to clean level at the input of the GPIO port. Perhaps the resistors at the input of the relay card must be adapted to the conductivity of the Waser is adjusted precisely.