ESPHome sharing other devices entities?

Hi all. I am struggling to find an answer as to how i can use a sonoff + a nodemcu, and share the entities of the sonoff switches to the nodemcu in order to make a thermostat. So while the nodemcu reports temperature values, there needs to be a thermostat which can communicate with the switches from the sonoff device? Is this possible in esphomes “thermostat” ?

Thank you.

If anyone comes here looking for the same answer. I managed to do it using MQTT. Create a publish event, then update the temp values to that event with an automation. Then go to the ESP controller which has the switches and create a subscribe event. Give it an ID so you can call that value when you create the climate thermostat.