Home Assistant has a number of integrations that do this very well - phones connected to Wi-Fi is the most commonly used. You can then use that to control other things (and make that sensor available externally).
No, there are no api calls like that. You would need to write a little script that did something like
x = wget https://emoncms.org/feed/value.json?id=1
if x > threshold
status = "occupied"
status = "vacant"
You will need to add some work to the wget, I can’t remember the options offhand, I used to do it alot but haven’t done it for a while so wouldn’t trust my memory. The response will probably need sanitising or formatting to a numeric value since it will be a (json) string that’s returned