Simple circuit, but it does not work

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Johan1974
Posts: 37
Joined: Monday 04 December 2017 20:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Simple circuit, but it does not work

Post by Johan1974 »

I'm trying to make a simple circuit in Dzvents, but it's going to be a pinball machine.

If IDX1 turns on or off, IDX2 must also turn on or off.
and
If IDX2 turns on or off, IDX1 must also turn on or off

When I make this in DZvents, IDX1 and IDX2 start flashing

Can someone help me?
BartSr
Posts: 396
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.7
Location: Netherlands
Contact:

Re: Simple circuit, but it does not work

Post by BartSr »

Hi!
Maybe better to post your code here. Then it's easier to help.
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave2MQTT
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 / 32 espeasy
Zigbee2MQTT
willemd
Posts: 662
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Simple circuit, but it does not work

Post by willemd »

To me it is not clear what you are trying to achieve. Better describe it with one state-change at a time.

If IDX1 turns on, then also IDX2 must turn on.
If IDX2 turns on, then also IDX1 must turn on.
So in the end when IDX1 turns on then both turn on and stay on?

or

If IDX1 turns on, then also IDX2 must turn on.
If IDX2 turns on, then IDX1 must turn off?
If IDX1 turns off, then also IDX2 must turn off?
If IDX2 turns off, then IDX1 must turn on?
This might be the flashing that you get now.
User avatar
heggink
Posts: 980
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Simple circuit, but it does not work

Post by heggink »

Your code runs the risk of leading to a flip flop. You can prevent that by adding .silent() such that the script will not call itself.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
waltervl
Posts: 6001
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Simple circuit, but it does not work

Post by waltervl »

Perhaps a .checkFirst() command option will also prevent a loop?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest