Ross43
March 8, 2026, 10:04pm
1
Newbie here. I am having issues running an automation when a player is on 1st base. Will you kindly let me know what I’m doing wrong? I created this through Settings, Automations. Thank you, Ross
Thank you, Tom_I for helping me with formatting this appropriately.
- id: '1773002200412'
alias: Baseball - 09a 1st Base True testing!
description: ''
triggers:
- trigger: state
entity_id:
- sensor.sd_team_tracker
attribute: on_first
conditions:
- condition: state
entity_id: sensor.sd_team_tracker
state:
- 'true'
attribute: on_first
actions:
- action: number.set_value
data:
value: '1'
target:
entity_id:
- number.ha_sdp1stbase
continue_on_error: true
Ross43
March 8, 2026, 10:55pm
3
I appreciate your assistance. I have so far been unable to find “the </> button” nor “the editor toolbar.”
I assume the spacing isn’t an issue since it was created by using Settings, Automations. But, I could be wrong, of course.
Thank you again,
Ross
tom_l
March 8, 2026, 11:09pm
4
The toolbar is at the top of your post text box.
The </> button is sometimes under the cog icon on small displays.
You can also use the three backticks method as described in the link.
Unfortunately we cant see that because it is not formatted correctly for the forum, as described in the link.
Please edit your post and format it correctly.
The condition is messing you up most likely.
In this case the trigger should be enough I think.
Ross43
March 10, 2026, 4:09am
6
Thank you for your suggestion; however, I’ve tried it with and without quotes around “true” and neither worked.
That’s your quote, I didn’t write that…
I suggested remove all the condition code and see what happens.
Your condition is no different than the trigger, so not needed.
Ross43
March 10, 2026, 5:07am
8
I understand now. on_first returns either true or false. I’m trying to determine when it’s true. Thank you.
Ross43
March 17, 2026, 4:05am
9
For those interested, this code works.
Thanks,
Ross
- id: '1773286599975'
alias: z-Baseball - 09aa 1st Base - True - This might work - 14
description: ''
triggers:
- trigger: state
entity_id:
- sensor.sd_team_tracker
attribute: on_first
from:
- 'false'
to:
- 'true'
conditions: []
actions:
- action: number.set_value
data:
value: '1'
target:
entity_id:
- number.ha_sdp1stbase
continue_on_error: true
mode: single