Configuring Insteon Items to use Astro

Platform information:

  • Hardware: Raspberry Pi 3 Model B version 1.2 (ARMv8, with 1GB RAM, and 64 GB microSD card)
  • OS: Raspbian 9 (Stretch)
  • Java Runtime Environment: java version “1.8.0_151”, Java™ SE Runtime Environment (build 1.8.0_151-b12), Java HotSpot™ Client VM (build 25.151-b12, mixed mode)
  • openHAB version: 2.1.0-1 wth openhab2-addons 2.1.0-1

Hello,

I’m having difficulty understanding the use of the Astro binding with an Insteon items. For example, I’d like to create rules to turn this Insteon item (Insteon address anonymized) on 5 minutes before sunset and 5 minutes after sunrise. How do I do this?

insteonplm.items - entry

Switch frontPorch “front porch” {
insteonplm=“12.34.56:F00.00.02#switch”}

astro.things - entry (partially anonymized)

astro:sun:home [ geolocation=“38.4xxxxxx,-90.3xxxxxx,100” ] {
Channels:
Type rangeEvent : rise#event [
offset=5]
Type rangeEvent : set#event [
offset=-5]]
}

Regards,
Burzin

Take a look at the examples in the docs:

http://docs.openhab.org/addons/bindings/astro/readme.html#full-example

rule "example trigger rule"
when
    Channel 'astro:sun:home:rise#event' triggered START 
then
    ...
end

For your item something like this should work:

rule "example trigger rule item frontPorch ON"
when
    Channel 'astro:sun:home:rise#event' triggered START 
then
   frontPorch.sendCommand(ON)
end

rule "example trigger rule item frontPorch OFF"
when
    Channel 'astro:sun:home:set#event' triggered START 
then
   frontPorch.sendCommand(OFF)
end

For extended functionality see

I added the Astro addon and deselected all the channels I don’t want to see. Where does the code shown above to turn on and off lights with sunrise and sunset, go? I don’t see anywhere that takes that kind of input.

To a rules file:

http://docs.openhab.org/configuration/rules-dsl.html

HI @sihui,

Thanks for the pointer. After I fixed some errors on my part, it worked

. I do have one follow on question though. I found the rule example. However, I could not find the bit where for example, “frontPorch.sendCommand(OFF)” or frontPorch.sendCommand(ON) is documented. Where do I find that?

Regards,
Burzin

http://docs.openhab.org/configuration/rules-dsl.html#manipulating-item-states

Perfect thank you. The link you provided along with this link: http://docs.openhab.org/concepts/items.html (which is part of the article you pointed me to), provided exactly what I was looking for.