Hi all, I’m trying to create a template sensor that will give me the lowest ink level reading of my printer, allowing me to use it to create an alert when the printer will need a new ink cartridge soon.
For the purpose of this sensor, I don’t care which ink cartridge it is (I have a dashboard I can go to look for that), I just want to know that it needs investigating.
I have four variables that monitor the different ink levels (I don’t use the printer’s sensors, as they wouldn’t be available when its turned off):
var.printer_ink_black
var.printer_ink_magenta
var.printer_ink_cyan
var.printer_ink_yellow
These contain values between 0 -100, stating the current % level of ink in each cartridge.
What I want to create is a sensor that contains the value of the lowest cartridge…
eg, if:
var.printer_ink_black = 36
var.printer_ink_magenta = 87
var.printer_ink_cyan = 25
var.printer_ink_yellow = 45
Then this sensor would have a value of 25
However, I’m really struggling to work out what logic and syntax to use to create a value_template:
configuration for the sensor.
Does anyone have any ideas? As I’ve ended up confusing myself trying to work this one out!
Thanks!