I have an ESP32-C3 with two inlet temperature sensors connected and a fan controlled in speed via pwm.
What I would like to do is control the fan based on the temperature difference of the two sensors.
But I’m not succeeding, mainly because I don’t understand how to pass the sensor data from yalm to c++(lambda) and vice versa. Copy below what I wrote, can you help me better understand how to use the lambda function?
I had read about this call on a documentation, but I never understood completely. by the way I Correct the yalm configuration in this way but the output never change…
On a log it works properly. But the output work only malualli if I switch the output on. And when it’s on is at the maximum out, it never change whith the Return value display on a log.
Ps. i change the value of return from 250 to 100 and 100 to 50.
I make a step back and I reintegrated auto call function and this is the log
[14:39:37][D][sensor:094]: 'Template Sensor': Sending state 30.00000 with 1 decimals of accuracy
[14:39:40][D][sensor:094]: 'T_int': Sending state 20.48111 °C with 2 decimals of accuracy
[14:39:40][D][sensor:094]: 'H_Int': Sending state 34.09138 % with 2 decimals of accuracy
[14:39:40][W][component:170]: Component aht10.sensor cleared Warning flag
[14:39:43][D][bmp280.sensor:182]: Got temperature=24.8°C pressure=945.5hPa
[14:39:43][D][sensor:094]: 'T_Ext': Sending state 24.81398 °C with 1 decimals of accuracy
[14:39:43][D][sensor:094]: 'P_Ext': Sending state 945.52264 hPa with 1 decimals of accuracy
[14:39:43][W][component:170]: Component bmp280_base cleared Warning flag
[14:39:48][D][sensor:094]: 'Template Sensor': Sending state 50.00000 with 1 decimals of accuracy
[14:39:50][D][sensor:094]: 'T_int': Sending state 20.55969 °C with 2 decimals of accuracy
[14:39:50][D][sensor:094]: 'H_Int': Sending state 34.61981 % with 2 decimals of accuracy
[14:39:52][D][bmp280.sensor:182]: Got temperature=24.2°C pressure=945.5hPa
[14:39:52][D][sensor:094]: 'T_Ext': Sending state 24.16320 °C with 1 decimals of accuracy
[14:39:52][D][sensor:094]: 'P_Ext': Sending state 945.45013 hPa with 1 decimals of accuracy
[14:39:54][D][fan:021]: 'ventola' - Setting:
[14:39:54][D][fan:024]: State: OFF
[14:39:54][D][fan:120]: 'ventola' - Sending state:
[14:39:54][D][fan:121]: State: OFF
[14:39:54][D][fan:123]: Speed: 100
[14:39:55][D][fan:021]: 'ventola' - Setting:
[14:39:55][D][fan:024]: State: ON
[14:39:55][D][fan:120]: 'ventola' - Sending state:
[14:39:55][D][fan:121]: State: ON
[14:39:55][D][fan:123]: Speed: 100
[14:39:57][D][fan:021]: 'ventola' - Setting:
[14:39:57][D][fan:024]: State: OFF
[14:39:57][D][fan:120]: 'ventola' - Sending state:
[14:39:57][D][fan:121]: State: OFF
[14:39:57][D][fan:123]: Speed: 100
[14:39:58][D][fan:021]: 'ventola' - Setting:
[14:39:58][D][fan:024]: State: ON
[14:39:58][D][fan:120]: 'ventola' - Sending state:
[14:39:58][D][fan:121]: State: ON
[14:39:58][D][fan:123]: Speed: 100
[14:39:59][D][sensor:094]: 'Template Sensor': Sending state 50.00000 with 1 decimals of accuracy
[14:40:00][D][sensor:094]: 'T_int': Sending state 20.55607 °C with 2 decimals of accuracy
[14:40:00][D][sensor:094]: 'H_Int': Sending state 33.83141 % with 2 decimals of accuracy
[14:40:01][D][bmp280.sensor:182]: Got temperature=23.6°C pressure=945.4hPa
[14:40:01][D][sensor:094]: 'T_Ext': Sending state 23.59367 °C with 1 decimals of accuracy
[14:40:01][D][sensor:094]: 'P_Ext': Sending state 945.43341 hPa with 1 decimals of accuracy
[14:40:10][D][bmp280.sensor:182]: Got temperature=23.2°C pressure=945.4hPa
[14:40:10][D][sensor:094]: 'T_Ext': Sending state 23.24406 °C with 1 decimals of accuracy
[14:40:10][D][sensor:094]: 'P_Ext': Sending state 945.42932 hPa with 1 decimals of accuracy
[14:40:10][D][sensor:094]: 'T_int': Sending state 20.56618 °C with 2 decimals of accuracy
[14:40:10][D][sensor:094]: 'H_Int': Sending state 33.64458 % with 2 decimals of accuracy
[14:40:11][D][sensor:094]: 'Template Sensor': Sending state 30.00000 with 1 decimals of accuracy
[14:40:20][D][bmp280.sensor:182]: Got temperature=23.0°C pressure=nanhPa
[14:40:20][D][sensor:094]: 'T_Ext': Sending state 22.98313 °C with 1 decimals of accuracy
[14:40:20][D][sensor:094]: 'P_Ext': Sending state nan hPa with 1 decimals of accuracy
the [fan:****] is me that turn off and on the output
But in other case the output was stable on or off and never change
Sorry.
Now it work.
Can I ask 1 more question? or maybe I have to create another post…
If I want to use a data from another device like a temperature I have only to declare the ID setted on that device?