According to Object Management Group organization, Data Distribution Service (DDS) middleware is the leading technology for Industrial Internet of Things (IIoT). Therefore, using DDS-based middleware for Wireless Sensor/Actuator Networks (WSAN) will extremely ease the development and integration of WSAN applications into IIoT, which has an effective impact on improving the productivity and saving the cost. However, applying such technology over WSAN significantly affects the energy consumption. In this work, an energy-aware middleware for WSAN is developed based on DDS standard, which is called EATDDS. Furthermore, developing this middleware leads to a major enhancement into TOSSIM simulator; in which an Online Energy Model (OEM) is developed to make TOSSIM capable of developing and testing energy-aware protocols. The model is validated by comparing it against POWERTOSSIM. Our results show that EATDDS is efficient and can be accommodated with limited system resources.