Script trigger not firing

I have a script to turn on and off my panel’s power brick. The problem I am having is the trigger does not seem to go off. Is there a way I can check the value of the entity and see what is happening?

alias: HA Panel Charger Off
description: ""
trigger:
  - type: battery_level
    platform: device
    device_id: 2301ff6a4ce20647b53c453f47d513a3
    entity_id: 810436c16f0426aa69ca472860587030
    domain: sensor
    above: 90
condition: []
action:
  - type: turn_off
    device_id: 6b6c9789c35592eb5591ceec241edd09
    entity_id: e7e533d46e47569cb300479ae06773e8
    domain: switch
mode: single

What I am curious about is what is being returned from the Battery Level trigger.

You can check the state of entities in the Developer tools > States tool, Entities setting page, their device page, or pressing “E” on the keyboard for the Entity Quick Menu…

Be aware that triggers require a change. If the battery state was already above 90 when the automation was set up, it will not trigger until the state drops below 90 then raises above 90.

AH OK will keep in mind about the needing a change. I will switch off the power and see if the trigger for turning it back on at 10% fires. So far not seen either of these two triggers fire.

It is possible to manually force a temporary state change for testing purposes. Go to Developer Tools > States, select the sensor, scroll to the top of the page. In the “State” input box enter the new value you want (in this case input a number below 90) then click the Set State button. You can repeat the process with a number above 90 or wait a bit until the sensor’s integration updates it.

The other thing I found is the device/entity the GUI trigger maker used is for: sensor.zx_105_battery_level. But I think I need to use the sensor: sensor.zx_105_battery.

I am unable to find the device_id and entity_id: for sensor.zx_105_battery

Just use a Numeric State trigger… Device triggers are a pain

platform: numeric_state
entity_id: sensor.zx_105_battery
above: 90

You are a life saver!!! So simple don’t use device, use numeric!! Thanks