Good Evening,
I’ve got a script running which picks up the oil level in my tank (from a 433MHz transmitter) and publishes it to MQTT. I can pickup the feed in emoncms but I’m having problems manipulating it. The ‘depth’ reading I get from the transmitter is actually the level of free space in the tank (currently 16cm) which isn’t a particularly useful reading. What I’d actually like is the % full measurement which I’ve tried to do (unsuccessfully) by manipulating the data:
The depth reading I’ve attempted to publish to MQTT and also log are being stored as 0 rather than 87. Have I made some obvious noob mistake here? 120 is the height of my rectangular tanks (in cm).
Many thanks
Craig