BETA Release: Tasmota Device Handler for Plugs with Power Monitoring

Here is my latest DH in late BETA form. This time its for Tasmota Plugs with Power Management. This screenshot shows most of the capabilities of the device handler.
Apart from exposing a variety of power information from the Tasmota Plug it also supports the notion of “Operating State” based upon power consumption of the downstream device. Operating states are On, Off, Standby. This should provide some interesting capabilities such as monitoring a Washing Machine or Dryer and knowing when it has hit a low power state which would indicate completion of a cycle. You will need to use something like WebCore or SharpTools to access these states programmatically.

Video Demo: https://youtu.be/MKLAK8PdVtw

You can find more info here along with the code: https://github.com/GaryMilne/Tasmota-Plug-with-Power-Monitoring-for-SmartThings-Classic

This is a BETA release.

2 Likes

Hi which tasmota plugs are you referring to ?

Any single plug flashed with Tasmota that supports power monitoring. Does not have to be a specific version.

Hello,
This DTH is giving errors upon install: Org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update

and cannot be installed

I don’t get this error for some reason. I do know that it is related to the use of emojis contained in the message and log functions.

I’ve suggested elsewhere that you post the DH without those two functions to get it created and then go back and edit it and paste in the two functions that were omitted… I don’t know for sure if that will work but I suspect that it might. Please let me know if you give this a try.

Hi @GaryMilne,

Looks really good. I’m trying to use it with a POW R2 and sync fails for some reason.

Here is my log:

Logs

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:07 PM: debug :running_man: :two:…setOperatingState: Current Watts are:(0.0) … StandbyThreshold is: 2.0 …Operating State is:off

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:07 PM: debug :checkered_flag: :one:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:06 PM: debug :running_man: :three:…sleepForDuration: Slept 1001ms

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:06 PM: debug :checkered_flag: :three:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:07 PM: debug :checkered_flag: :three:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:05 PM: debug :checkered_flag: :three:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:03 PM: debug :checkered_flag: :three:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:06 PM: debug :checkered_flag: :three:…checkResponse: Processing loop: 1

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:05 PM: debug :checkered_flag: :three:…checkResponse: Processing loop: 2

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:04 PM: debug :checkered_flag: :three:…checkResponse: Processing loop: 3

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:00 PM: debug :checkered_flag: :three:…checkResponse: Processing loop: 7

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:07 PM: debug :arrows_counterclockwise: :stop_sign:…sync: Sync Failed…11.235 seconds

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:01 PM: debug :running_man: :three:…sleepForDuration: Slept 1001ms

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:00 PM: debug :checkered_flag: :three:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:01 PM: debug :checkered_flag: :three:…checkResponse: Processing loop: 6

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:07 PM: debug :running_man: :three:…sleepForDuration: Slept 1001ms

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:00 PM: debug :running_man: :three:…sleepForDuration: Slept 1001ms

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:04 PM: debug :checkered_flag: :three:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:02 PM: debug :running_man: :three:…sleepForDuration: Slept 1001ms

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:59 PM: debug :running_man: :three:…sleepForDuration: Slept 1001ms

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:05 PM: debug :running_man: :three:…sleepForDuration: Slept 1001ms

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:02 PM: debug :checkered_flag: :three:…checkResponse: Processing loop: 5

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:59 PM: debug :checkered_flag: :three:…checkResponse: Processing loop: 8

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:03 PM: debug :checkered_flag: :three:…checkResponse: Processing loop: 4

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:57 PM: debug :checkered_flag: :three:…checkResponse: Processing loop: 9

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:04 PM: debug :running_man: :three:…sleepForDuration: Slept 1001ms

3719e69a-139c-4d7f-b493-6645d356a43a 11:31:01 PM: debug :checkered_flag: :three:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:57 PM: debug :checkered_flag: :three:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:56 PM: debug :running_man: :three:…sleepForDuration: Slept 1001ms

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:59 PM: debug :checkered_flag: :three:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:56 PM: debug :checkered_flag: :three:…checkResponse: CommandFlag is: Processing

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:55 PM: debug :phone: :one:…callTasmota: Path: /cm?user=null&password=null&cmnd=STATUS%200

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:56 PM: debug :checkered_flag: :three:…checkResponse: Processing loop: 10

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:55 PM: debug :phone: :three:…callTasmota: hubaction: GET /cm?user=null&password=null&cmnd=STATUS%200 HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: 192.168.4.199:80

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:55 PM: debug :dash: :two:…callTasmota: Exiting

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:55 PM: debug :arrows_counterclockwise: :one:…sync: Sync Running…

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:55 PM: debug :+1: :one:…isSystemIdle: True - callTasmota() - Allowed

3719e69a-139c-4d7f-b493-6645d356a43a 11:30:55 PM: debug :arrows_counterclockwise: :zero:…sync: Starting Sync

I suspect the DNI is not correct. Try clicking on the DNI button and checking the logs.

@GaryMilne, I tried a freshly-flashed POW R2 device and it worked fine…until I set a DHCP reservation for it and changed the address in the settings of the SmartThings device.

When I click on the DNI button, the log looks fine:

5a852100-4b91-4abb-9faf-a08f91478119 7:16:27 PM: debug :running_man: :zero:…Action: DNI: C0A80486:0050 is correct. Not updated.

5a852100-4b91-4abb-9faf-a08f91478119 7:16:27 PM: debug :running_man: :one:…updateDeviceNetworkID: Settings are:192.168.4.134:80

There is something weird happening to both when syncing. If the relay is on, the once-per-minute sync process rapidly turns the relay off and then back on.

@GaryMilne, I just found that if I set the Module type in the Tasmota web inteface to POW instead of POW R2, it will sync successfully and not bounce the relay. However, at that setting in Tasmota, no power stats are provided by Tasmota.

I’m using Tasmota 8.1.0. Should I try downgrading?

@GaryMilne, downgrading to Tasmota 7.2.0 didn’t help. I did learn that settings are persistent in the device through the flashing process. Must be stored in separate NVRAM.

I also recreated my SmartThings device. No change. Relay still bounces during sync. Sync fails. No power stats are showing up.

I’m traveling and don’t have access for a few weeks. I suspect there is some difference in the format of the responses to the various commands and status messages. I think I was using version 7.02 on mine. BTW it is only a beta release so feel free to tinker with the code if you like.

@GaryMilne, two of my three POW R2s are working fine. One of them still exhibits the behaviour described above.

Try using an IP address that you have not used on any other devices and then update the device. It sounds like a problem with the DNI.

@GaryMilne, I have all three POW R2s working now. I did try a number of other IP addresses, but that didn’t help. I applied a webadmin password in the tasmota console of the misbehaving POW R2 and set the same in the SmartThings device. That didn’t work. Removed the password. Didn’t work. Reapplied the password. Bang! It works for some reason.

Thanks for your help!

@GaryMilne, webCoRE dashboard isn’t offering me DeviceStatus / OperatingState to compare. I seem to get everything else, such as PowerFactor, Voltage, Watts and LastDeviceStandby, but not DeviceStatus. I’m controlling 3 LCD TVs as end devices and currently using a Watts comparison to determine if the devices are On, but it would be nice to use your state instead.

I’m having same issue with sync failure. I’ve already moved the device to a new IP address that has never been used, but no change in behavior.

Any other recommendations / suggestions?

@Deano1, I’ve had this happen on a couple of devices a month or two apart. To resolve it, I’ve set a password on the device in its web interface. Then I’ve added the username “admin” and its password to the settings for the device in the SmartThings Classic app. Randomly a month or so later, the devices failed to sync, so I removed the password in the app, saved, attempted sync (failed), and then put the password back in, and it started to sync again.

Thanks for the info. I tried to change passwords like you said. The device is now working!!!

A couple of observations:

  1. I cannot execute commands very quick (not like Gary shows in the video). I must wait about 10 seconds between commands, else the second command is forgotten (not executed)

  2. I cannot open the device in the new SmartThings app (only the classic). I get a network error each time

@Deano1,

The tiles are as responsive for me as I see in Gary’s video. Have you looked at the log for errors? He has put in some pretty impressive debug logging.

Can’t help you there. I have the new app and play with it, but I don’t use it.

Thanks for the feedback.

I’m still getting errors (see below). IF there is any suggestions, I’d love to hear.