I’m new to both the world of the Smart Home and also to Apilio and IFTTT but have many years programming experience.
I have a typical UK type Central Heating System with an Oil fired Boiler and Radiators in each room. I have recently purchased Tuya Thermostatic Radiator Valve Heads which I am currently controlling via the Smart Life App.
At present I am using a dumb Room Thermostat/ Programmer to control switching on and off the boiler but I would like to be able to control this from the combined status of the 7 valve heads.
The Smart Life app shows, Selected Temperature, Current Temperature and Percentage Valve Opening. Apilio appears to only give me the first two in addition to Child Lock and Mode of which I have no interest at present.
When shown on the Dashboard/Devices incidentally, these temperatures are inflated by a factor of 10 from their actual values.
In order to achieve my goal I either need to be able to access the Percentage Valve Opening or to be able to calculate the difference between the Selected Temperature and Current temperature of each valve and when all these equate to zero to operate a smart switch to turn the boiler off and when it does not equate to zero and the boiler is turned off, to turn it on again.
I would like to know if this is possible in Apilio or whether I need to look in other directions for a solution.
Due to the nature of Smart Life and how manufacturers have coded their products it can become difficult for companies like Apilio to display all functionality from Smart life correctly so purchasing products can be hit an miss for completability, which hopefully will change with the new standard matter coming out next year. In the mean time all is not lost as @Anna says here New in Apilio: now with more Tuya devices supported!
Now Smart Life are working closely with Home Assistant compatibility issues will improve.
I’m sure if you use the web app and submit a request the team will take a look in case it is an easy fix @pebneter
Which Tuya Thermostat radiator valve did you go for?
As @Drivingforce mentioned correctly, we can only work with what Tuya provides through the public API.
In your case, apparently not all status data is shared via API
To implement your workaround, you will need a feature that is not yet implemented but one of the next improvements we are tackling. Currently you can compare Tuya data only with static values - so no way to compare the two temperatures coming from the device for now.
The scaling of the numbers is also on the very short list, so you’d see a nice value display.
To summarise: You might be able to implement your use case in a couple of weeks with Apilio, but we are not there yet.
It has been indicated that Tuya do not make the Valve Status available in the API but…
I believe I have found a workaround for for the time being which will enable me to use Apilio as the core of my automation now and in the future.
In my initial statement I said that the value of the Child Lock status was of no concern to me. I have found that in a Smart Life Automation that I can test the value of Valve Status for being either 0 (fully closed) or greater than zero (partially or fully open) and setting the Child Lock on the valve or releasing it accordingly. A Condition in Apilio Web App then tests the Child Lock status for all valves in a simple AND condition, the positive action for which, is to turn the boiler off and the negative is to turn the boiler on.
I have tested this using a lamp connected to my smart switch and it appears to work smoothly.
Well here is my latest situation and it doesn’t appear to be too good.
My solution worked perfectly well in early Autumn, whilst we were just wanting to get some heat into our lounge in the early evenings. The room would get to set temperature and when the valve status was 50% or less, Tuya set the Child Lock and Apilio told Tuya to Turn the boiler off.
But…
When I had my lounge at its comfortable temperature and decided I wanted to heat the bathroom up a little we hit the snag. The lounge valve is 50% open but the boiler is off so it isn’t receiving any new heat. The bathroom radiator wants heat so it turns the boiler on again and the lounge radiator receives some of tthat new heat too and starts to heat the room up further…
because the valve manufacturers decided to only fully close the valve once the room temperature exceeded set temperature by 2° C
I have asked the supplier to accept return of the valves. I don’t consider a programmed in overshoot of this amount to be acceptable, even dumb TRV’s would give better temperature control but I’m looking to reduce energy usage and to not unnecessarily heat unused areas. So I’m wondering if the REST API is my answer.
I’m familiar with Processing which is a simplified form of Java and can utilise Java libraries so I presume I could use REST API from this environment. If I did this will I be able to access each of the 4 values that Apilio makes available for each of the valves on the Devices Dashboard - Set Temperature, Current Temperature, Child Lock and Mode - and will I be able to set the three of those which can be set from the Smart Life App.
With that power and flexibility I could control the valves from my application by reducing the set temperature by 3 degrees on valves which I want to close and monitoring the room temperature of those valves in my own app to restore them to there original value once heat is rquired by that radiator again. If whilst I have the valve at this level of control its own Set Temperature is changed from the Smart Life App or from its own internal schedule, I can relinquish control until the next event.
I suggest that you sign up for the Tuya Cloud Development services (it is free) to see what would be involved. Accessing Tuya devices is not a case of using a simple API call–you need to generate a time-limited security code that is passed with the call and that is not easy. I certainly don’t see how you could do it within Apilio or IFTTT–you could do it in a full JavaScript environment that supports AJAX and so has access to XMLHttpRequest, but even IFTTT scripts don’t provide that.
How about a simpler solution that you could do in Apilio? If you can read the current temperature and the set temperature, have a condition test for current temp being >= set temp, and if so have a logicblock reduce the set temperature by 2 or 3 degrees and also add a call that is delayed by (I’m guessing here) 15 min to then restore the original set temp value. This way you should not get the overheating problem, and after the delay you again carry on heating until once again you are over the set temperature, and the process repeats. Whether the correct delay should be 15 min (or 5 min?), and the set temperature reduction is 2 or 3 degrees, is something you could experiment with.
I did and found it difficult to navigate my way around - I think too much terminology and acronyms that I don’t recognise or understand
I think I looked at this possibility a few weeks ago and established that Apilio can only compare a device status with a constant value. It is not possible to compare one status against that of another.
I’m not sure what your device is returning, but if you can read the value into a numeric variable, then set your required temperature up in another numeric variable, you can set up a condition to compare these values and trigger a logicblock accordingly.