Change state when Android phone is placed on a charger

Hey guys,

When I placed my Android phone on charge I want to be able to save that state and use it for automation. I can use IFTT then notify Home Assistant when my phone goes onto charge… but what does the setup look like from Home Assistant’s point of view?

I don’t use the internet for my automations, so I use Llama to detect the connection of the phone and run an http shortcut but the net result should be the same - I use the api to set the state of an input_select defined in the configuration like

input_select:
  in_bed:
    name: "In Bed"
    options:
      - InBed
      - Up

I use Tasker & MQTT Client on my phone.
In HA the sensor is`

    - platform: mqtt
      name: "AP Charging?"
      state_topic: "phone/APcharging"`