Can't get a simple notification to work, help?

Has the level changed at all since you put in the notification? The notification will only go out when the app receives an event, meaning an update to the battery level.

The battery level is still below the threshold. The car is charging now. I can raise the threshold so it's easier to test.

Can you show the edit device page for the device?

Sure can,

(just modified the VIN to hide that, but this is what I see from the edit device page)

Do you have a link to the driver you are using? I am suspecting that the battery level is being sent a string and not a number. That's why the notification app can't read it correctly.

App and driver I got from this post.

Try this....within the driver you will see these lines:

if (data.chargeState) {
        	sendEvent(name: "battery", value: data.chargeState.battery)

try changing it to this:

if (data.chargeState) {
            def batLevel = data.chargeState.battery.toInteger()
        	sendEvent(name: "battery", value: batLevel)

Give that a try and see what it does. I don't have a Tesla to try this with so you'll have to try it for me, unless you want to send me your Tesla. :wink:

1 Like

Thanks, I gave that a try and will see what happens. Going to drive the car in a few hours so will set the notification to be lower than whatever state of charge I have to see if I can get it to trigger and fire a notification.

Oh....one thing you might want to add also:

sendEvent(name: "battery", value: batLevel, unit: "%")

Don't know if that will make a difference but it might. Plus it will look a lot nicer.

2 Likes

Did this as well.
Car is at 51%, notification set for 50% to alert me and about to go for a drive.

image

Didn't work :frowning:

image

I got a notification, by the way.
on an Android with the Hubitat App installed. What if you try with a different device, a temp sensor or IR detector maybe?
Do you get any notifications to your phone from other rules?

My rule in the default app do not have the "Pushover" text there. What is that?

RogerThat

Appreciate you testing. It appears to be something with this device then, maybe as @Ryan780 pointed out the battery level wasn't reported correctly.
I have no notifications setup, but will setup a few others to try them out.
Pushover is another app that hubitat supports for push notifications.

edit just set up a simple notifier for Front door and it works when the door is unlocked and locked. Seems something with this device is the issue then.

You didn't add the percent as the units though, did you? No one has access to the Notification App, so, someone one staff would have to see why this isn't notifying. You're not receiving any errors in your logs at all?

I did update the units part also (this is taken from the driver code)

I don't see anything in the logs for the Notifier App, when I go into my Front Door lock that I setup notifications with, I don't see the notifications mentioned in the log there.

edit just did the Test notification on my phone via the edit device and that worked, and the logs do not show the notification being pushed to my phone. Seems like notifications aren't logged?

That's not what I asked. If there was something that was causing an error, that would have been logged. You can't turn that part off. And that's a good thing. Other activity will be logged if you turn on the logging either in the driver or in the app. I don't know if you can turn on logging from the notifier app but if you can, that would be helpful.

Can you please show the app's properties page? (The cog wheel). Because your previous one didn't have any event subscriptions which means it won't do anything.

Appreciate your help on this.

Still no Event subscriptions for the Charge Tesla notification (I can post a screenshot if you like)

Event Subscriptions
No Event Subscriptions are set

When I go into the settings for a different, I see Event Subscriptions for that.

Does it still have the schedule job at the bottom?

Please do.

Yeah, it thinks it's notifying you already. That's why it's running that task at the bottom to notify you every minute. I would try deleting the app and rebuilding it. Something got screwed up at some point while you were editing it.

Download the Hubitat app