Hi all, i’m just trying to extend the dht-sensors.coffee file to filter out the peak values but i’m not a dev, so maybe someone could give me a hint.
my dht-sensors.coffee file looks like this now, but the values don’t mind my intervention with min and max
requestValue: ->
try
readout = sensorLib.readSpec(@config.type, @config.pin)
if readout.isValid
@_temperature = readout.temperatur
this is my part where i try just to have values between 1 and 55 degrees
if 1 > @_temperature > 55
@_temperature = lastState?.temperature?.value
@_humidity = readout.humidity
this is my part where i try just to have values between 1 and 100 %
if 1 > @_humidity > 100
@_humidity = lastState?.humidity?.value
@emit "temperature", @_temperature
@emit "humidity", @_humidity
else
env.logger.debug("Couldn't read DHT-Sensor")
catch err
env.logger.error("Error reading DHT-Sensor: #{err.message}")
env.logger.debug(err.stack)
could someone give me a hint what i am doing wrong here as it seems not to work