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.

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.

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.

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