197 lines
26 KiB
Plaintext
197 lines
26 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"commandStop = [{\"msgId\":484041698330511,\"user\":\"22824\",\"mac\":\"00:00:05:00:00:03:01:99\",\"company\":\"194\",\"payload\":{\"name\":\"plcfreshwater_[00:00:05:00:00:03:01:99]!.writeplctag\",\"value\":\"{'tag': 'CMD_Cloud_Control', 'val': 0}\",\"expires\":\"161\"}}]\n",
|
|
"commandSync = [{\"msgId\":484041698330475,\"user\":\"22824\",\"mac\":\"00:00:05:00:00:03:01:99\",\"company\":\"194\",\"payload\":{\"name\":\"plcfreshwater_[00:00:05:00:00:03:01:99]!.sync\",\"value\":\"1\",\"expires\":\"161\"}}]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 12,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"dataTest = [{'name': '00:00:05:00:00:29', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348897, 'value': 15413721.0}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348897, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348897, 'value': 1817.21}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348897, 'value': 0.0}]}, {'name': '00:00:05:00:00:28', 'health': 0, 'timestamp': 1698346340, 'measures': [{'name': 'cmd_cloud_control', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'raw_overload_status', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 0, 'timestamp': 1698348899, 'value': 0.0}, {'name': 'raw_local_start', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'raw_run_status', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'raw_auto_input', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'raw_hand_input', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 0, 'timestamp': 1698348899, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 0, 'timestamp': 1698348899, 'value': 0.0}]}, {'name': '00:00:05:00:00:12', 'health': 0, 'timestamp': 1698346340, 'measures': [{'name': 'cmd_cloud_control', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_overload_status', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 0, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'raw_local_start', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_auto_input', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_hand_input', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 0, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 0, 'timestamp': 1698348900, 'value': 0.0}]}, {'name': '00:00:05:00:00:10', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 3412488.0}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 11.279999999999999}]}, {'name': '00:00:05:00:00:07', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 958872.25}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}]}, {'name': '00:00:05:00:00:06', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 253666.95000000001}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}]}, {'name': '00:00:05:00:00:05', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 3110386.7999999998}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 29.670000000000002}]}, {'name': '00:00:05:00:00:04', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 7081315.5}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 34.299999999999997}]}, {'name': '00:00:05:00:00:03', 'health': 1, 'timestamp': 1698348119, 'measures': [{'name': 'CMD_Cloud_Control', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 6527304.0}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}]}, {'name': '00:00:05:00:00:01', 'health': 1, 'timestamp': 1698348055, 'measures': [{'name': 'CMD_Cloud_Control', 'health': 1, 'timestamp': 1698348901, 'value': 1}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348901, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348901, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348901, 'value': 989358.93999999994}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348901, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348901, 'value': 1}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348901, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348901, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348901, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348901, 'value': 14.17}]}]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 46,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"same\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"mac = \"00:00:05:00:00:03:01:99\"\n",
|
|
"if \"00:00:05:00:00:03\" == mac[:-6]:\n",
|
|
" print(\"same\")\n",
|
|
"else:\n",
|
|
" print(\"different\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 28,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Enter your python code.\n",
|
|
"import json\n",
|
|
"import os\n",
|
|
"#from quickfaas.measure import recall\n",
|
|
"#from common.Logger import logger\n",
|
|
"__qos__ = 1\n",
|
|
"def sync(mac,value, wizard_api):\n",
|
|
" #get new values and send\n",
|
|
" try:\n",
|
|
" data = dataTest#recall()#json.loads(recall().decode(\"utf-8\"))\n",
|
|
" except Exception as e:\n",
|
|
" print(e)\n",
|
|
" print(data)\n",
|
|
" for controller in data:\n",
|
|
" if controller[\"name\"] == mac[:-6]:\n",
|
|
" if controller[\"health\"] == 1:\n",
|
|
" print(\"meshify/db/194/_/plcfreshwater/\" + mac + \"/plc_ping\", json.dumps({\"value\": \"OK\"}), __qos__)\n",
|
|
" else:\n",
|
|
" print(\"meshify/db/194/_/plcfreshwater/\" + mac + \"/plc_ping\", json.dumps({\"value\": \"Comms Error to PLC\"}), __qos__)\n",
|
|
" for measure in controller[\"measures\"]:\n",
|
|
" #publish measure\n",
|
|
" topic = \"meshify/db/194/_/plcfreshwater/\" + mac + \"/\" + measure[\"name\"]\n",
|
|
" if measure[\"name\"] in [\"raw_hand_input\", \"raw_auto_input\", \"raw_run_status\", \"raw_local_start\",\"raw_overload_status\"]:\n",
|
|
" payload = [{\"value\": convert_int(measure[\"name\"], measure[\"value\"])}]\n",
|
|
" else:\n",
|
|
" payload = [{\"value\": measure[\"value\"]}]\n",
|
|
" #print(\"Sending on topic: {}\".format(topic))\n",
|
|
" #print(\"Sending value: {}\".format(payload))\n",
|
|
" print(topic, json.dumps(payload))\n",
|
|
"\n",
|
|
"def writeplctag(mac, value, wizard_api):\n",
|
|
" try:\n",
|
|
" value = json.loads(value.replace(\"'\",'\"'))\n",
|
|
" print(value)\n",
|
|
" if value[\"tag\"] == \"CMD_Cloud_Control\":\n",
|
|
" value[\"tag\"] = \"cmd_cloud_control\"\n",
|
|
"\n",
|
|
" message = {mac[:-6]:{value[\"tag\"]: value[\"val\"]}}\n",
|
|
" print(message)\n",
|
|
" except Exception as e:\n",
|
|
" print(e)\n",
|
|
" \n",
|
|
"def receiveCommand(topic, payload, wizard_api):\n",
|
|
" print(topic)\n",
|
|
" payload = json.dumps(payload)\n",
|
|
" print(json.loads(payload))\n",
|
|
" p = json.loads(payload)[0]\n",
|
|
" command = p[\"payload\"][\"name\"].split(\".\")[1]\n",
|
|
" commands = {\n",
|
|
" \"sync\": sync,\n",
|
|
" \"writeplctag\": writeplctag,\n",
|
|
" }\n",
|
|
" commands[command](p[\"mac\"].lower(),p[\"payload\"][\"value\"], wizard_api)\n",
|
|
" #print(command)\n",
|
|
" ack(p[\"msgId\"], p[\"mac\"], command, p[\"payload\"][\"name\"].split(\".\")[1], p[\"payload\"][\"value\"], wizard_api)\n",
|
|
"\n",
|
|
"def ack(msgid, mac, name, command, value, wizard_api):\n",
|
|
" #print(mac)\n",
|
|
" macsquish = \"\".join(mac.split(\":\")[:-2])\n",
|
|
" maclower = \":\".join(mac.split(\":\")[:-2])\n",
|
|
" maclower = maclower.lower()\n",
|
|
" #print(msgid)\n",
|
|
" #print(mac)\n",
|
|
" #print(name)\n",
|
|
" #print(value)\n",
|
|
" #wizard_api.mqtt_publish(\"meshify/responses/\" + str(msgid), json.dumps([{\"value\": \"{} Success Setting: {} To: {}\".format(macsquish,name, value), \"msgid\": str(msgid)}]))\n",
|
|
" #wizard_api.mqtt_publish(\"meshify/db/194/_/mainMeshify/\" + maclower + \":00:00/commands\", json.dumps([{\"value\": {\"status\": \"success\", \"value\": str(value), \"channel\": command}, \"msgid\": str(msgid)}]))\n",
|
|
"\n",
|
|
"def convert_int(plc_tag, value):\n",
|
|
" input_codes = {\n",
|
|
" 0: \"Off\",\n",
|
|
" 1: \"On\"\n",
|
|
" }\n",
|
|
"\n",
|
|
" run_status_codes = {\n",
|
|
" 0: \"Stopped\",\n",
|
|
" 1: \"Running\"\n",
|
|
" }\n",
|
|
"\n",
|
|
" overload_codes = {\n",
|
|
" 0: \"Good\",\n",
|
|
" 1: \"Down on Overload Tripped\"\n",
|
|
" }\n",
|
|
" \n",
|
|
" plc_tags = {\n",
|
|
" \"raw_hand_input\": input_codes.get(value, \"Invalid Code\"),\n",
|
|
" \"raw_local_start\": input_codes.get(value, \"Invalid Code\"),\n",
|
|
" \"raw_auto_input\": input_codes.get(value, \"Invalid Code\"),\n",
|
|
" \"raw_run_status\": run_status_codes.get(value, \"Invalid Code\"),\n",
|
|
" \"raw_overload_status\": overload_codes.get(value, \"Invalid Code\")\n",
|
|
" }\n",
|
|
"\n",
|
|
" return plc_tags.get(plc_tag, \"Invalid Tag\")\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 29,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"meshify/sets/194/00:00:05:00:00:03:01:99\n",
|
|
"[{'msgId': 484041698330475, 'user': '22824', 'mac': '00:00:05:00:00:03:01:99', 'company': '194', 'payload': {'name': 'plcfreshwater_[00:00:05:00:00:03:01:99]!.sync', 'value': '1', 'expires': '161'}}]\n",
|
|
"[{'name': '00:00:05:00:00:29', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348897, 'value': 15413721.0}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348897, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348897, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348897, 'value': 1817.21}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348897, 'value': 0.0}]}, {'name': '00:00:05:00:00:28', 'health': 0, 'timestamp': 1698346340, 'measures': [{'name': 'cmd_cloud_control', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'raw_overload_status', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 0, 'timestamp': 1698348899, 'value': 0.0}, {'name': 'raw_local_start', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'raw_run_status', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'raw_auto_input', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'raw_hand_input', 'health': 0, 'timestamp': 1698348899, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 0, 'timestamp': 1698348899, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 0, 'timestamp': 1698348899, 'value': 0.0}]}, {'name': '00:00:05:00:00:12', 'health': 0, 'timestamp': 1698346340, 'measures': [{'name': 'cmd_cloud_control', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_overload_status', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 0, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'raw_local_start', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_auto_input', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_hand_input', 'health': 0, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 0, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 0, 'timestamp': 1698348900, 'value': 0.0}]}, {'name': '00:00:05:00:00:10', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 3412488.0}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 11.28}]}, {'name': '00:00:05:00:00:07', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 958872.25}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}]}, {'name': '00:00:05:00:00:06', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 253666.95}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}]}, {'name': '00:00:05:00:00:05', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 3110386.8}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 29.67}]}, {'name': '00:00:05:00:00:04', 'health': 1, 'timestamp': 1698346361, 'measures': [{'name': 'cmd_cloud_control', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 7081315.5}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 34.3}]}, {'name': '00:00:05:00:00:03', 'health': 1, 'timestamp': 1698348119, 'measures': [{'name': 'CMD_Cloud_Control', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348900, 'value': 6527304.0}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348900, 'value': 0}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348900, 'value': 1}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348900, 'value': 0.0}]}, {'name': '00:00:05:00:00:01', 'health': 1, 'timestamp': 1698348055, 'measures': [{'name': 'CMD_Cloud_Control', 'health': 1, 'timestamp': 1698348901, 'value': 1}, {'name': 'raw_overload_status', 'health': 1, 'timestamp': 1698348901, 'value': 0}, {'name': 'spt_flow_meter_unit', 'health': 1, 'timestamp': 1698348901, 'value': 0}, {'name': 'lifetime_flow_meter_gal', 'health': 1, 'timestamp': 1698348901, 'value': 989358.94}, {'name': 'raw_local_start', 'health': 1, 'timestamp': 1698348901, 'value': 0}, {'name': 'raw_run_status', 'health': 1, 'timestamp': 1698348901, 'value': 1}, {'name': 'raw_auto_input', 'health': 1, 'timestamp': 1698348901, 'value': 1}, {'name': 'raw_hand_input', 'health': 1, 'timestamp': 1698348901, 'value': 0}, {'name': 'scaled_pressure_transducer', 'health': 1, 'timestamp': 1698348901, 'value': 0.0}, {'name': 'scaled_flow_meter', 'health': 1, 'timestamp': 1698348901, 'value': 14.17}]}]\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/plc_ping {\"value\": \"OK\"} 1\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/CMD_Cloud_Control [{\"value\": 0}]\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/raw_overload_status [{\"value\": \"Good\"}]\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/spt_flow_meter_unit [{\"value\": 0}]\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/lifetime_flow_meter_gal [{\"value\": 6527304.0}]\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/raw_local_start [{\"value\": \"Off\"}]\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/raw_run_status [{\"value\": \"Stopped\"}]\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/raw_auto_input [{\"value\": \"Off\"}]\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/raw_hand_input [{\"value\": \"On\"}]\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/scaled_pressure_transducer [{\"value\": 0.0}]\n",
|
|
"meshify/db/194/_/plcfreshwater/00:00:05:00:00:03:01:99/scaled_flow_meter [{\"value\": 0.0}]\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"receiveCommand(\"meshify/sets/194/00:00:05:00:00:03:01:99\", commandSync, \"test\")"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "tbDataCollector",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.10.5"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|