In my quest to automate my home, I encountered a few essential appliances that lacked smart connectivity—like my dryer, washing machine, and dishwasher. While I couldn’t remotely control them, I still wanted to receive notifications when they started and, more importantly, when they finished. In a previous post, I discussed controlling air conditioners using IR transmitters that connect to Home Assistant. That allowed me to control the AC on/off, but it didn’t give me an indication about the actual status of the air conditioner. Is it on right now? You can’t know that just using a transmitter like that. So, we need a solution to work alongside the transmitters to have an indication of when the device is on or off. The solution? Using a smart plug to monitor their activity.
Why Use a Smart Plug?
In a previous post, I discussed the use of smart plugs to control devices like lamps. However, for this scenario, we’ll use a different feature of smart plugs: energy monitoring. Instead of turning the plug on or off, we’re going to leverage the plug’s ability to track power consumption. This way, we can determine whether an appliance like a dishwasher is running based on its power usage.
Note: Not all smart plugs support energy monitoring, so make sure you choose one that does. I’ve found a reliable model that works well for this purpose, which you can find here. Although most of my devices are Zigbee-based, I opted for a Wi-Fi plug in this case due to the lack of reliable Zigbee options with energy monitoring.
Setting Up the Smart Plug in Home Assistant
After plugging in the smart plug, follow the instructions to pair it with the Smart Life app on your phone (All Tuya devices use this app). Once paired, refresh the Tuya integration in Home Assistant to see the new device.
Now, let’s set up Home Assistant to monitor whether your connected device is running:
- Go to Home Assistant -> Settings -> Devices & Services -> Integrations -> Tuya. Find your newly added device, click on it, and locate an entity called Current. Click on the cogwheel icon and note down the Entity ID name.
- Navigate to Home Assistant -> Settings -> Devices & Services -> Helpers -> Create Helper.
- Select Create Helper and choose Template, then select Template a Binary Sensor. This will allow us to create a new binary sensor in Home Assistant to track whether the device is on or off.
- Name your new sensor, for example, “Device Activity.”
- In the state template, enter the following code:
{{states('sensor.dishwasher_plug_current') | float > 0.1}}
Replace sensor.dishwasher_plug_current
with the Entity ID name you noted down earlier, and adjust the 0.1
threshold as needed to detect when the device is running. For most of my appliances, 0.1 (Ampere) is a suitable threshold.
- Under Device Class, select Running.
- Select the device associated with the smart plug, and click Submit.
You should now see the new entity in your Tuya integration for this smart plug.
Monitoring and Automation
With the new binary sensor in place, you can easily create a dashboard card that shows whether the device is active. Additionally, you can set up automations to send notifications when the device starts or stops running.
For example:
alias: Notify When Dishwasher Finishes
description: ""
trigger:
- platform: state
entity_id: binary_sensor.device_activity
to: "off"
condition: []
action:
- service: notify.mobile_app
data:
message: "The dishwasher has finished running."
mode: single
Summary
Integrating non-smart appliances into your smart home doesn’t require complicated setups. By using a smart plug with energy monitoring, you can easily track when your devices like washing machines, dishwashers or air conditioners are running. This method provides valuable insights into your appliances’ activity, allowing you to receive notifications when they start or stop, making your home automation system even more efficient.