Can apps communicate with each other?
I have a PV system and there is a data logger there, which provides certain values about the charging and discharging status and battery voltage, etc.
I also have a Wi-Fi circuit breaker that I can turn on and off using an app. Now my question: Can I turn the circuit breaker on and off based on certain data (battery status)? I read something about an API (Application Programming Interface) that both app manufacturers have to provide. But is that even possible with iOS apps? I'm sure there's a crack here who can answer this specific question for me…
Why should you communicate between the apps, and not instead directly with the PV system and the backup machine (or their cloud APIs if it must be)?
Of course, you need to know how their APIs look, but app-to-app seems to me unnecessarily complicated and probably not intended. Whether iOS or Android or anything else.
It is about switching on the automatic fuse when the battery has a specific voltage or the modules have a specific current. The data logger gives out these data, so I thought you can depend on it… was probably a dream
Of course, but both apps must be prepared accordingly.
One of the two apps has to offer an API that needs to be used by the other app.
Or there is an API for the PV system, then you can use it if the Datalogger app does not offer an API.
And of course, this is also possible with iOS. For example, each website is a rudimentary HTTP API that returns the HTML code on port 80 and GET method. Your browser uses this API and then displays the HTML.
In the best case, there is an REST API (a paradigm for HTTP APIs), for that there are massive tools that make work easier and complicated it is also not – naturally depending on the API. Maybe there is even a swagger definition, then you can generate a part of the code and have a clear view of the API.
But if both app developers haven’t already developed this, it won’t work without more advanced programming skills.
Oha… that sounds really complicated. Unfortunately, I only found one in the browser from the two apps and looked at the source code, there you can see what data is being tapped, but I’m not so much in it that I need to look exactly… it’s definitely .js files I think they will be retrieved. However, the second app (SmartLife) is only available as an app. Too bad it is both not running on the same platform that would make it mega simpler. Like a PLC programming… WENN AND OR…. Simple. But that doesn’t seem to be the case at all here 😳
You won’t even find the API in the browser like this, because you already need to know what path you’re getting from it, that should have been documented somewhere, if there is. Well, except they don’t want you to use this, then not 😉
Of course, you can also analyse the HTML and dig the data out, but this will be pretty quickly messy and with every update you have to control it all.
Depending on how much pain the project is worth, you can do this, of course, but I would look for an API, if necessary ask for support 😀
PS:
If you have an API, the tool will help Postman.
But that only brings you something if you know what you can/must do.
If you’re using iOS, it’s probably not going to work like that for developers. If there is little interest in an API, which is likely to be the case due to the small number of iOS developers, a manufacturer will not make the effort to offer external interfaces.