OSMC with DHT sending temperature and humidity to HA, MQTT?

I have a project while I want to have a temperature and humidity sensor(DHT) in each room of my house, for most of the rooms I’m using the ESP8266 which sends the temperature and humidity to my HA with MQTT.
I’m having 2 RPI media players which is running OSMC/kodi and are staying on all the time. In the two rooms I’m having the media players I was thinking that the RPI might could send temperature and humidity to my HA server, possible with MQTT.
Anyone think it could be done? Or something else I can set up to have the sensor connected to the OSMC interfaced with HA?

RPis are able to communicate with DHT22 sensors too via the GPIO pins. This Python script showed up after a quick Google search: raspberrypi.org/forums/view … 37&t=71336