I want to read the temperature of sensor ID100 and sensorID101.
tried to use the following script but I'm getting Syntax error
// Configuration
let tempSensor1ID = 100;
let tempSensor2ID = 101;
let logInterval = 5000; // Logging interval in milliseconds (5 seconds)
// Function to get the temperature value of a sensor
function getTemperature(sensorID) {
let status = Shelly.getDeviceStatus({
id: sensorID,
component: "temperature",
});
return status.value;
}
// Function to log temperatures
function logTemperatures() {
// Read temperatures
let temp1 = getTemperature(tempSensor1ID);
let temp2 = getTemperature(tempSensor2ID);
// Log the temperatures to the console
print(`Sensor 1 Temperature: ${temp1}°C`);
print(`Sensor 2 Temperature: ${temp2}°C`);
}
// Set up a timer to log temperatures periodically
Timer.set(logInterval, true, logTemperatures);
what am I doing wrong ?