old_contents: #!/usr/bin/python
  # -*- coding: utf-8 -*-
  # Original code from: https://tutorials-raspberrypi.com/raspberry-pi-measure-humidity-temperature-dht11-dht22/
  # Christopher Gray - v0.0.1 - 6/19/2018
  import sys, os
  from datetime import datetime
  import Adafruit_DHT
  #-----------------------------
  sensor = Adafruit_DHT.DHT22
  pin = 4
  humidity, Celsius = Adafruit_DHT.read_retry(sensor, pin)
  Fahrenheit = round((9.0/5.0 * Celsius + 32), 2)
  humidity = round(humidity, 2)
  #-----------------------------
  var_Human_Output = "temperature: " + str(Fahrenheit) + "°F, Humidity: " + str(humidity) + "% at: " + datetime.now().strftime('%Y-%m-%d %H:%M:%S')
  print str(var_Human_Output)
  
new_contents: #!/usr/bin/python
  # -*- coding: utf-8 -*-
  # Original code from: https://tutorials-raspberrypi.com/raspberry-pi-measure-humidity-temperature-dht11-dht22/
  # Christopher Gray - v0.0.1 - 6/19/2018
  import sys, os, time
  #import paho.mqtt.publish as publish
  #from datetime import datetime
  import Adafruit_DHT
  #------ vars -----------------
  sensor = Adafruit_DHT.DHT22
  pin = 4
  MQTT_SERVER = "192.168.1.5"
  MQTT_PATH = "channel_sensors_temperature"
  #-----------------------------
  Humidity, Celsius = Adafruit_DHT.read_retry(sensor, pin)
  Fahrenheit = round((9.0/5.0 * Celsius + 32), 2)
  Celsius = str(round(Celsius, 2))
  Humidity = str(round(Humidity, 2))
  #-----------------------------
  #var_Human_Output = "Temperature: " + str(Fahrenheit) + "°F / " + str(Celsius) + "°C, Humidity: " + str(Humidity) + "% at: " + datetime.now().strftime('%Y-%m-%d %H:%M:%S')
  #print str(var_Human_Output)
  
  #var_M2M_Output = Fahrenheit + "," + Humidity + "," + datetime.now().strftime('%Y-%m-%d %H:%M:%S')
  var_M2M_Output = Fahrenheit + "," + Humidity + "," + str(int(time.time()))
  print str(var_M2M_Output)
  
  #publish.single(MQTT_PATH, "Hello World!", hostname=MQTT_SERVER)
  
subject: Update get_temps_mqtt.py