My printer has 6 inks and I want the ink level message to tell me which ink is low. If the message entry is just text like “Ink level low” the automation runs fine. But I cannot find how to get the friendly name of the ink for the message. I’ve tried many combinations I’ve found on the forum but I can’t get any to work. In the example pasted below the trace error is “Error: Error rendering data template: UndefinedError: ‘dict object’ has no attribute ‘to_state’”. Thanks for your help!
From the Automations list I click the 3 … and select the Run in order to test it. So you’re saying this won’t work and I would have to wait for it to trigger on its own?
There’s nothing wrong with your automation. The problem is your testing procedure is incorrect. The Run command simply executes the automation’s actions (and because it doesn’t actually trigger the automation, the trigger variable is undefined).
Go to Developer Tools > States
Click on sensor.epson_xp_960_series_black_ink
The selected sensor should now appear at the top of the page in a form.
If the sensor’s current value is above 20, set its State to a value below 20 then click the Set State button.
This is sufficient to trigger your automation.
If the sensor’s current value is already below 20, set its State to a value above 20 and click the Set State button. Then set it to a value below 20 and click the Set State button.
After you are finished testing, set the sensor’s state value back to its original value or wait until its integration updates it with the latest value (the amount of time that may require depends on how the sensor’s integration operates).