Automation not running at all once created. Is GUI reliable for creating automations?

I started using automation a few days ago and followed some tutorials and guides. I decided to try something simple using GUI, but when I save the automation, it doesn’t run at all. Here’s an example of me trying to get notified using mqtt thru my PC when my phone is unplugged.

I made the automation on GUI and got the YAML code:

alias: Low Battery Notification
description: ''
trigger:
  - type: not_plugged_in
    platform: device
    device_id: a6962bc39de4558fada74f92b295a321
    entity_id: binary_sensor.sm_s908u_is_charging
    domain: binary_sensor
condition: []
action:
  - service: mqtt.publish
    data:
      topic: iotlink/workgroup/my-pc-name/commands/notify
      payload: >-
        { "title": "This is a test", "message": "Test", "launchParams":
        "toast://open/http://www.google.com" }
mode: single

The result is that it doesn’t get triggered:

I tested the actions and they work great! It’s the trigger that for some reason is not responding.

Here is info about my current version of Home Assistant:

Home Assistant Core 2022.6.7

Home Assistant Supervisor 2022.05.3

Home Assistant OS 8.2

Is the GUI reliable for creating automation or will I need to edit the YAML?

Yes, automations created in the GUI are reliable.

How are you testing the function of the trigger?

Some users do experience issues using Device triggers. If you cannot get reliable triggering when you unplug and replug your device, and the sensor is working properly, try using a State trigger.

1 Like

That should work. Putting this in the GUI showed me a nice blue bar above the trigger that it works.
image
Each and every time i unplug or remove the phone from my wireless charger.

If it doesnt do that then you might want to check the app on the phone if the sensor is enabled.
If it it enabled, turning it off and on again might help. Worked for me when dealing with sensors not working after updates.

1 Like

Got it working! Thanks guys!