RE: Inside temp lower then outside temp set lights to green

I have already invested in Ambient Weather WS-8482 weather station and over half a dozen of their TX-3110B Thermo-Hygrometer sensors. Have been using them for a couple years with IFTTT to provide various alerts (such as when humidity in the basement gets too high or freezer gets too warm). As well, I have a number of Smart Life compatible smart outlets that I have been using for a while successfully with the Smart Life app, including timers. I even used the two together with IFTTT for some very simple logic to turn on and off AC and dehumidifier. What I would really like to do in one area is just what was described above - when the temperature in our vestibule gets hotter than the temperature outside by X degrees, then turn on the smart outlet with the window fan plugged in it. Then when the temperature cools to within Y degrees of outside temperature, turn the outlet/fan off. As far as I can tell, that is not possible with Apilio and IFTTT. I could buy a smart home hub, like the HomeSeer HomeTroller, but they range from $140 to $1,100 and more importantly, I think would be a lot of work to figure out and program. I was hoping there was a simple way using IFTTT and Apilio. Please let me know if Iā€™m missing something.
Thanks!

1 Like

Hi @mcbeath ,
great question and currently maybe possible with some creativity - Iā€™ll have to think about it! :slightly_smiling_face:
We are working on improving the possibilities of numeric condition and combinations, so I hope we can provide a straight forward solution soon.
Do you mind if I make your question public? Maybe some other users have an idea!

1 Like

One path I started going down was to try and get IFTTT to update two temperature variables in Apilio on a regular basis. I created a variable in Apilio called VestibuleTemperature. My intention was to have it updated using the value from the Ambient Weather thermometer we have in the vestibule. The value of that sensor is currently visible/usable within IFTTT using the Ambient Weather service in IFTTT. I started creating an IFTTT applet using the Date & Time trigger, ā€œEvery hour atā€, which triggers once an hour. When that trigger happens, for the ā€œthenā€ action, I chose the Apilio action ā€œUpdate a numeric variable in Apilioā€. I was able to see and select my numeric variable from Apilio called VestibuleTemperature for the field called ā€œWhich Apilio numeric variable do you want to update?ā€. However, in the field called ā€œNew value for this numeric variableā€, there is only a single ingredient available and that is {{CheckTime}}. I could not figure out how to get the sensor reading from the Ambient Weather service as a new value into that variable.

Thanks for posting @mcbeath, a super-good example of how mathematical operations on numeric veriables could really help the Apilio community!

This is a real difficult one to implement because - as @DanT mentioned already - we are currently missing some more advanced options to do mathematical magic.
I think you could achieve it with lots of creativity, logicblocks and IFTTT applets. But Iā€™m not sure if you want to go that route. Let me know if you are interested :slightly_smiling_face:

I like to give it a try, it you can suggest where to start.

In addition to what I described above, I created an Apilio logic block that runs every 5 minutes, based on a cron expression. I started building an applet in IFTTT that receives that event as a trigger. FIrst, just to see if the timer is working, I simply had it update a counter in Apilio. That works fine ā€“ it runs every 5 minutes and the counter is now up to 17 (the number of times it has run so far).

The problem is, Ambient Weather is not on the list of services for the ā€˜thenā€™ action for that applet. Apilio is, but if I select ā€œupdate a numeric variable in Apilioā€ as the action, there is no ingredient on the list that lets me retrieve the temperature from Ambient Weather. So another dead end.

If you have some ideas for me to try, please let me know. I was a programmer (a couple decades ago), so am not afraid to do some simple programming or script writing ā€¦ but not interested in spending days learning a complex system and debugging a bunch of code.
thanks!

1 Like

Ok, letā€™s go.
Before we start rest assured that we have plans to provided better numeric comparison options and ways to set variable directly from Apilio, so that the following workaround wonā€™t be necessary anymore!

  • I assume that you manage to save the (almost) current temperature in Apilio. e.g. in temp_outside, temp_inside.
  • Create a third variable that will hold the temp_difference
  • Next, you create a Logicblock ā€œset_temp_differenceā€ that runs at a certain interval (you can tweak this later) triggered by a Apilio time event (create one under ā€œConditionsā€). i.e. you can use a cron expression to run it every 15 minutes (ā€œ15 * * * *ā€).
  • The purpose of the Logicblock is to trigger two IFTTT Applets: The first one shall set the value of ā€œtemp_differenceā€ to temp_inside. The second one (delay it a bit, maybe 5 seconds) shall subtract the temp_outside from temp_difference
  • With this, you should get the temperature difference in a variable!

Once this works, it should be quite straight forward to define conditions for temp_difference > 0 etc. and control the smart plugs. Let us know if it works and if you need more assistance!

Iā€™m actually having trouble with the very first step in your list. I have not been able to find a way to get the variable in Apilio updated with the current temperature on a regular basis (like every 5 or 15 minutes). I can trigger an applet on a regular basis using Date & Time or an Apilio event, but in either of those cases, the temperature from the Ambient Weather device is not available as a value (ingredient) to update the Apilio variable. If I use Ambient Weather as the trigger, then the temperature value is available to update the Apilio variable, but Ambient Weather has no way to trigger on a regular basis - it only triggers if the temperature goes above or below a specific threshold value you provide in the applet, and so then it only triggers once. So, Iā€™m kind of stuck unless you know of a way to regularly update the values in the Apilio variables from the Ambient Weather device.
Thanks.

1 Like

Oh dear, that is a shame. I was not aware that this was the limiting factor - but unfortunately thatā€™s common practice who IFTTT integrations deal with temperature sensors (there are a some exceptions though!).
In this case, the only workaround involving IFTTT is to create many applets for ā€œeveryā€ temperature in the excepted range (or maybe for all full and half degrees would be enough?) :unamused:
I also donā€™t see a way to put IFTTTs query feature to work, because it only works with the history of threshold alerts.
Ambient Weather seems to have a nice API, but we donā€™t have a direct integration with them unfortunately.

1 Like

OK, thanks. I had thought of making an applet for every degree of increase or decrease throughout the range, as you suggested. If I want it to work between 65 and 100 degrees, thatā€™s 35 applets for each direction (up and down), i.e. 70 applets per sensor , or 140 applets in total (for indoor and outdoor temperature sensors). Seemed a bit brute force. Plus I couldnā€™t yet find a way to duplicate an IFTTT applet - you have to create each one from scratch ā€¦ not that hard, but still time consuming. Iā€™m also wondering if Ambient weather has any limit on the max. number of triggers allowed per device or in total.
Anyway thanks for your input. At least now I know my options using IFTTT and Apilio. Maybe Iā€™ll reach out to the Ambient Weather folks as well to see if they have any different ideas.

1 Like

If you contact Ambient Weather, you can ask if thereā€™s any way to send data to a web hook (How to use webhooks to update variables and trigger logicblocks in Apilio) or to a REST API (REST API Documentation).
I did a quick research but did not find anything that indicated that it is possible without 3rd party tools.

1 Like