Computed attributes for fuel sensors

M. Najm4 years ago

Hello,
I have read your documebtation about the computed attributes, and I have remark about this information on your page:

You have a device with some configurable analog inputs and connected fuel sensor to first one. Let's say analog input has 10 bit resolution
(0..1024) and maximum value 20 volt. Fuel sensor report rest of fuel as voltage from 0 to 12 volts, where 0 V is empty and 12 V is full 40 liters tank.

Fuel
adc1 ? adc1 * 0.065 : null
Number

So for a 40L tank with a voltage in millivolts from 0-12V, the expression shouldn't be:
adc1 ? adc1 * 0.003 : null
?

Anton Tananaev4 years ago

You should collect data for known levels and derive the formula from there.

M. Najm4 years ago

Yes I understand, but adc1 * 0.065 will never equal 40L when the sensor output is 12V..