Automations with Shelly Button 1 to notify battery low

I have a Shelly Button 1 built into HA with MQTT.
I would like the button to notify Home Assistant (via simple notification) when the battery is almost empty so that we can provide it in time.

I tried with this simple automation:

  • id: ‘889895656587455’
    alias: Living Room Button Battery Status Notification
    description: ‘’
    trigger:
  • platform: numeric_state
    entity_id: sensor.batteria_bottone_lotto
    above: 5
    condition: []
    action:
  • service: persistent_notification.create
    date:
    title: Living Room Button Battery Discharged
    message: ‘The Battery Level is: {{states (“sensor.batteria_bottone_salotto”)}}%’
    mode: single

In theory it should warn me when the button reaches 5%, but it is not so, set to 5% before the button was at about 60% it did not correctly indicate anything, since it went down to 59% it continues to warn me about the battery status, and I can’t understand why, can some kind soul help me? :smiley:

Bye thank you
Micky

Nope. That would be this trigger:

trigger:
  platform: numeric_state
  entity_id: sensor.batteria_bottone_lotto
  below: 6

You probably want a higher value than that. It may not work at all under 20% or so.

Also please have a read of point 11 here.

Hi Tom, thank’s for the support.

I modify the automation like this:

Do you think it can go like this? I’m waiting to see what happens when the button goes down to 49%.
And in the meantime, thanks for the suggestions.

Hello

Yes that should trigger when the battery level falls below 48% (i.e. to 48%).

You can test this in the Developer tools States menu. You can set the value of sensor.batteria_bottone_lotto to 48 or below and the automation should trigger.