• 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)

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:

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
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.

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

Forum Jump:

Browsing: 1 Guest(s)