Changed to PubSubClient MQTT library as it is better documented and has working LWT.
Changed MQTT publishing to publish all values as one JSON string to minimize the number of MQTT transfers from 4 to 1 per cycle to minimize the load on the MQTT server.
Added MQTT Last Will and Testament (LWT) to inform MQTT subscribers if the sensor is connected or disconnected.
Changed to PubSubClient MQTT library as it is better documented and has working LWT.
Changed MQTT publishing to publish all values as one JSON string to minimize the number of MQTT transfers from 4 to 1 per cycle to minimize the load on the MQTT server.
Added MQTT Last Will and Testament (LWT) to inform MQTT subscribers if the sensor is connected or disconnected.