I’m utilizing Automator.App’s iPhone Push Notification Service. I’ve got all of that figured out, but what I’d like is a central place to store a string that contains the list of the keys (which are seperated by commas) which send notifcations via there service. This list basically tells the service what iPhones to send notifications to.
I have a handful of lua snippets that send messages based on what sensor is tripped such as “Your FRONT DOOR was opened”. What I’d like to do is have an easy place (through the UI) to configure this list and reference. I should also mention that I have a virtual switch implemented, so I was wondering if adding a property to the virtual switch might be an approach. I would also need to know how to create and read this value back in code.
Are you asking for a place to store the device identifiers to send push notifications to, so that you don’t have to update all your lua code whenever you get a new device? If so, you could re-use the variable the Automator.app plugin uses to store the device identifiers. Install the plugin (from your iphone/ipad) and configure the target devices using the UI. Then just use the variable from the automator.app device from your other lua snippets.
I then used the following code to grab the “list” of ids. You’ll have to modify the “AutomatorApp_deviceId” for whatever device ID your Automator.app is assigned.
--Store the Device Id of the Automator.App Plugin
local AutomatorApp_deviceId = 102
--Retrieve the list of Push Notification Devices from the Automator.App Plugin
--This is a part of the plug-ins "Devices" Variable. It requires the Automator.App
--Plugin to be installed. If multiple IDs, they will be separated by a comma.
local lul_notificationDevices = luup.variable_get("urn:automatorapp-com:serviceId:Push1", "Devices", AutomatorApp_deviceId)
UI4 process.
Create a new scene, In the command tab select the automator device, From the drop down list select Send Push Notification? You will then have then option to enter your message. You can then add triggers to the scene as you would with any other scene e.g. When door opened.
You can have as any scenes as you need or this may be embedded into scene that you have already created.
Please note: from you phone you can update the app or create multiple automator.app device. This may be useful if notification go to different iPhones. You could then either have one or more ids or the scene can reference multiple automator.app.
E.g. One automator.app called My iphone with you phones id. Another automator.app called xyz and that I’d. From the scene you select which phone you wish to send message too or multiple.
Otherwise one automator.app with multiple ids as you are aware off…
Best Home Automation shopping experience. Shop at Ezlo!