Coding help for new HE user

I’m transitioning from SmartThings to Hubitat (HE) and I have a few coding questions. I haven’t received my HE yet but what to be prepared. In ST, I wrote all my own custom apps (SmartApps). I didn’t use WebCore. I want to migrate to HE with my custom apps.

My first question is around presence detections. In ST I used my wife’s and my smartphones to detect presence. I understand in HE, I need to use Life360. I need help in how you write this app code. That is, what is the code? Do I need a special handler (I think HE calls them Drivers)?

Secondly, in ST I sent notifications and text messages in my apps. I used code like sendNotification(“my message”, [method: "both", phone: "xxxxxxxxxx"]) or sendPush (“my message”). I understand this is not available in HE but there is something called pushover (not sure what that is). Again, how to I use and code this into my custom app?

Thanks for any help.

Welcome to Hubitat!

Presence detection basically works the same in Hubitat as it does in ST. You simply allow the user of the App to select a presence senor from an INPUT statement. Then you subscribe to its events. To be honest, there is probably no code you need to change to use any of the various Presence solutions in Hubitat. They all eventually end up being a Device that supports the Presence Capability, with the exact same attributes and events that ST uses.

This one may be slightly different, but still very simple. When you create a Pushover Device in Hubitat, it supports the Notifications Capability. So, your app needs an INPUT statement to allow the user to select the correct device. Then you simply use that device to call a command of the Pushover device to send a push notification.

For example:

        input "notificationDevice", "capability.notification", multiple: false, required: false

and

        notificationDevice.deviceNotification("Here is the message!")

For details of all of the Device Capabilties in Hubitat, check out the documentation

https://docs.hubitat.com/index.php?title=Driver_Capability_List

1 Like

Thank you. I'll give it a try once I get my hub.

1 Like