#Help with reading text as state

1 messages · Page 1 of 1 (latest)

verbal rain
#

alias: UPS Notification Power Down
description: ""
trigger:

  • platform: state
    entity_id:
    • sensor.ups_power_source
      to: Battery
      from: AC Power
      condition: []
      action:
  • service: notify.telegrambotgroup
    data:
    message: Power Perenhuisje Down
    title: UPS Power Status
    mode: single

I have a scraper who is scraping the webpage of my ups . Its an old dell network card so smtp and mail server and crap is not working. So i want to get notified when the scraper i going from the word AC Power to Battery . Unfortunately if i do it like this it wont work . If i tell to notify me on change state null it works. But then i dont know if its back on or off the power . I have been searching with templating but i dont understand it . I can't find anything who is determing a on or off state based on these 2 word the scraper spits out . 🙏🏻

haughty tinsel
#

the state trigger should work as long as you specify the correct state (including capitalization, spaces, punctuation, etc.)

#

go to developer tools -> states, and search for the entity sensor.ups_power_source and see what its exact state is. Check the history to see what previous states have been. Also check the history to see if there is any other state it transitions through (for example "Battery" -> "Unknown" -> "AC Power")

verbal rain
#

@haughty tinsel i see no transition from ac power to Battery by unknown

haughty tinsel
verbal rain
#

State in developer tools is also AC Power , when i unplug power it says Battery

verbal rain
#

Strange thing is if i change the state in dev tools . The automation works . And if i unplug the power fysical . The status changes but no notification . In the automation . I said . If state change to Battery send telegram . And another automation if state changes to AC Power send telegram