I just updated my test pi to the new .89 component for the TP-link devices. In the previous setup I had been using a scan_interval for each of the two switches to poll the status every 3 seconds due to the frequency of use of these switches and some automations I have. With the new component I cannot use the scan_interval as a way to have HASSIO poll the status (I get errors), and these fricken switches dont get scanned but once every 30 seconds or so by default. Is there any other way I can get the system to scan them more frequently? These two switches get used frequently, and some automations use motion detection to turn them on and off in the middle of the night so they donāt wake people.
There is a TP link node for NodeRED and you are able to set the Poll interval in NodeRED, however a better option may be to feature request that āscan_intervalā be implemented in the new TP link platform
I tried this, and it did not work. I only want a single energy monitor outlet switch (TP-Link model HS-110) to poll fast. I have it connected to an old Bose sound system controlled with an IR blaster, and on/off is a toggle - so to tell if it is on or off I have implemented a sensor switch that bases itās state on the energy use of the bose sound system. But I donāt want to wait 30 seconds to figure out if it is on or not - so I want to poll it fast, and I cannot figure out how to do it in 0.89.1
Error is: Invalid config for [tplink]: [interval_seconds] is an invalid option for [tplink]. Check: tplink->tplink->switch->0->interval_seconds. (See /home/homeassistant/.homeassistant/configuration.yaml, line 426). Please check the docs at https://home-assistant.io/components/tplink/
Update: I was able to get the scan interval to 5 seconds using customize.
I tried both and config check did not complain, but the scan_interval:5 works fine with config (if I look at the switch card it shows a scan interval of 5)
Update 2: Config accepts it, and the switch card shows scan_interval is 5, but the actual scan interval is still slow (30 seconds). Same is true with interval_seconds: 5 specified. It shows up as an attribute in the switch card (in the web ui) but the scan interval remains at 30 seconds.
I perhaps misunderstood, I thought we were talking about the presence detection tp-link component, which is why I suggested that interval_seconds might be relevant.
My stable PI is running the previous release. I have a āTest piā that I test every new release on to see if it functions as I need it to, and to figure out how to get any breaking changes fixed. the term āhappy wife, happy lifeā prompted this lol.
I had an automation that checked the power usage of a switch every 3 seconds, and did something when over a certain usage. With this new component, that automation reacts much more slowly.
From @Bruce0ās testing it looks like this isnāt possible any more. Anyone else have any ideas? Does this need to be added as a feature request?
Inserting scan_interval and interval_seconds does not work (and oddly seems to cause my HS-110 to go offline too). However there is a solution for most of us:
Call the service homeassistant.update_entity , it does update the power usage immediately (the HS-110 does some internal averaging so it takes 2 to 3 seconds for the power use feedback to fall (although turn-on feedback seems immediate).
In comment referenced @ljmerza creates a scanning operation by running an automation every 5 seconds. But for me, I just updated the automation that required the data to do the homeassistant.update prior to trying to turn on the switch (if I was turning off I would insert a 3 second delay). So now I am not fast polling but the test of whether the bose system is on works fine so overall performance has improved with no fast polling.
You might find a template switch helpful. Using that switch (which is conditional based upon the result of the ācurrent_power_wā, you can then avoid polling. I just call the homeassistant.update before turning a switch on or off (Havent yet figured out how to build that into the template switch) which makes my automations read a lot simpler.
@Bruce0 could you elaborate a bit on āI just call the homeassistant.update before turning a switch on or offā ?
I am currently trying to have an automation whenever my record player (connected to the TP-Link plug) turns on (meaning when the plug registers current_power_w > 1.5). But currently the HA pulls every 30 seconds, and unless I create a running timer (every 2 seconds) I am not sure how else I could catch the ābefore turning the switch on-offā.
Key element here is that I want to turn the record player on/off, and not the plug
Hey I figured out a node red solution to this tp link problem that works for me. I have a poll state node, on my switch that is set to poll every 3 seconds it then goes to a [current state] node with domain: home assistant and the service update_entity: switch.tplink then a [RBE] Node then [switch] node then call service to a lamp on or off depending on the original state. it is not the best and i doubt polling is the best thing but its better than the 30 plus seconds i have to wait to get this thing to work originally
@ AlexKalopsia Apologies for the very long delay, I have been away. Here is an example, the first service assures that the status the switch is currently reporting is used.
iām super new to HA. my coding level is like a 4/10. iām trying to do a similar thing to OP, i have a switch, when i turn it on, i want a group of switches to come on, and then also a group of switches turn off when the switch is off.
i did it, no problem, but there is a 20-30 second delay which is just really annoying and confusing to guest who will turn the light on and off a few times thinking my system is broken.
my biggest question, is where am i typing this in. i know its a super noob question but iāve been at this for about 2 weeks and the documentation is very limited (mainly navigation of home assistant)
i added the add-on file editor, i typed in a similar line to this:
customize_glob:
switch.light_1:
scan_interval: 5
i get an error for project name. i guess iām just asking if anyone can link me or just really dumb down the basic starting point of where to and how to change my scan interval for my TP link switch.
iām a visual person and i havenāt seen a solid sketch to give me a road map. thanks
on the TP link side, 24 hs200s and 3 hs220s, about to be 3, 3 way switches as well. when I select on the panel on in the ha app, its almost instant. its when you manually toggle the switch, it takes up to 20-30 seconds to show on HA and to trigger the events. as soon as the events register on HA the automation happens. Iāve been reading and apparently the default scan for TP link is 30 seconds. on Smartthings, it was almost 5 min.
ultimately iām trying to get past the 3 automation limit in the tp link app and also control some off brand lights I have hung around the house.