-
Hi there. Searched the web for two days now. Not finding any solutions for my problem. Hence this post. Im building a indoor roller shades for my bedroom. It consists of a geared DC Motor, a NodeMCU with Tasmota plugged in a Motor Driver Shield. On the Motor Driver Shield there is a L293D H-Bridge and some additional circuitry (inverters). The Module Configuration looks like this: D3/GPIO0 Relay(2) //Direction Output to Motor Driver Currently everything is powered with a LabPSU supplying 7V, a DCDC Module stepping that down to 5V for the 3.3V LDO on the NodeMCU. This gives me the option to use higher Voltage Motors later on. I want the motors to stop rolling the shade down after a given amount of time and to stop rolling the shade up after the IR Sensor reports the shade is fully rolled up. (Rising Edge from IR Sensor --> Switch(3) changes from OFF to ON) My idea is to write a rule that is triggered by the IR Sensor that disengages the Enable Relay(1) and sets the Shutter Position to "Open" The Rule that should do this looks like this: "Rule1 ON Switch3#State = 1 DO ShutterStop ENDON ON Switch3#State = 1 DO ShutterSetOpen ENDON" However i cant get to trigger the rule either by waiting for Switch3#State to change to OFF (=0) or ON (=1). Only configuring the trigger for a Toggle (=2) results in the rule getting executed on each Signal Edge. When the IR sensor input is configured as a button and the rule is therefore adopted i got this rule: Any Ideas how to configure the rule successfully to trigger only on the rising edge from the IR Sensor? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
As default for There is also a |
Beta Was this translation helpful? Give feedback.
-
Miraculously inverting the Switch Input worked! Thank You! The rule gets executed when the Shades clears the IR Sensor. I fail to understand why previously neither the trigger listend for a falling or rising Edge (Switch3#State = 0 or Switch3#State = 1) but inverting the switch now correctly triggers on one edge. What am i missing? Any Ideas? |
Beta Was this translation helpful? Give feedback.
-
I assumed the default Switch Mode was "Follow Mode" but i just now learned, that the default is "Toggle Mode". The behavior in the WebGUI is very similar but the Input never gets turned 'ON' or 'OFF' only toggled. With Switchmode3 1 (normal Follow Mode) the rule gets triggered on "Rule1 ON Switch3#State = 1" and Both configurations work as intended. Thank again sfromis for your help. |
Beta Was this translation helpful? Give feedback.
As default for
Switch
/Button
inputs is the "normal" wiring of it connecting to ground when operated (falling edge), maybe try treating the input as inverted? For aSwitch
input, that is done by selecting aSwitchMode
to match what you want.There is also a
Button_i
config for inverted, but either way, this type of input is designed for quick pushes, not being held for a long time.