depending on the position of the on/off switch, could use a switchbot and SwitchBot gets an open API!