# I need help with making a rule using astro

**URL:** <https://community.openhab.org/t/i-need-help-with-making-a-rule-using-astro/28716>\
**Category:** Scripts & Rules\
**Created:** [May 20, 2017, 9:02pm UTC](https://community.openhab.org/t/i-need-help-with-making-a-rule-using-astro/28716 "2017-05-20T21:02:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![sihui](https://community.openhab.org/user_avatar/community.openhab.org/sihui/32/55674_2.png) [@sihui](https://community.openhab.org/u/sihui)\
**Post date:** [May 21, 2017, 10:08am UTC](https://community.openhab.org/t/i-need-help-with-making-a-rule-using-astro/28716/5 "2017-05-21T10:08:11Z")

</div>

If that is your complete rule you don’t need any imports.  
In general: you can delete every import starting with org.openhab.\*

Because the channel triggers from the astro2 events are only a short trigger (ON, then immediately OFF again) I would recommend to use the design pattern for more flexibility:

> [@Design Pattern: Simple State Machine (e.g. Time Of Day)](https://community.openhab.org/t/design-pattern-time-of-day/15407):
>
> Edit: OH 4 Updates Problem Statement Often in home automation there is a need to track certain states that the system is in. Events occur to transition from one state to another state (e.g. at noon we transition to the AFTERNOON state). The collection of all the possible states and the transitions between events is called a “state machine”. This design pattern illustrates some ways OH can implement very simple state machines. One of the most common uses of a state machine like this is to trac…

---

_[View the full topic](https://community.openhab.org/t/i-need-help-with-making-a-rule-using-astro/28716)._
