If the plug is a Tuya device, define a condition that triggers when the device switches on, and another that triggers when it switches off. On switch on, implement a logicblock that sets a Boolean variable “plug_on” to TRUE; on switch off, trigger a second logicblock that sets the same variable to FALSE. You can set variables via a webhook call (come on Apilio–implement setting them direct soon!)–look at the “how to update this variable” in the variable definition to copy the required code).
If you then create a further condition to test if plug_on is TRUE, you can act on this as required–if you only want this to action events within a certain time window, create another condition that defines this time window and only action events if both conditions are true.
I don’t have a tado system, but looking at the IFTTT documentation for this, you can trigger IFTTT events when the system goes into away mode or home mode:
tadoº Heating works better with IFTTT
Create two IFTTT applets, one triggered when you go into each mode, and in the THEN definitions set an Apilio Boolean variable “away_mode” to TRUE or FALSE. You can then define a condition in Apilio to test the status of this variable, and act accordingly.
The other way of dealing with the smart plug is also to act on device status switching from IFTTT rather than from Apilio, so if you can get an ON/OFF trigger from this device with IFTTT, you can define an applet for each of ON and OFF, and use the THEN action to set an Apilio Boolean variable TRUE or FALSE from there. This would have the advantage of not needing to use slightly obscure webhook calls, but depends on what IFTTT support you have for your plug,