Pushbullet help

Hi I need some help to set up a automation in Pushbullet
I have this in configuration.yaml

#PushBullet Sensor
  - platform: pushbullet
    api_key: xxxx
    monitored_conditions:
      - body
      
notify:
#PushBullet Notify
  - name: pushBullet_notification
    platform: pushbullet
    api_key: xxxx
    

and this for automation

- id: test Water Leak
  alias: Kitchen Water Leak
  trigger:
    platform: state
    entity_id: binary_sensor.water_kitchen_sensor
    to: 'on'
  action:
    - service: switch.turn_on
      entity_id: switch.book
    - service: notify.pushbullet
      data:
        title: 'Kitchen Water Leak'
        target: 'device/mySmartphone'
        message: "Water Leak!!"

So, when there is a water leak I need to get a notification in my mobile

Light is opening but I get no message

in the log file I am getting the following error

"error from callback <bound method Listener.on_message of <Listener(Thread-7, initial daemon)>>: on_message() missing 1 required positional argument: 'message'"

if I test only the following code in dev tools/services it works I do receive the message

title: 'Kitchen Water Leak'
target: 'device/mySmartphone'
message: "Water Leak!!"

in your automation you are using “notify.pushbullet” but the name of your pushbullet notification service is “pushbullet_notification”.

so try this:

- id: test Water Leak
  alias: Kitchen Water Leak
  trigger:
    platform: state
    entity_id: binary_sensor.water_kitchen_sensor
    to: 'on'
  action:
    - service: switch.turn_on
      entity_id: switch.book
    - service: notify.pushbullet_notification
      data:
        title: 'Kitchen Water Leak'
        target: 'device/mySmartphone'
        message: "Water Leak!!"

That’s’ it!. I changed the notification name after several tries just in case it was wrong (it was pushbullet)
and forgot to change it in the automation.
Thanks

I add a google home message too. So the code now is the following. Now I am looking if possible to make the google message to repeat until 30 seconds until the sensor is in off state
Ideally ai would like to raise the voice of google home at 70%. Do you have any ideas how I could achive that?

- id: test Water Leak
  alias: Kitchen Water Leak
  trigger:
    platform: state
    entity_id: binary_sensor.water_kitchen_sensor
    to: 'on'
  action:
    - service: switch.turn_on
      entity_id: switch.book
    - service: notify.pushbullet_notification
      data:
        title: 'Kitchen Water Leak'
        #target: 'device/mySmartphone' #See Pushbullet integration for usage
        message: "Water Leak!!"
    - service: tts.google_translate_say
      entity_id: media_player.living_room_speaker
      data_template:
        message: "Water Leak"

I don’t know anything about Google Home. I use Amazon devices.

but I do a similar thing for my “garage door is open” automation.

here is how you can do it:

first create a timer:

kitchen_water_leak:
  name: 'Kitchen Water Leak Timer'
  duration: '00:00:30'

Then modify your automation:

- id: test Water Leak
  alias: Kitchen Water Leak
  trigger:
    - platform: state
      entity_id: binary_sensor.water_kitchen_sensor
      to: 'on'
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.kitchen_water_leak
  condition:
    condition: state
    entity_id: binary_sensor.water_kitchen_sensor
    state: 'on'
  action:
    - service: switch.turn_on
      entity_id: switch.book
    - service: notify.pushbullet_notification
      data:
        title: 'Kitchen Water Leak'
        #target: 'device/mySmartphone' #See Pushbullet integration for usage
        message: "Water Leak!!"
    - service: tts.google_translate_say
      entity_id: media_player.living_room_speaker
      data_template:
        message: "Water Leak"
    - service: timer.start
      entity_id: timer.kitchen_water_leak

Sorry for my ignorance, the timer goes to automation.yaml or somewhere else?

yes, it goes under the timer: section in your configuration.yaml.

timer:
  kitchen_water_leak:
    name: 'Kitchen Water Leak Timer'
    duration: '00:00:30'

No, It only say the message once, as the first automation

shoud the

- service: timer.start
      entity_id: timer.kitchen_water_leak

be placed in front of the

- service: tts.google_translate_say
      entity_id: media_player.living_room_speaker
      data_template:
        message: "Water Leak"

something like this?

- service: timer.start
      entity_id: timer.kitchen_water_leak
- service: tts.google_translate_say
      entity_id: media_player.living_room_speaker
      data_template:
        message: "Water Leak"

as far as I know it should work.

please post your automation and timer configs the way they are right now.

I don’t have any other timers
the timer and automation is your previous posts

yeah, I get that but can you please just humor me and post those configs again? I want to make sure there are no copy errors…or even errors on my part…

timer:
  kitchen_water_leak:
    name: 'Kitchen Water Leak Timer'
    duration: '00:00:05'
- id: test Water Leak2
  alias: Kitchen Water Leak2
  trigger:
    - platform: state
      entity_id: binary_sensor.water_kitchen_sensor
      to: 'on'
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.kitchen_water_leak
  condition:
    condition: state
    entity_id: binary_sensor.water_kitchen_sensor
    state: 'on'
  action:
    - service: switch.turn_on
      entity_id: switch.book
    - service: notify.pushbullet_notification
      data:
        title: 'Kitchen Water Leak'
        #target: 'device/mySmartphone' #See Pushbullet integration for usage
        message: "Water Leak!!"
    - service: tts.google_translate_say
      entity_id: media_player.living_room_speaker
      data_template:
        message: "Water Leak"
    - service: timer.start
      entity_id: timer.kitchen_water_leak

try increasing the timer value a bit.

maybe the announcement takes longer to complete than the 5 seconds you have the timer set for. I know if my echo’s are still talking when I trigger another announcement they will just ignore the second one.

Unfortunately it does not work

Sorry! I was testing the automation the wrong way. I was triggering it from the fronted. When I poured water on the sensor it worked. Again sorry and thanks for your help and your time!

Perhaps the Alert integration might be useful for this application.

Create an Alert that monitors the state of binary_sensor.water_kitchen_sensor. When the state changes to on, the Alert sends a notification every 30 seconds 1 minute (or whatever interval you desire). It offers other options you may find useful including the ability to acknowledge the alert notification.

1 Like

I completely forgot about that integration.

I set my notification system up a long time ago and i’ve just never revisited it. It was easy enough at the time to do it that way. And I thought there was some reason why I never used the alert integration in the beginning but I can’t remember what the reason was now.

Maybe I’ll look into switching it over some time.

Thanks for the reminder! :slightly_smiling_face:

it looks good but I am not really sure how to implement
does the following looks correct?

alert:
  kitchen_water_leak:
    name: Kitchen water Leak
    done_message: Water leak in Kitchen
    entity_id: input_boolean.kitchen_water_leak
    state: 'on'
    repeat: 30
    can_acknowledge: true
    skip_first: true
    notifiers:
      -  pushbullet_google home

- platform: group
  name: pushbullet_google home
  services:
    - service: notify.pushbullet_notification
      data:
        title: 'Kitchen Water Leak'
        #target: 'device/mySmartphone' 
        message: "Water Leak!!"
    - service: tts.google_translate_say
      entity_id: media_player.living_room_speaker
      data_template:
        message: "Water Leak"

I don’t as per example what to place in

target: !secret john_phone
- platform: group
  name: john_phone_sms
  services:
    - service: twilio_sms
      data:
        target: !secret john_phone

I am also not sure how to replace 30 (minutes) to seconds…