Pushover Notifications Driver [Slightly Enhanced]

Roger that. Much appreciated. Wasn't sure if the post indicating this driver being incorporated into Hubitat natively applied to this feature or not since it was a little older. I'll grab this community one! Thank you!

1 Like

I for the life of me can't get the speak notification to work. Is this a Samsung issue? Is there any known way to get it to work?

Sorry for the confusion... This driver will not make your phone "Speak", only a push notification.

The "speak()" command was originally added as it was the only way to pass a text string into the driver from some of the Hubitat apps back in 2018. Since then, pretty much all Hubitat apps support the 'deviceNotification()' command, and thus 'speak()' is no longer necessary. However, removing it might break some users setups, and thus it persists in the code.

1 Like

Ok thank you. I am using Autonotfication/tasker currently and am looking for a less battery intensive TTS and SMS vs the Autonotfication plug in. I've been able to find solutions for everything except the Autonotfication Query I use for TTS and SMS. Neither one of these have simple solutions lol.

Twilo may do what you want...sort of... It won't activate speech on your phone but will call you. I don't use it myself.

@guarddog13 My community Twilio or Plivo drivers support both SMS and voice capabilities. The stock Twilio driver is based on some early work of mine and doesn't provide voice capabilities. Both solutions are not that expensive but Plivo is a bit cheaper, less than $1 a month for a dedicated number and messaging.

1 Like

Thank you so much I'll look into these.

1 Like

I have created a Pushover device for notifications. However there is no "Hub Mesh enabled" button on the Device page.

Is it not possible to share Pushover devices via Hub Mesh?

Just create the exact same Pushover device on the second hub. Use the same key/credentials. It works great. No need to use Hub Mesh in this particular case.

4 Likes

Thanks @ogiewon :+1:

1 Like

Thanks for the work on this driver! Is there any way to get HSM to work with HTML-formatted URLs? Whenever I save the alert text with <A HREF=*** , it strips out everything inside the <>. It works fine on the test box on the device page.

Sounds like the HSM app is stripping it out. The driver is not removing it.

I assume your trying to add something like

[HTML]<a href="http://example.com/">word</a>

to the text of your HSM notification?

Exactly. I worked around this on the Telegram driver by using markdown instead of HTML. Could I do something similar? I need two links so I can't just use the supplemental URL.

I suppose maybe I could try modifying the driver to interpret some special characters that HSM doesn't choke on to my opening/closing HTML tags. I haven't really delved into the driver code.

Feel free, please. I gladly accept Pull Requests.

Ok, I'm trying to figure out the syntax. It seems like this should work to replace [open] with < but instead it's replacing all instances of each of the letters in open with <.

    if(message.contains("[open]")){
        message = message.replaceAll("[open]","<")

Wrote this a while back https://raw.githubusercontent.com/thebearmay/hubitat/main/libraries/bb2Html.groovy

Might have some code you can use.

1 Like

OK, I got it to work with the code below (replace instead of replaceAll). I put the following under the code in the driver for [HTML]. Let me know if you want me to submit anything to the project for this. I don't consider myself much of a dev so I haven't done that before but happy to do so if it might be helpful for others.

   if(message.contains("[open]")){
       message = message.replace("[open]","<")
    }
    
     if(message.contains("[close]")){
       message = message.replace("[close]",">")
    }
2 Likes

@Seattle - Thank you! I have added in your code as follows, as it seems like it should only apply if one is is using the [HTML] tag, correct? If not, please let me know and I can rearrange the code.

    if(message.contains("[HTML]")){ 
        html = "1"
        message = message.minus("[HTML]")
        if(message.contains("[OPEN]")){
            message = message.replace("[OPEN]","<")
        }
        if(message.contains("[CLOSE]")){
            message = message.replace("[CLOSE]",">")
        }
    }

Also, since all of the other tags are UPPERCASE, I opted to support "[OPEN]" and "[CLOSE]", instead of the lowercase 'open' and 'close' in your sample code.

Please let me know your thoughts. Once I hear back from you, I will update my GitHub repository.

1 Like

That's perfect--thanks!

1 Like