|
Post by misterolsen on Jan 19, 2021 12:33:33 GMT -8
Hi.
In state.py I can see the Altitude variable, shouldn't it show the value I've inserted in the json file? cause I've inserted 15 meter and the Altitude variable shows 111.6045
another question, in PrintState, is it possible to show the vaules of each wireless temperature sensor, like temp for channel id 1 and humidity for channel id 3 ?
also so I can maek a battery warning in my own setup.
|
|
|
Post by SDL on Jan 20, 2021 17:17:53 GMT -8
1) With your passwords redacted, please post your JSON file. Let me take a look.
2) The wireless indoor temperature sensors are in an array in state.py (IndoorTH) You can print out the array or write some code to just get the values you want.
3) Yes, what battery are we talking about? the ones in the WeatherRack2 and indoor sensors?
BP
|
|
|
Post by misterolsen on Feb 2, 2021 1:38:13 GMT -8
Hi
1) file is attached
2) Can you show me an example on how to use IndoorHT from state, so I can see the temperature on sensor 3 for example ?
3) I want to be able to see all batteries, so I can make an alarm when one of them needed to be replaced.
Kind regards, Thomas.
Attachments:SkyWeather2.JSON (1.17 KB)
|
|
|
Post by SDL on Feb 2, 2021 10:27:15 GMT -8
Check out the MySQL indoor temperature and humidity database. All the current values are there. Learn how to use phpmyadmin to look at the values. preinstalled on our SDCard.
<your.ip.number>/phpmyadmin
username: admin password: password (unless you changed the default MySQL root password)
That's probably the easiest way of doing that.
BP
|
|
|
Post by misterolsen on Feb 3, 2021 5:07:26 GMT -8
Hi BP.
What about the wrong altitude ?
For the temp sensors I'm using:
con = mdb.connect('localhost', 'root', 'secret', 'SkyWeather2'); cur = con.cursor() query1 = "SELECT * FROM `IndoorTHSensors` where ChannelID = 1 ORDER BY id DESC $ cur.execute(query1) swor = cur.fetchall() con.close() for wor in swor : indetemp = wor[4] indehumid = wor[5] batt = wor[6]
Then I got all from sensor 1 it was just if thare allready was a variable in the state.py
Kind regards, Thomas.
|
|
|
Post by SDL on Feb 3, 2021 8:50:28 GMT -8
There is a dynamic data structure in state.py
What is the results of your program above?
Try adding a print statement in SkyWeather.py so you can see what is stored in that variable. IndoorTH
BP
|
|