I am trying to go through the Temperature Sensor example, and a couple of questions came to my mind. I am sorry if these questions seem very basic or even folish, but I am not a professional programmer. Just trying to figure out the library in order to integrate an ESP32 located in a different WiFi network than the one where I have HA running.
1.) I was expecting to read the values of a temperature sensor in one of the Analog inputs of Arduino and publish those values using mqtt in HA broker (I am using Mosquitto). Instead, I notice you are publishing the following values:
Shouldn't 'lastValue' be based on the reading of the temperature sensor in one of the analogue inputs of the arduino?
2.) You have a callback function 'onBeforeSwitchStateChanged()' that you mention to be called before publishing the new value of the sensor. Going through the source code, I find that the constructor used in the example does not have a callback function defined:
I am trying to go through the Temperature Sensor example, and a couple of questions came to my mind. I am sorry if these questions seem very basic or even folish, but I am not a professional programmer. Just trying to figure out the library in order to integrate an ESP32 located in a different WiFi network than the one where I have HA running.
1.) I was expecting to read the values of a temperature sensor in one of the Analog inputs of Arduino and publish those values using mqtt in HA broker (I am using Mosquitto). Instead, I notice you are publishing the following values:
Shouldn't 'lastValue' be based on the reading of the temperature sensor in one of the analogue inputs of the arduino?
2.) You have a callback function 'onBeforeSwitchStateChanged()' that you mention to be called before publishing the new value of the sensor. Going through the source code, I find that the constructor used in the example does not have a callback function defined:
Is this callback function used in this example?
Thanks for any help you can provide regarding these topics.