aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/neohub.py
diff options
context:
space:
mode:
authordennis <d@ennis.no>2023-02-06 20:27:30 +0100
committerdennis <d@ennis.no>2023-02-06 20:27:30 +0100
commitb1eab0da8b09397785692b1b0387e5157ad3d663 (patch)
tree2a4bcda4e38e57d06827484736e38ca431e3d36a /scripts/neohub.py
parentremove extra whitespace (diff)
downloadenergyscripts-b1eab0da8b09397785692b1b0387e5157ad3d663.tar.gz
insert more temperatures
Diffstat (limited to 'scripts/neohub.py')
-rw-r--r--scripts/neohub.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/neohub.py b/scripts/neohub.py
index e5c1b16..4fd3a16 100644
--- a/scripts/neohub.py
+++ b/scripts/neohub.py
@@ -46,4 +46,19 @@ async def run():
common.dbi(sql, values)
+
+ sql = """INSERT INTO mqtt_temps
+ (name,
+ temperature,
+ time,
+ room)
+ SELECT 'neohub', %s, %s, sensors.room
+ FROM sensors
+ WHERE sensors.name = 'neohub'"""
+ values = (device.temperature, datetime.utcnow())
+
+ common.dbi(sql, values)
+
+
+
asyncio.run(run())