From 3084422a9f311e7de3daf9bc9dfd79896e6a7f8c Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 1 Feb 2024 23:34:31 +0100 Subject: [PATCH] change location --- examples/solar-monitoring.py | 12 +++++------ examples/test.py | 42 ++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 examples/test.py diff --git a/examples/solar-monitoring.py b/examples/solar-monitoring.py index ade0e14..7804ab3 100644 --- a/examples/solar-monitoring.py +++ b/examples/solar-monitoring.py @@ -93,12 +93,12 @@ def monitor(pv_power,house_power,power_import_export,house_battery_soc,house_bat drawblack.text((2, 64), 'Batterie Entladen', font = font16, fill = 0) drawblack.text((2, 80), 'Auto Laden', font = font16, fill = 0) - drawblack.text((180, 0), str(pv_power), font = font16, fill = 0) - drawblack.text((180, 16), str(house_power), font = font16, fill = 0) - drawblack.text((180, 32), str(power_import_export), font = font16, fill = 0) - drawblack.text((180, 48), str(house_battery_soc), font = font16, fill = 0) - drawblack.text((180, 64), str(house_battery_power), font = font16, fill = 0) - drawblack.text((180, 80), str(charge_point_power), font = font16, fill = 0) + drawblack.text((160, 0), str(pv_power), font = font16, fill = 0) + drawblack.text((160, 16), str(house_power), font = font16, fill = 0) + drawblack.text((160, 32), str(power_import_export), font = font16, fill = 0) + drawblack.text((160, 48), str(house_battery_soc), font = font16, fill = 0) + drawblack.text((160, 64), str(house_battery_power), font = font16, fill = 0) + drawblack.text((160, 80), str(charge_point_power), font = font16, fill = 0) diff --git a/examples/test.py b/examples/test.py new file mode 100644 index 0000000..2f7719a --- /dev/null +++ b/examples/test.py @@ -0,0 +1,42 @@ +topic0 = { + "topic" : "openWB/bat/get/soc", + "line" : "0", + "value" : "" +} +topic1 = { + "topic" : "openWB/bat/get/power", + "line" : "1", + "value" : "" +} +topic2 = { + "topic" : "openWB/counter/7/get/power", + "line" : "2", + "value" : "" +} +topic3 = { + "topic" : "openWB/pv/8/get/power", + "line" : "3", + "value" : "" +} +topic4 = { + "topic" : "openWB/graph/lastlivevaluesJson", #house-power + "line" : "4", + "value" : "" +} +topic5 = { + "topic" : "openWB/vehicle/4/get/soc", + "line" : "5", + "value" : "" +} +topic6 = { + "topic" : "openWB/internal_chargepoint/0/get/powers", + "line" : "6", + "value" : "" +} + +topics = {0:topic0,1:topic1,2:topic2,3:topic3,4:topic4,5:topic5,6:topic6} + +topics[3]['value'] = '20' + + +print(topics[3]["line"]) \ No newline at end of file