DHT22 sensor remote reading with Xbee s2c

Hey. Have anyone used DHT22 with Xbee devices? I am using nodemcu as a microcontroller and I need to send temperature reading from my remote xbee to a coordinator xbee which is connected to microcontroller. I have been folowing this guide:
https://www.youtube.com/watch?v=rnBx2yqKn_E
But i have realised that is not quite the same when using DHT22 and I cannot seem to know how to apply and change his code to get it working with DHT22

UPDATE

I use following code:

#include “DHT.h”
#define DHTPIN 3 //D3 pin
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
DHT dht(DHTPIN, DHTTYPE);
void setup() {
dht.begin();
Serial.begin(9600);

}

void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()){
float temp= dht.readTemperature();
Serial.println(temp);}
delay(1000);
}

and the output i get is NAN.

I have tested the DHT22 and connected it to my microcontroller and got it working, but when I connect it to remote XBEE, the output I get is NAN