more G-Labs products

Author Topic: DHT 22 temperature sensor data graphically evaluate and switch GPIO port  (Read 3553 times)

June 14, 2015, 09:19:57 PM
Read 3553 times

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
Hallo,

I run a temperature sensor DHT 22 on my Raspberry. The data are to be logged
and are displayed graphically. So I want to monitor the room temperature and analyze.

In addition to less than or exceed a temperature limit 2 GPIO port accordingly
are switched.
Does anyone have a tip for me or perhaps even a program.

many Thanks

Thoralf

June 15, 2015, 03:14:22 PM
Reply #1

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330

June 16, 2015, 09:12:44 PM
Reply #2

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
Hello,
thanks for the answer, unfortunately, is not my problem. My sensor works without problems.
I want to have a graphical evaluation such as the Power diagram. Which temperature was at a certain time in the room. If the temperature falls below a specified value to a GPIO port switch. This can then be switched via a relay heating. If the temperature rises again to another GPIO port switch.
So a room temperature monitoring with active frost protection.
I hope you understand what I mean.
Many Thanks !!!

Thoralf

June 17, 2015, 03:04:39 AM
Reply #3

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
I think I understand now. :)  There is a thermostat app that may help you, it is in programs-Weather&environment-basicThermostat. This probably will require your dht22 and gpio pins to be configured as working modules in home genie (I don't have experience with that since I don't have a pi).

June 17, 2015, 05:01:54 PM
Reply #4

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
This is a fairly simple problem that wouldn't take much to implement.  I have not used the DHT22 code that's built in to HG, but I assume the reading for temperature is stored in a sensor module under the parameter "sensor.temperature".  If so, you could write a script that looks at that value and triggers a heater module based on the temperature.  You could probably use the thermostat that kevin1 pointed out, I just don't have any experience with it.  If that doesn't work, you shouldn't have an issue writing something simple.

June 19, 2015, 12:15:37 PM
Reply #5

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
Hello,
unfortunately I have no programming knowledge. Can you please help me?
Many Thanks.

Thoralf

June 19, 2015, 02:25:20 PM
Reply #6

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi pinie_pinie,

Here you find a program with widget in accordance with your needed.
Import the HGX and compile it.
Put the widget files in /usr/local/bin/homegenie/html/pages/control/widgets/DaniMail/generic.
And normally, it will work if you add the virtual module (SpecialThermostat) crated to one group and specify the three linked modules.

Cheers
Dani

June 21, 2015, 09:01:33 AM
Reply #7

pinie_pinie

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

Thank you for your work. Did everything run according to your instructions. The module I have included in a group. Since I have no programming skills, I do not understand the conclusion. Do I need to make in your program still an adjustment for the GPIO ports?
(specify the three linked modules)
Can you give me a hint?
Many Thanks !!!

Thoralf

June 21, 2015, 12:19:11 PM
Reply #8

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
No only specifie the three modules in the parameter of the virtual module.
Perhaps I have to made some adjustement.
Tell me if it's work correctly.

June 21, 2015, 05:37:25 PM
Reply #9

pinie_pinie

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

a super job. This works great.
I have 2 questions:

1. When thermostat, the switching points are reversed with me. When low-set-point of the GPIO port from the high set-point switches. When high-set-point of the assigned GPIO port from the low set-point switches. Can an exchange program in the present?
It's no problem for me, but you would indeed have an Info. The program is once again a real asset to HomeGenie.

2. Can I put the DHT-22 also in the graphical analysis? I mean like
in analysis and statistics. A graphical curve is to me the temperature curve
View over a period. For example: What is the temperature I had tonight at 01.00 clock in my garage?
I hope you know what I mean.

Thank you again for your great work! I think many users can use this application.

Thoralf
« Last Edit: June 21, 2015, 05:38:56 PM by pinie_pinie »

June 22, 2015, 06:20:31 AM
Reply #10

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi Thoralf,

Point 1 : If you have made modification can you send me the HGX and widget files you have touch. Or do you need I make it ?
Point 2 : I have not use Analysis until now so I can't answer you about your needed.

Cheers
Dani

June 23, 2015, 11:11:20 AM
Reply #11

pinie_pinie

  • ***
  • Information
  • Full Member
  • Posts: 55
Hi Dani,
It took a little longer with me. I have further tested.
Can you customize the special thermometer again?
The following functional way would be better.
We turn only one GPIO port.
When the lower set point of the GPIO port switches. The port remains connected to the upper set point is reached and then switches off.
We have a flexible adjustment of the switching points (hysteresis).
I want the program to use garage so in winter there is no frost.
The setting of the two set-points should be from -10 to +40 C. so
the thing can be used universally.
I have discarded the variant with both ports.
Thank you for your support and work.

Thoralf

June 23, 2015, 12:34:30 PM
Reply #12

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
I don't understand exactly your needed. Now you need only on relay ? With two value ?
Can you make a small drowing for explain exactly ?

I understanf that :
Low Point : 14°C
High Point : 20°C
If temperature goes under 14° then switch on the GPIO
If temperature goes upstair 20° then switch off the GPIO until the temperature go dwn until 14°C

That's right ?

June 23, 2015, 01:24:19 PM
Reply #13

pinie_pinie

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

it's almost right.
We turn only one GPIO port.

Low Point: 14C
High Point: 20C

If the temperature is above 14C then GPIO Port on. The temperature rises, the GPIO port is on.
If the temperature rises above 20C the GPIO port off.

The Low Point and High Point should be freely selectable (-10C - + 40C).


An addition to section 2 (temperature evaluation). I've created a little drawing. Maybe now you know what I mean.

Many Thanks!

Thoralf

June 24, 2015, 12:37:19 PM
Reply #14

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi Pinie_Pinie,

You can find here new version following your last specs.

Cheers
Dani