Hello and a nice weekend to everyone reading this! Following Issue: I have a Tasmota Smart Plug to sensor the power draw of my washing mashine and yesterday I thought about using that sensor (“sensor.tasmota_waschmaschine_energy_power”) to measure if its currently running or not. The idea was to turn the Smart plug off at 8pm if its not doing its thing right now. Now the Problem: the washing mashine doesnt draw constantly high amounts of power during its washing phase. In fact, sometimes it does absolutely nothing in terms of power consumption, even though it has got an entire hour of work left.
To take care of that, I tried using a template trigger with a 10min “for” time value, to monitor if “sensor.tasmota_waschmaschine_energy_power” is really at idle. But that doesn´t work, because the template trigger needs a change in state to be triggered and if it was not coincidentally running right before 8pm the automation would not be triggered.
Here is my automation and thanks in advance:
Use the state trigger instead of the template trigger: The template trigger can be inefficient because it needs to evaluate the template every time the state of any entity changes in Home Assistant. Using the state trigger with a filter on the washing machine’s power consumption would be more efficient.
Use a time trigger instead of wait_for_trigger: The wait_for_trigger action is useful in some cases, but in this automation, it would be simpler to use a time trigger to turn on the washing machine at a specific time.
Use service instead of type for actions: The type action has been deprecated in Home Assistant and should be replaced with the `service’ action
That is a good point. If there is a chance that Home Assistant might restart during the waiting period, it is better to consider an alternative approach. One option could be to use a time-based trigger instead of the state trigger.
This automation triggers every day at 6:55 AM, which eliminates the need for a long wait period. The automation then checks if the washing machine power is below 10 W and if the current time is between 8 PM and 7 AM. If both conditions are met, the automation turns off the washing machine and waits for 10 hours and 55 minutes before turning it back on.
Thanks for helping me out. I cant use (or at least I dont know how) the state trigger, because in the visual editor the only state options for that sensor are “unavailable” and “unknown”.
I thought that you guys may not like my implementation of the “wait for trigger” xD it was not that important for me at the moment. But many thanks for the mentioned (better) methods
The only problem with your automation would be the < 10 state condition because the washing mashine could be drawing <10W in that very moment but be in a program anyways.
You’re welcome! If the state of the sensor is not available or unknown, you could try using a different sensor or entity that reports the power consumption of the washing machine.
Regarding the issue with the below: 10 condition, you’re right that it could potentially turn off the washing machine even if it’s in the middle of a cycle. One way to avoid this is to check the state of the washing machine itself, rather than just the power consumption. For example, if your washing machine has a status sensor that reports whether it’s currently running or not, you could add an additional condition to check that the washing machine is not running before turning it off.
Thank you for replying.
In the State condition section, I cant configure a state other than “Unknown” or “Unavailable” for “sensor.tasmota_waschmaschine_energy_power”. And with the template or numeric state conditions I cant configure a “for” time
Finally I came up with this solution (havent tested it fully yet, but at least it should work in theorie).
Be aware that I used 3 helpers: “counter.waschmaschine_zaehler”, “input_boolean.waschmaschine_on” and “input_datetime.waesche_zeit”. The last one is just for displaying the running time of the washing mashine in the notification.