Sonoff T0 switch and nodered

Like this?

OKay it will switch with no motion the ledstrip to OFF, but with motion it is not going ON

This is the msg when it see movement, only ledstrip stays off

5-3-2020 13:01:18node: 9bd15be2.da99d8
zigbee2mqtt/0x680ae2fffe36ddc8 : msg : Object
{ topic: "zigbee2mqtt/0x680ae2fffe36ddc8", payload: object, qos: 0, retain: false, _msgid: "ff0ca4af.fd64c8" }
5-3-2020 13:01:18node: 9bd15be2.da99d8
zigbee2mqtt/0x680ae2fffe36ddc8 : msg : Object
{ topic: "zigbee2mqtt/0x680ae2fffe36ddc8", payload: "ON", qos: 0, retain: false, _msgid: "ff0ca4af.fd64c8" }

put a seperate debug on each node and name the debug nodes...makes it easier to see which node is sending what

see how in first debug the payload is aqn object? If you cliick the crows in the debug output, it will expand the oupput and show what is in payload.

i am a step futher now, when i remove the trigger 1 min. then the motion works and activate the lamp and without motion the lamp goes off. so the trigger part goes wrong.

Will name the debug nodes

trigger

there is no message coming from the trigger at all

Expand the object output as we cannot see it. you can copy the output and paste it between 3 tickmarks, like:

```
output
```

okay trigger output works after 1 min, then it decative the led lamp.

But when it sees motion when the light is off, then the led strips stays off
trigger

here is a video showing it

Screen Shot 2020-03-05 at 7.26.05 AM

then click the triangle next to payload and provide a copy of the flow as it now is.

Post your flow.

[{"id":"eae0672e.14ad28","type":"tab","label":"Switches","disabled":false,"info":""},{"id":"9bd15be2.da99d8","type":"debug","z":"eae0672e.14ad28","name":"Motion output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":160,"y":300,"wires":[]},{"id":"1fe1c1f.acc1c3e","type":"mqtt in","z":"eae0672e.14ad28","name":"motionHK","topic":"zigbee2mqtt/0x680ae2fffe36ddc8","qos":"0","datatype":"json","broker":"c1374cde.87a82","x":60,"y":200,"wires":[["e99b366b.adc088","9bd15be2.da99d8"]]},{"id":"5ee5229.75f54dc","type":"trigger","z":"eae0672e.14ad28","op1":"","op2":"OFF","op1type":"nul","op2type":"str","duration":"1","extend":false,"units":"min","reset":"ON","bytopic":"all","name":"","x":390,"y":200,"wires":[["d9bea7bb.841858","6e4d8204.bf361c"]]},{"id":"d9bea7bb.841858","type":"mqtt out","z":"eae0672e.14ad28","name":"Ledstrip Hobbykamer","topic":"wb_leds/cmnd/POWER","qos":"2","retain":"true","broker":"c1374cde.87a82","x":604,"y":200,"wires":[]},{"id":"e99b366b.adc088","type":"change","z":"eae0672e.14ad28","name":"occupancy","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.occupancy ? \"ON\" : \"OFF\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":210,"y":200,"wires":[["5ee5229.75f54dc","6bbe2d40.789b64"]]},{"id":"6bbe2d40.789b64","type":"debug","z":"eae0672e.14ad28","name":"occupancy output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":390,"y":300,"wires":[]},{"id":"6e4d8204.bf361c","type":"debug","z":"eae0672e.14ad28","name":"trigger output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":610,"y":300,"wires":[]},{"id":"c1374cde.87a82","type":"mqtt-broker","z":"","name":"Hassio","broker":"192.168.2.23","port":"1883","clientid":"Admin","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

The trigger node receives a message, does nothing for 1 minute and then sends OFF.
Reset is done when ON is received.

Nothing will happen.

yeah but i how can i get the light on when i move. what i told in the start post i am total NOOB atm

Before i post a flow:

You want the light to go on when there is motion detected and stay on for 1 minute correct ?
The motion sensor only ouputs "true" when there is movement correct ? (there is no false)

correct, and that is not working.
What i showed in the video
Motion is detected and led stays off. what do i need to add to get the led strip on. and when there is no motion after 1 minut or what is set the strip goes off

Ok then it is much simpler:

[{"id":"387379cb.b4d1f6","type":"mqtt in","z":"e0655590.95e07","name":"motionHK","topic":"zigbee2mqtt/0x680ae2fffe36ddc8","qos":"0","datatype":"json","broker":"48a8cabf.0c8d34","x":84,"y":144,"wires":[["118e3215.bb2206","8aea0148.ebb3a8"]]},{"id":"8aea0148.ebb3a8","type":"trigger","z":"e0655590.95e07","op1":"ON","op2":"OFF","op1type":"str","op2type":"str","duration":"2","extend":true,"units":"min","reset":"","bytopic":"all","name":"","x":262,"y":144,"wires":[["12c82796.71798","cf56003d.2d9298"]]},{"id":"12c82796.71798","type":"mqtt out","z":"e0655590.95e07","name":"Ledstrip Hobbykamer","topic":"wb_leds/cmnd/POWER","qos":"2","retain":"true","broker":"48a8cabf.0c8d34","x":484,"y":144,"wires":[]},{"id":"48a8cabf.0c8d34","type":"mqtt-broker","z":"","name":"Hassio","broker":"192.168.2.23","port":"1883","clientid":"Admin","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

thanks that works

My main quastion is then still unanswerd.
but i think that is not possible.

But is this idear possible

When i push the T0 switch from main light, and it is between 6-7am then only the led strip goes on, and after and bedore 6-7am also the main light goes on. but when there is no movement then all lights go off.

My main quastion is then still unanswerd.

What is your "main" question ?

When i push the T0 switch from main light, and it is between 6-7am then only the led strip goes on, and after and bedore 6-7am also the main light goes on. but when there is no movement then all lights go off.

Yes that is simple, go to the hamburger menu (right top) -> manage palette -> install tab, search "node-red-contrib-time-range-switch", install. Now you can route messages based on the time.

i usee mqtt in but when i push on the T0 sonoff switch in my room, it goes on always.
That T0 works also without connecton
https://www.itead.cc/sonoff-tx-series-wifi-smart-wall-switches.html