Page 1 of 1
DHT22
Posted: Thursday 16 July 2020 5:47
by FredZ
Hello all
I'm attempting to get a DHT22 working with domoticz using
this scrip. However it isn't working for me. And as I'm not a programmer I don't know how to debug it.
I've entered all the relavent data into the parameters sections
I fixed the first line
I now get the following error when I run the script.
Code: Select all
if r.status_code! = 200:
^
SyntaxError: invalid syntax
I'm hoping I can get this going. Seems that a lot of people are attempting the same thing, or have attempted it and given up for various reasons.
Any thoughts or comments would be most helpful.
Regards
Fred
Re: DHT22
Posted: Thursday 16 July 2020 7:57
by waaren
FredZ wrote: ↑Thursday 16 July 2020 5:47
I now get the following error when I run the script.
Code: Select all
if r.status_code! = 200:
^
SyntaxError: invalid syntax
try
Re: DHT22
Posted: Thursday 16 July 2020 19:38
by FredZ
Thanks for that.
Now I get the following error
Code: Select all
print "Domoticz API error"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Domoticz API error")?
So I added the brackets
Then I get the following error
Code: Select all
url + = '& nvalue = 0 & svalue ='
^
SyntaxError: invalid syntax
Now I get the feeling something is actually wrong with the script.
Regards
Fred
Re: DHT22
Posted: Friday 17 July 2020 9:32
by boum
FredZ wrote: ↑Thursday 16 July 2020 19:38
Then I get the following error
Code: Select all
url + = '& nvalue = 0 & svalue ='
^
SyntaxError: invalid syntax
Now I get the feeling something is actually wrong with the script.
FredZ wrote: ↑Thursday 16 July 2020 5:47
I'm attempting to get a DHT22 working with domoticz using
this script. However it isn't working for me. And as I'm not a programmer I don't know how to debug it.
Except for the print parenthesis which is because of writing for an older Python interpreter, the script looks fine.
Check on the webpage, none of those space characters are present! It might be some copy/paste or formatting snafu. Check your editor, double-check for any other modifications between source and your copy.
Re: DHT22
Posted: Friday 17 July 2020 11:35
by ILoveIOT
Re: DHT22
Posted: Friday 17 July 2020 16:36
by FredZ
I have discovered the issue.
As the original url is in french, I had google translate it. During the translation google has meesed with spacings.
I copied the code in its native form, then translated the text to english after.
All working.
I most appreciate the help/pointers
Regards
Fred
Re: DHT22
Posted: Wednesday 07 October 2020 15:31
by Freelance
Hi guys,
i got this working as well, but the temperature reading happens only once after i run the command python 2302.py where 2302.py is the script from the french site.
How can i get Domoticz to read the sensor all the time? Do i need to loop the script and how to do that?
Re: DHT22
Posted: Thursday 08 October 2020 4:25
by FredZ
I have a better solution to the above.
I ended up using a NodeMCU and installed EasyESP wich has many plugins including for the DHT?? series of temp sensors. It also talks to Domoticz directly.
So now I leave my Domoticz box inside and the sensors are where they need to be as remote sensors.
Regards
Fred