REST Only Presence?

Hi,

I’m playing around with home assistant, I’m currently using OpenHAB for my HA needs, but am being tempted by Home Assistant.

I have my own presence detection which I cobbled together. Currently, I have a raspberry pi running a script with a bluetooth device connected which monitors iBeacons that me and my partner carry around on our keychains. Once my script has detected a presence change, it calls the OpenHAB REST API to mark an item as home or away. This currently works pretty well, however I have no idea how to implement this with home assistant.

What I need is a empty presence item that I can just manipulate via a third party script that calls HA’s rest endpoints. How do I achieve that with HA?

Thanks!

You might be able to cheat and use MQTT for that. Here’s a thread where someone details the correct MQTT info to send to HASS. They’re sending from Tasker, but you could send from wherever. And if you’re running the All-in-one install, MQTT is already up and running. You could hard-code your lon/lat values and treat that as a switch of sorts.

Hey,

Thanks, but you’re saying there’s no way to do it the way I want to? I know HA has an REST API that you can fire states to, but there’s no way of setting up an empty item? Implementing mqtt into my raspberry pi script seems overkill really. :frowning:

Surely there’s a way to do it? In openhab it’s trivial to set up an item with no data source and manipulate it manually.

Actually just saw https://home-assistant.io/components/device_tracker.locative/ looks promising, looks like it’ll be easy to just pretend to be the locative app

No - I’m not saying there’s no way to do it. I just offered up one way (which really only needs one properly-formatted POST). I’m sure someone else will chime in with ideas. Welcome to the community.