Lesson 11 - Tiny House Temperature Monitoring: Difference between revisions

From Sensors in Schools
Jump to navigation Jump to search
(Created page with "= Using Python to Monitor Tiny House Temperature = == Using Python to Download Tiny House Temperature Data == <syntaxhighlight lang="python"> # Get Tiny House data for MPPS import dweepy url = dweepy.get_latest_dweet_for('MPPS-Tiny-House-8-bundoora') print(url) </syntaxhighlight> 900px == Put Temperature Data in Variables == <syntaxhighlight lang="python"> # Get Tiny House data for MPPS import dweepy url = dwee...")
 
No edit summary
Line 1: Line 1:
= Using Python to Monitor Tiny House Temperature =
= 1 - Using Python to Download Tiny House Temperature Data =
 
== Using Python to Download Tiny House Temperature Data ==


<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Line 15: Line 13:
[[File:Screenshot 2023-12-07 at 8.53.15 am.png | 900px]]
[[File:Screenshot 2023-12-07 at 8.53.15 am.png | 900px]]


== Put Temperature Data in Variables ==
= 2 - Put Temperature Data in Variables =


<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Line 36: Line 34:


[[File:Screenshot 2023-12-07 at 9.01.40 am.png | 900px]]
[[File:Screenshot 2023-12-07 at 9.01.40 am.png | 900px]]
= 3 - Recording Current Date and Time =
<syntaxhighlight lang="python">
# Get Tiny House data for MPPS
import dweepy
url = dweepy.get_latest_dweet_for('MPPS-Tiny-House-8-bundoora')
print(url)
dict = url[0]
internalTemp = dict['content'][('intTemp')]
print(f'The internal temperature is {internalTemp}')
externalTemp = dict['content'][('extTemp')]
print(f'The outside temperature is {externalTemp}')
# Current Date and Time
datetime = dict['content'][('date')]
print(f'The current date_time is {datetime}')
</syntaxhighlight>
[[File:Screenshot 2023-12-07 at 9.07.41 am.png | 900px]]

Revision as of 22:09, 6 December 2023

1 - Using Python to Download Tiny House Temperature Data

# Get Tiny House data for MPPS

import dweepy

url = dweepy.get_latest_dweet_for('MPPS-Tiny-House-8-bundoora')
print(url)

2 - Put Temperature Data in Variables

# Get Tiny House data for MPPS

import dweepy

url = dweepy.get_latest_dweet_for('MPPS-Tiny-House-8-bundoora')
print(url)

dict = url[0]

internalTemp = dict['content'][('intTemp')]
print(f'The internal temperature is {internalTemp}')

externalTemp = dict['content'][('extTemp')]
print(f'The outside temperature is {externalTemp}')

3 - Recording Current Date and Time

# Get Tiny House data for MPPS

import dweepy

url = dweepy.get_latest_dweet_for('MPPS-Tiny-House-8-bundoora')
print(url)

dict = url[0]

internalTemp = dict['content'][('intTemp')]
print(f'The internal temperature is {internalTemp}')

externalTemp = dict['content'][('extTemp')]
print(f'The outside temperature is {externalTemp}')

# Current Date and Time
datetime = dict['content'][('date')]
print(f'The current date_time is {datetime}')