I am writing a connected home device (alarm system) which can receive events/messages from a mobile device (e.g. a message to dismiss an alarm). Example of a scenario (mobile device is an iphone for the sake of the example):
- Connected device at home sounds alarm and notifies the iphone (using iOS push notifications, not firebase)
- iphone user brings up the app, and clicks "dismiss"
- connected device gets "dismiss" message and stops the alarm
I was thinking about using firebase's live database for this interaction, so the iphone app would set a db field, and the home device (which runs python) would subscribe to this field and see that it has been set.
The problem is that this is not a very clean implementation, as I would need the home device to turn off the dismiss field after it has received it, so that subsequent dismiss event can be recognized.
Essentially I am implementing messaging on top of a live database.
Is there a cleaner way to do this in firebase? If not, is this a reasonable implementation? Are there alternatives to firebase that take care of such a scenario?
What I really need is a web-based event-broker as-a-service...