more G-Labs products

Author Topic: Display for rain tank - Please help  (Read 8188 times)

April 27, 2015, 09:53:03 PM
Read 8188 times

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
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!
« Last Edit: April 27, 2015, 09:57:25 PM by pinie_pinie »

April 28, 2015, 12:31:25 PM
Reply #1

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
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

April 28, 2015, 09:00:17 PM
Reply #2

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
Hi Dani,

Thank you for your quick response. Please do not take the GPIO name in the display.
many Greetings

Thoralf

April 29, 2015, 01:23:53 PM
Reply #3

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
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
« Last Edit: April 30, 2015, 09:09:30 AM by dani »

April 29, 2015, 09:13:59 PM
Reply #4

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
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

May 04, 2015, 08:30:50 AM
Reply #5

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
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!

May 08, 2015, 06:25:10 PM
Reply #6

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
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?

May 09, 2015, 07:12:27 PM
Reply #7

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
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 !!!
« Last Edit: May 09, 2015, 07:45:25 PM by pinie_pinie »

May 10, 2015, 09:24:21 AM
Reply #8

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
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
« Last Edit: May 10, 2015, 09:28:56 AM by dani »

May 10, 2015, 01:29:42 PM
Reply #9

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
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

May 11, 2015, 08:11:36 AM
Reply #10

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
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 !!! 
« Last Edit: May 11, 2015, 08:13:19 AM by dani »

May 11, 2015, 10:33:31 PM
Reply #11

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
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

May 11, 2015, 11:34:46 PM
Reply #12

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
I will reverse the test. And post a new file tomorrow.

May 12, 2015, 06:11:09 AM
Reply #13

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
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

May 12, 2015, 08:57:12 AM
Reply #14

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hello,

please use Widgets editor for importing exporting widgets, it's more easy then to install a new widget.

Cheers,
g.