Help with a simple automation

Hi, I have an environment with an ISY994i that has polyglot enabled for my Logitech Harmony devices. Everything is working great and I have it integrated with Home Assistant. I am running HA on an Intel-NUC using the image that was provided in the ‘getting started’ section. I added a switchbot device and it is showing up in the dashboard just fine.

Here is where I am getting confused, what I’d like to do is when my ‘BeastPC’ activity on Harmony is turned on, I’d like the switchbot to activate and press the button on my PC to turn it on. I verified that when I press the switchbot on/off buttons on the HA dashboard, it actually does what I need it to. I created a new automation and have it set to trigger when the state of the BeastPC activity turns from 0 to 1 (this tells it that the activity is turned on);

entity_id: sensor.beast_pc
from: '0'
platform: state
to: '1'

Then Action (This is where it’s not working)

condition: state
entity_id: switch.switchbot_pc
state: 'On'

I’m wondering if there should be a different state word? Or does it just not do it if it thinks the device is already on? The thing with the switchbot is that it’s just a toggle, you click it and in activates a little ‘arm’ that is used to press buttons. Any help or suggestions on how this should be set up is greatly appreciated, thank you.

Change it to:

state: 'on'

If you want to know what is the correct spelling of a state, go to Developer Tools > States, find the entity you wish to use, in this case you want to find switch.switchbot_pc, then look at its State. For switches, the states are on and off.

1 Like

Thanks! That helped me look at that area and this ‘toggle’ worked for me;

data: {}
entity_id: switch.switchbot_pc
service: switch.toggle

Works perfect now! Thank you again

1 Like

Please mark it solved with the button at the bottom of the post that helped.