[DEPRECATED] Kasa Plug, Switch, and Bulb integration

I realize my question is more loaded than what I wrote.

First, yes, I do mean reporting for the total energy usage for the day. I have about a dozen KP125/EP125s that I use for testing my app which does general energy monitoring. Having the polling so far a part adds delays during testing.

One of my hubs is still using the community app so I just updated the poling interval myself, but have a second hub running the built-in app. So, I suppose the request is only really pertinent if the change would get included in a hub update.

What about having the option to run in on the 5s? (5 min, 10, 15, etc.)?

I will look into it. One of several methods:

  • hard code to run every 5 minutes (1 minute?)
  • Create new preference if I can figure out how to code without users having to do a Save Preferences when updating (always causes confusion).

It will take a week or so to finish coding and testing of the change, baselining, adding to HPM, and then passing to Hubitat staff for inclusion. Time to update built-in after that is up to the staff.

1 Like

Community Integration Update 2.3.5-1 available. Optional (not required if no problems).

Changes:

  • Energy Monitor Devices: Added energyToday poll interval select of 1, 5, or 30 minutes.
  • All Devices: Added Manual IP and Port update in preferences (caution).

The update has been submitted to the staff for eventual inclusion at their discretion.

Code update to 2.3.5.1-1 is available and provides this function.

1 Like

Thanks boss!

So, I have an odd issue. Two kp125 plugs suddenly stopped working. One recovered after "messing with it" for a bit. The other has not.

If I use the test option from the app menu, it passes with the correct IP.

But, when issuing a command, the IP shows up as null.

If I manually set the IP from the device page, everything gets happy.

But as soon as I clear out the setting, we're back to null values in the logs.

Enter the IP address in the update IP address preference and run save preferences. I will look at today for a permanent fix (if I can replicate).

That's what I've done for a few that are "critical".

Do not clear out the setting. It will set the IP to NULL, which is the error you are getting.

I'm getting the NULL error on most of the devices without touching them. Was just illustrating that the error persists if I set it manually and then revert back.

I have not been able to duplicate yet.

I figured it out but I can't reproduce the problem. I realized this option was enabled:

I don't recall turning it on, but either way, it was. Note that the configs are the same as the automatically populated subnet info. I disabled the option and everything suddenly got happy. I tried to re-enable the setting to see if things broke again, but everything stayed happy. The other note-worthy item was the setting was staying on before, even when clicking "Done" to, presumably, re-initialize the app. After I turned it off once, I noted that the setting is automatically disabled when leaving the app page.

Maybe just a one-off problem.

1 Like

All of a sudden all my kasa devices today stopped updating. After playing around with it a bit, I think I've fixed some of them. It's hard to tell to be honest because I only use them for energy monitoring. But it seems like all the devices lost their IP settings even though the Kasa app still knows what it should be. I have a DHCP reserved address for all my devices that need it, so I know the IP on the router is correct. I can ping the devices from my computer.

But here's an example. I highlighted the KP115 the Dishwasher is on. When I open the device, here is what it shows

But yet, CommsError is somehow false.

image

When I scroll down and look at the data section it is missing a lot of stuff compared to another plug (One I think I've gotten working today).

As far as I know the only thing that has changed was an update that I downloaded through HPM fairly recently. That update also reset the energy polling interval of all my devices back to the default of 30 minutes, which hasn't happened from an update in a long time.

If I open the Kasa app and do the "Test devices" option, it correctly shows all the IPs and says passed for all the devices. I can't seem to get any of the data to re-populate.

Turn on debug logging for one of the devices and try issuing a command. Post the logs for the device.

1 Like

You can also go into the main app integration, and do a ping test from there as well as a comms test from there.

Also do devices work from the kasa app?

Did you try to set the IP address/port in the preferences section? I just tested this function and it worked as specified. If this works, make sure to set the device's ip address to STATIC in your router.

There were two changes in this version (see top post of this thread):

  • Added IP / Port entry into preferences with a default of the data value (at bottom of page).
    • Provide an alternative to running the app to set the IP / Port which was failing at times.
  • Added the preference "energy poll interval" at a user request
    • energy poll interval controls polling for attribute energy (total used today).
    • NOT the same as the original poll interval which was controlled by the command "setPollInterval". and is reflected in the state pollInterval.
      • setPollInterval controls polling for attribute power

I believe they're running into the same issue I had along with @garz. The devices just suddenly stop working and the preferences are blanked out for IP and port. Selecting the "scan devices" function in the app page will repopulate the preference fields. I'm going to leave debug logging turned on for one of them and see if I can catch it if it happens again.

Just for emphasis:

This, for most routers, will be referred to as a DHCP reservation/reserved IP.

To Dave's point. This wasn't an option before. It was statically set to 30 minute intervals. The regular polling (which was only for on/off state, power (other background stuff)) was the setting you're previously thinking of.

Did you try to set the IP address/port in the preferences section? I just tested this function and it worked as specified. If this works, make sure to set the device's ip address to STATIC in your router.

The preference of the device in HE? No I didn't. But something I did finally made it start working again, but I'm not sure what I did. I was just doing a lot of fiddling with the Kasa app in HE and I think it finally populated everything. Anything that is used for automation I configured to have a DHCP reserved address, so the IP hasn't changed.

I said energy when I should have said power. So I can set the energy poll level back to 30 minutes and just make sure pollInterval is 1 minute? The reason I thought I needed to change this is that pollInterval used to only poll state and there was a separate poll for power. I found this screenshot linked above. I have no idea when this changed though so it could have been this way a long time now.

image

You can set either one independently.

Hi @djgutheinz ,

Noticed something recently that I thought may be worth including, unless I have missed it :slight_smile: Also, not sure how many new requests you are taking, but again, thought I would at least ask.

I turn off the LED indicator light on some of my Kasa smart plugs (HS110's and KP115's) in the bedrooms when I am in Night mode, then turn them back on when I enter Day mode. Mostly a "because I can" thing, there are plenty of other indicator lights on other devices. Occasionally in the morning I use Evening mode rather than Day Mode, to have softer lighting as I am starting my day. I seem to have missed turning the LED indicator lights back on when transitioning to Evening mode. One of the plugs is for my Iron, so when it is on and I have used Evening mode in the morning, there is no light on the plug to say whether it is on or off.

Now this is completely my fault in the way I have setup my rules and chosen to use the drivers. But I do wonder whether it may be worth offering an option to have the light come back on when the switch is turned on? Maybe a Preference setting to enable this feature. That way if the switch is turned on you get a visual indication of this on the plug, regardless of any smarts that have been (poorly) setup. I also acknowledge I could do this myself using the same kinds of rules and commands I am using already, which I will likely do sometime soon, but I think a built-in feature like this would be a good addition.

Having the light turn back off again when the switch is turned off would be nice, but am wiling to forgo that if it would be too hard.

Thanks,
Simon