Rules depending on Astro sun events

Hi,
I’m trying to implement two rules which both is depending on states of the sun. I do this through Paper UI and the code below is fetch from DB using REST API. I have search the forum but not yet found an answer to my problems.

Rule 1:
This rule shall switch on a lamp in the ground floor when I stop watching TV on first floor. My TV also control my receiver and power the receiver OFF when I power TV OFF. So first thing is to react on the power state of the receiver (can’t find a bridge for my TVtherefore I use the receiver). Next to turn on the lamp BUT only is the sun is set.

Turning on the lamp is working but I can’t figure out how to handle the “but only if…” part using the Sun_Set_EndTime.

This is the code:

{
“status”: {
“status”: “IDLE”,
“statusDetail”: “NONE”
},
“triggers”: [
{
“id”: “1”,
“label”: “an item state changes”,
“description”: “This triggers the rule if an item state has changed.”,
“configuration”: {
“itemName”: “YamahaReceiverRXV675_Power”,
“state”: “OFF”,
“previousState”: “ON”
},
“type”: “core.ItemStateChangeTrigger”
}
],
“conditions”: [
{
“inputs”: {},
“id”: “3”,
“label”: “an item has a given state”,
“description”: “Compares the item state with the given value”,
“configuration”: {
“itemName”: “Solen_Set_EndTime”,
“state”: “END”
},
“type”: “core.ItemStateCondition”
}
],
“actions”: [
{
“inputs”: {},
“id”: “2”,
“label”: “send a command”,
“description”: “Sends a command to a specified item.”,
“configuration”: {
“itemName”: “LED_Reol_Power”,
“command”: “ON”
},
“type”: “core.ItemCommandAction”
}
],
“configuration”: {},
“configDescriptions”: [],
“uid”: “7325a2ad-917f-431d-b5ce-368501c921a5”,
“name”: “TV kig slut”,
“tags”: [],
“visibility”: “VISIBLE”,
“description”: “Når Yamaha slukkes tænder LED reol”
}

Rule 2:
This rule shall switch on two lamps when we reach Sun_CivilDusk_StartTime. Nothing happens. (Probably the same problem as in rule 1).

This is the code:

  {
    "id": "1",
    "label": "a trigger channel fires",
    "description": "React on events from a trigger channel of a thing.",
    "configuration": {
      "event": "START",
      "channelUID": "astro:sun:local:civilDusk#event"
    },
    "type": "core.ChannelEventTrigger"
  }
],
"conditions": [],
"actions": [
  {
    "inputs": {},
    "id": "2",
    "label": "send a command",
    "description": "Sends a command to a specified item.",
    "configuration": {
      "itemName": "LED_Reol_Power",
      "command": "ON"
    },
    "type": "core.ItemCommandAction"
  },
  {
    "inputs": {},
    "id": "3",
    "label": "send a command",
    "description": "Sends a command to a specified item.",
    "configuration": {
      "itemName": "SpotTrappe_Power",
      "command": "ON"
    },
    "type": "core.ItemCommandAction"
  }
],
"configuration": {},
"configDescriptions": [],
"uid": "d2ab6082-d70a-41e4-984d-5bf9a79cbaab",
"name": "Alrum aften",
"tags": [],
"visibility": "VISIBLE",
"description": "Tænder lys i alrum ved skumringstid"

}

What have I done wrong?

Please How to use code fences.

I haven’t experimented yet much using Channel triggers in the Experimental Next Gen Rules Engine. There might be an issue.

Can you review Experimental Next-Gen Rules Engine Documentation 1 of : Introduction (all five pages) and use a Script Action and log out the contents of event?