Input_boolean that always sends state

I have a zxt-120 which I am using for my split AC system.

I like to control it with Alexa. “Alexa turn on Split”, “Alexa turn off Split”

So I create an input_boolean.Split and automate On to Set mode Cool and Off to set mode Off.

It works fine. The problem is when I turn on or off the unit with the remote directly. Now the split is on one state and the input_boolean is in another.

I had the same issue when I used to control these on SmartThings so I wrote a “Stateless Switch” device that would ignore it’s current state and always issue a change of state trigger.

So I researched “home assistant stateless input_boolean” and found instructions to set the following in customizations.yaml

# Stateless switch
input_boolean.split:
  assumed_state: true

This created two buttons On and Off instead of the toggle switch in the UI.

The problem is that this doesn’t really make the switch stateless. Once you turn off the boolean, if you turn it off again it doesn’t trigger any action.

Is there a way to fix this or some other component I should be using?

The only solution I can come up with is rather complicated and makes the voice commands much harder to remember which my Wife will hate.
This solution involves two input_boolean one for On and one for Off. With automations that switch them to an Off state whenever they are turned on. So I would have
input_boolean.split_on
input_boolean.split_off
This would work, it looks weird/ugly in the UI and the voice commands would be annoying.
“Alexa, turn on split on” to turn on the split ac
“Alexa, turn off split off” to turn off the split ac (I would have to reverse the automation toggle for this one so it gets turned on whenever it is turned off)

I am hoping there is a better solution.

You could forget the input_boolean and automation and use two scripts instead. One to turn the split system on and one to turn it off.

Or if you have a change of state command (how did you do this with SmartThings?) , just write one script. e.g. “Alexa, toggle the split”.

I don’t understand. Kinda new here so need more help. How would a script be detected by alexa? Don’t I need a switch for alexa discovery?

On SmartThings you have to write when to issue a change of state in the device handler. So I took the normal virtual switch device handler and altered the code to not check current state before issuing a change of state command. I have no idea how to do that in HA (not yet anyway).