My first rule doesn't work

  • Platform information:
    • Hardware: desktop pc
    • WIndows 10
    • openHAB version: 3.3.0
      I’ve just installed openHAB after moving from Home Assistant, since openHAB seems to speak to my Kasa lights where HA no longer does.
      I’m trying to create my first rule, to switch on a light at dusk. I’ve installed the Astro and TP-Link bindings, and through the TP-Link binding I can control my lights. However, the Astro trigger never switches the light in my rule.
      I’ve created the rule through the UI, which produces the code:
      configuration: {}
      triggers:
    • id: “1”
      configuration:
      itemName: AstroSunData_CivilDusk_Start
      state: START
      type: core.ItemStateChangeTrigger
      conditions: []
      actions:
    • inputs: {}
      id: “2”
      configuration:
      itemName: LightKitchen_Brightness
      command: “20”
      type: core.ItemCommandAction

Should this work, or am I just somehow missing the point, being a newbie?

Perhaps I should also say that openHAB is running on a Raspberry Pi 4, headless, with access via my windows pc via openhab:8080

Start with basics.
Do you have an Item with that name?
What kind of Item is it, could it ever change to state START? (not if it is a DateTime type, for example)
Does you expected change happen? Look in your events.log, where all Item state changes can be seen.
When does that happen? Note that Astro calculates e.g. sunrise and sunset times for the day ahead at midnight. They change at midnight, and that days sunrise remains at say 06:00 all day long.

I think perhaps you are looking for a trigger event channel that fires at the actual time of dusk.

I have this item configured:
Item
Start TIme
DateTime . Point
AstroSunData_CivilDusk_Start

maybe I need to read more tutorials first :slight_smile:

Okay, so as said that Item will be set to some value like 18:30 each midnight, and not change for the rest of the day. (Sunset today will be / was at time X, that is true all day long)

Go back to your rule trigger, forget using an Item.
The Astro binding also provides a trigger channel, with a similar sort of name, that triggers at dusk.

Ah, that makes sense. I do see in the events log:
2022-12-21 16:50:00.002 [INFO] [openhab.event.ChannelTriggeredEvent ] - astro:sun:local:civilDusk#event triggered START

Thanks for your help. Now to wait until dusk tomorrow to see the result … it’s all a learning process. Thanks again.