PLEG conditions checking if charger drawing less than 1W for more than 10 mins

Hi guys,

I’m really struggling with some logic, and unfortunately my plug in adaptor, since the latest firmware, doesn’t have a trigger available to detect the power, so having to use device properties.

So basically, what I’m trying to detect, is if my tablet_charger (ptblt_watts Tablet Charger[5]) is using less than 1W power, in which case, all phones, tablets and anything else plugged in, is fully charged.

Device Properties:
ptblt_watts Tablet Charger[5]
pTablet_Charger Charge Tablets[116] virtual switch to override

tBattery_Charger_On = Tablet Charger is turned on

cTblt_Watts: (condition to replace missing trigger)

(tBattery_Charger_on and (cTblt_Watts; NOW>00:10:00)) and !cBattery_Charger_StayOn and (tBattery_Charger_On; NOW>00:05:00)

pTablet_Charger or (tBattery_Charger_On and tBattery_Charger_On;tBattery_Charger_off;tBattery_Charger_On<00:00:30))

To test, I’ve created some smaller conditions:

cCharger_Time_On: (check if charger has been on for more than 10 mins)
(tBattery_Charger_On; NOW>00:05:00)

cTablet_Charger_Test: (check if watts less than1 for more than 10 mins
(cTblt_Watts; NOW>00:10:00)

Currently :
cTblt_Watts = false
cCharger_Time_On = true
cTablet_Charger_Test = true

Not sure how this last conditon can be true, based on cTblt_Watts being false. Would anyone have any ideas? It’s causing my switch to turn on and off rapidly!

TonyChargers[118]- (16.0 KB)

A sequence expression “(cTblt_Watts; NOW>00:10:00)” does not care about the current state of the condition cTblt_Watts - just the timestamps associated. You are currently indicating if it was last < 1 WATTS more than 10 minutes ago. If you want to know it is < 1 WATTS NOW, AND that it went < 1 WATTS more than 10 minutes ago, that would be “cTblt_Watts AND (cTblt_Watts; NOW>00:10:00)”.

Your PLEG is pretty complex, and you have appear to have 12 (!) different actions that would either turn on or turn off “Tablet Charger[5]”, so it is going to be hard to troubleshoot.

Best Home Automation shopping experience. Shop at getvera!

© 2021 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules