text: import time
  import board
  import adafruit_dht
  from paho.mqtt import client as mqtt_client
  
  broker = 'xxxx'
  port = 1883
  topic_temp = "temp"
  topic_hum = "hum"
  user="xxxx"
  passwd="xxxx"
  
  #Initial the dht device, with data pin connected to:
  dhtDevice = adafruit_dht.DHT11(board.D13) # depende de donde este conectado el sensor
  
  mqtt_dht = mqtt_client.Client("DHT")
  mqtt_dht.username_pw_set(user,passwd)
  mqtt_dht.connect(broker,port)
  while True:
      try:
          # Print the values to the serial port
          temperature_c = dhtDevice.temperature
          temperature_f = temperature_c * (9 / 5) + 32
          humidity = dhtDevice.humidity
          print("Temp: {:.1f} F / {:.1f} C    Humidity: {}% ".format(temperature_f, temperature_c, humidity))
          result = mqtt_dht.publish(topic_temp, temperature_c)
          result = mqtt_dht.publish(topic_hum, humidity)
      except RuntimeError as error:     # Errors happen fairly often, DHT's are hard to read, just keep going
          print(error.args[0])
      time.sleep(2.0)
  