mqtt_topic = cur.get(config,"mqtt","topic")
mqtt_alarm_topic = cur.get(config,"mqtt","alarm_topic")
+ mqtt_user = cur.get(config,"mqtt","user")
+ mqtt_passwd = cur.get(config,"mqtt","password")
+
if mqtt_host and not mqtt_id then
mqtt_id="weather-"..web_devid
end
command = command.." \""..url.."\""
os.execute(command)
+ print()
end
if mqtt_host then
MQTT = require "paho.mqtt"
mqtt_client = MQTT.client.create(mqtt_host, mqtt_port)
+ if mqtt_user then
+ mqtt_client:auth(mqtt_user, mqtt_passwd)
+ end
mqtt_client:connect(mqtt_id)
json = require( "json" )
end