There are two parts to the question
1. The html communication with b4j, how to. I saw a code sample how to build the html portion. I can use b4j events to send information to the html client. This was really cool how you made the html coding seemlessly integrated with the b4j code. It seemed like programming angularjs events, with the exception it was b4j
2. Second, the b4j communication with a internet connected device like a thermostat or scale. On b4a I used Bluetooth to connect to the device and serial communication to get information from the device