Skip to content

Commit

Permalink
Update migration.md (#1022)
Browse files Browse the repository at this point in the history
* Update migration.md

added hint to use Karaf console commands to simulate events in rules

* Update migration.md

* Added newlines

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>
  • Loading branch information
mstormi authored and Confectrician committed Aug 8, 2019
1 parent 918d4ed commit 456b53d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tutorials/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,13 @@ cp $OPENHAB1_CONF/configurations/sitemaps/* $OPENHAB_CONF/sitemaps/*
Add 'legend=true' to restore the chart's legend.

### Rules

Test your rules using commands in Karaf console.
Use smarthome:send to send a command, smarthome:update to update an Item's state, and smarthome:status to get an Item's state.
Use smarthome --help for more details.
These can be used to simulate events that can trigger a rule, even in an installation without "active" devices.

Potential pitfalls in rules code:
* All references to org.openhab.* in imports and class references should be removed. All of these classes are automatically included and have moved.
* import org.joda.time.* statements should also be removed, they are also included by default.
* To test for Items with an Undefined state replace `if(MyItem.state == Undefined)` with `if(MyItem.state == NULL)`.
Expand Down

0 comments on commit 456b53d

Please sign in to comment.