diff options
author | Dennis Eriksen <d@ennis.no> | 2023-04-03 16:07:08 +0200 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2023-04-03 16:07:08 +0200 |
commit | cd5a78bc94e7b338bff5f19f96add3dea4483856 (patch) | |
tree | 89f9f1df94cc375816b06229a8d3918e13ce516b /scripts/neohub.py | |
parent | Use Friendly name here (diff) | |
download | energyscripts-cd5a78bc94e7b338bff5f19f96add3dea4483856.tar.gz |
send mqtt and neohub to new states-table
Diffstat (limited to 'scripts/neohub.py')
-rw-r--r-- | scripts/neohub.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/scripts/neohub.py b/scripts/neohub.py index 7ef8b77..f2c0ed8 100644 --- a/scripts/neohub.py +++ b/scripts/neohub.py @@ -47,17 +47,8 @@ async def call_neohub(): VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s)""" common.dbi(sql, values, verbose=True) + common.statein('neohub', device.temperature, 'temperature', '°C', verbose=True) - sql = """INSERT INTO mqtt_temps - (sensor_id, - temperature, - time) - SELECT sensors.id, %s, %s - FROM sensors - WHERE sensors.name = 'neohub'""" - values = (device.temperature, datetime.utcnow()) - - common.dbi(sql, values, verbose=True) # Loop it forever while True: |