Page 2 of 2

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 8:00
by kiddigital
arhangel76 wrote:not work...
https://prnt.sc/v51yp5
What is shown in the Domoticz log? Do you see there that it has updated the sensor values?

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 8:16
by arhangel76

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 8:30
by arhangel76

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 8:49
by kiddigital
Ok, the sensor gets updated as you can see the ‘last updated’ timestamp.

We now need to now how we provide the correct values to the sensor based on its type.

Try this on the command line

Code: Select all

curl -s -i -H "Accept: application/json" "http://$SERVER/json.htm?type=command&param=udevice&idx=10&nvalue=0&svalue=“11;77”
As see what it does.

Play around with the values between the quotes of svalue.

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 8:57
by arhangel76
its stay like that what can i type next?
https://prnt.sc/v532c2

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 9:06
by kiddigital
arhangel76 wrote:its stay like that what can i type next?
https://prnt.sc/v532c2
Press CTRL+c to abort

Remove the “ before http and try again

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 9:08
by arhangel76

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 9:10
by kiddigital
Replace $SERVER with 127.0.0.1:8080

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 9:13
by arhangel76

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 9:20
by kiddigital
Replace both the “ at the end with ‘

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 9:27
by arhangel76

DHT11 Help !!!

Posted: Friday 23 October 2020 10:22
by kiddigital
The command should be

Code: Select all

curl -s -i -H "Accept: application/json" ‘http://127.0.0.1:8080/json.htm?type=command&param=udevice&idx=10&nvalue=0&svalue=“11;77”’
If it return 401 Unauthorized, there is a permission issue to solve first.

Hopefully this works

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 10:24
by arhangel76

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 10:28
by kiddigital
Ok, we are fighting with the command line interpreter here. I will try it myself and get back to you later...

Maybe you can google in the mean time to figure out how a correct command should look like. I think there should be plenty examples on this forum.

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 10:29
by arhangel76
its hard for newbye like me,im not understand to much

Re: DHT11 Help !!!

Posted: Friday 23 October 2020 12:44
by arhangel76
i find new script:

https://prnt.sc/v583et
and contain this text:

import Adafruit_DHT
import time

DHT_SENSOR = Adafruit_DHT.DHT11
DHT_PIN = 4

while True:
humidity, temperature = Adafruit_DHT.read(DHT_SENSOR, DHT_PIN)
if humidity is not None and temperature is not None:
print("Temp={0:0.1f}C Humidity={1:0.1f}%".format(temperature, humidity))
else:
print("Sensor failure. Check wiring.");
time.sleep(3);

Re: DHT11 Help !!!

Posted: Saturday 24 October 2020 18:50
by arhangel76
So nobody know?

i use this tutorial:

https://www.thegeekpub.com/236867/using ... spberry-pi

and the result is here:

https://prnt.sc/v61hoz

I want only to show in domoticz page...

Re: DHT11 Help !!!

Posted: Sunday 25 October 2020 21:00
by kiddigital
@arhangel76

Please try the command below. Make sure you have the double-quotes around both parts

Code: Select all

curl -s -i -H "Accept: application/json" "http://127.0.0.1:8080/json.htm?type=command&param=udevice&idx=10&nvalue=0&svalue=10.3;66;0"
Can you show the output?

And to update the values: You see svalue=10.3;66;0 where the first (10.3) is the temperature and the second (66) the humidity. The third (0) is not used here.

So you have to modify your script to this

Code: Select all

curl -s -i -H "Accept: application/json" "http://$SERVER/json.htm?type=command&param=udevice&idx=$DHTIDX&nvalue=0&svalue=$TEMP;$HUM;0"

Re: DHT11 Help !!!

Posted: Sunday 25 October 2020 23:16
by arhangel76
Thank you for your help but i succeed,the problem it was whit url link.

Now work just fine

Re: DHT11 Help !!!

Posted: Monday 26 October 2020 5:06
by ILoveIOT
Should work,

viewtopic.php?f=32&t=27467

Buy a DHT22 for better results.