Files
HP_InHand_IG502/Pub_Sub/hrtankbattery/thingsboard/pub/sendAlarms.py
2022-10-05 12:31:47 -05:00

12 lines
341 B
Python

# Enter your python code.
import json, time
from common.Logger import logger
from quickfaas.remotebus import publish
def sendAlarm(message):
logger.info(message)
payload = {}
payload["ts"] = time.time()*1000
payload["values"] = {message["measureName"]: message["value"]}
publish(__topic__, json.dumps(payload), __qos__)