• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controlling device values using a script (updating temperature manually)
#1
Question 
Hello,

i have a Question, googled a lot already but couldnt find a solution for my use case.

I would like to controll device values (dht22 temperature/humidity) using a python script.

So updating it manually by a script which gets the values instead of pilight doing the stuff


My Situation:

Normally the dht22 sensor works fine however in combination with heavy cpu load (motion service webcam streaming) it doesnt give any results

I got it working now using the following tutorial:
https://www.raspberrypi.org/forums/viewt...37&t=86771

However thats not supported by pilight for the protocol.

I can get temperature/humidity by the python script now but i would like to display the values in the pilight gui.
(I also have another server that uses the pilight api to get the temperature/humidty values and logs it into a database)

i tried to do
pilight-control -d temp3 -v temperature=15

however pilight-control needs "-s state" as argument
and there are no valid state arguments for the weather protocol, i think ?

Can anybody help me ?

i think a simple modification of https://github.com/pilight/pilight/blob/...ces.c#L472 could make it work, however i never programmed c before. If i get time i will inspect the source code a bit more.

pilight Version 7.0

Device Setting:
"temp3": {
"protocol": [ "dht22" ],
"id": [{
"gpio": 2
}],
"temperature": 15.2,
"humidity": 27.6,
"poll-interval": 60
}
 
Reply
#2
Try using pilight-send, it is a more versatile tool which should let you do this. Note that the ID of the sensor is very important in this case.

pilight-control is more suitable for devices like switches and dimmers, since you usually don't "control" the temperature value of your weather stations, but you do "control" the state of your switches.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  tfa30 temperature-offset not working wseifert 0 313 04-29-2018, 06:12 PM
Last Post: wseifert
  Looking for a cheap temperature and humidity sensor madmoses 10 1,546 03-11-2018, 03:47 PM
Last Post: geokscott
  Charts for temperature sensors? Dergo 3 854 01-01-2018, 08:13 PM
Last Post: curlymo
  pilight stopped working after updating RPi3 SmartValley 35 16,559 12-06-2017, 10:37 PM
Last Post: droptix
  Teknihall shows Temperature more than 100 if temp is under 0 Micha_123 1 656 12-02-2017, 09:53 PM
Last Post: pilino1234
Smile config, device uuid <-> id Twain 2 1,131 06-22-2017, 05:49 PM
Last Post: Twain
  negative Temperature for laubi 19 5,686 01-22-2017, 11:47 PM
Last Post: Jeans
  temperature, humidity sensor from china? Twain 5 1,620 11-29-2016, 06:33 PM
Last Post: pilino1234
  config device #1 "living", missing protocol jjlf 5 1,847 11-08-2016, 11:55 PM
Last Post: jjlf
  One Device Multiple Rules ColdScythe 1 803 11-07-2016, 07:07 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)