Hi,
we are trying the sensor from milesight EM400-MUD and EM400-TLD
We are trying to measure the if a trash can is full or empty.
we then want to visulize this in grafana. se attached picture.
however we have some issue with our formula in nodered. that is calculating the function "distance" to values between 1 and 0. ( this so we can make a graph in grafana.
the problems:
- Both of the sensor is showing the same value in grafana. (this should be due to the wrong forumula in nodered)
- It is hard for us to put a value when the trash bin is empty. Due to the plastic bag moving around.
- sometimes we get a value from the sensor saying "max" witch need to be filtret out. (it is the value 65533)
- any other improvments in the formula in nodered?
Nodered funktion:
// (500 - 48) / (500 - 48) == Empty == 1
// (500 - 1200) / (500 - 48) == FULL == 0
// 650 == TOM
// 48 == FULL
let newmsg = {}
newmsg.payload = (650 - msg.payload.value) / (650 - 50)
return newmsg;