Two triggers and one action

I am very much new for thinkplex. I want to create a flow with two triggers. But don’t know how to do it. I have installed door sensor. I want my entrance lights to turn on when the door is opened and only during sunset.

Don’t know how to put door sensor and sunset condition together to switch on light.

Looking for help from thinkplex experts. Anybody help me how to create flow with these triggers?

I think maybe the best here is to input the sunset = yes or no, to a global variable (it can also be used in other flows.
You can then trigger - open door = true → if variable “suset” = true → then turn on light.
I might need someone better than me in coding to verify this and maybe help out here :smiley:

Thanks.It worked.

Want to add one more step. Now, light turn on when door open and turn off when door closed. But I want only turn on when the door open. i don’t want the light to turn off automatically when the door is closed.

any suggestion?

Great!
That is a good question. If you have set it up as I suggested, it’s weird that it turns off again, since it is not supposed to mirror the state of the sensor :thinking:
Could you copy and paste the source code here? Maybe someone on this platform finds the flaw if I can’t :smiley:

{
  "Id": "7Hb5uikDSVpUERq",
  "ClassId": "7Hb5uikDSVpUERq",
  "Author": "",
  "Version": 0,
  "CreatedAt": "2024-07-24T14:08:14.065367334+02:00",
  "UpdatedAt": "2024-07-25T10:16:01.377647876+02:00",
  "Name": "Entrance light auto",
  "Group": "",
  "Description": "Entrance light auto",
  "Nodes": [
    {
      "Id": "12",
      "Type": "trigger",
      "Label": "main door sensor",
      "SuccessTransition": "13",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:sensor_contact/ad:34_0",
      "Service": "sensor_contact",
      "ServiceInterface": "evt.open.report",
      "Config": {
        "IsValueFilterEnabled": false,
        "LookupServiceNameAndLocation": false,
        "RegisterAsVirtualService": false,
        "Timeout": 0,
        "ValueFilter": {
          "Value": "",
          "ValueType": "bool"
        },
        "VirtualServiceGroup": "ch_0",
        "VirtualServiceProps": {}
      },
      "Ui": {
        "nodeType": "",
        "x": 729,
        "y": 77
      },
      "TypeAlias": "Trigger"
    },
    {
      "Id": "13",
      "Type": "if",
      "Label": "Door close",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": [
          {
            "BooleanOperator": "",
            "LeftVariableIsGlobal": true,
            "LeftVariableName": "Sunset",
            "Operand": "eq",
            "RightVariable": {
              "Value": "sunrise",
              "ValueType": "string"
            }
          }
        ],
        "FalseTransition": "",
        "TrueTransition": "14"
      },
      "Ui": {
        "nodeType": "",
        "x": 739,
        "y": 304
      },
      "TypeAlias": "If condition"
    },
    {
      "Id": "14",
      "Type": "action",
      "Label": "Light on",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:out_lvl_switch/ad:31_0",
      "Service": "out_lvl_switch",
      "ServiceInterface": "cmd.binary.set",
      "Config": {
        "DefaultValue": {
          "Value": "",
          "ValueType": "bool"
        },
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "ResponseToTopic": "",
        "VariableName": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {}
      },
      "Ui": {
        "nodeType": "",
        "x": 743,
        "y": 502
      },
      "TypeAlias": "Action"
    }
  ],
  "Settings": null,
  "IsDisabled": false,
  "IsDefault": false,
  "ParallelExecution": "parallel"
}

Below is how I have configured. in the action, i am getting option as on/off only and not just ON status.

In the trigger look at message filtering and choose ‘enable value filter’ and choose true (on). Flow should only run when sensor goes to true now. Depends on the sensor, change to false (off) if its inverted. You also have similar function on action, named payload configuration.