Error in Alert Sensor value line

Hi @indrayudh99chowdhury,
You have used an extra single quote in that statement which the interpreter detects isn’t ended. You can just remove that to fix the error.
But then you might face another error from using \ in the statement for a line break and not jumping to a next line. You can either remove that or simply put the rest of the statement that appears after the \ in the next line.

message = "Alert! Sensor value has exceeded "+str(conf.threshold)+". The current value is "+str(sensor_value)+"."

or

message = "Alert! Sensor value has exceeded "+str(conf.threshold)+\
". The current value is "+str(sensor_value)+"."
1 Like

Hi,
You can also try this:

message = "Alert! Sensor value has exceeded {}. The current value is {}. ".format(str(conf.threshold),str(conf.sensor_value))

It will not create any confusion regarding continuous " "or ’ ’

1 Like

thanks a lot @pankajkumar.p