Combine Selector Switch and physical switch on Fibaro Relay Switch

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

Moderator: leecollings

Post Reply
Nelissuh
Posts: 12
Joined: Friday 09 December 2016 0:10
Target OS: NAS (Synology & others)
Domoticz version: 4.10717
Location: The Netherlands
Contact:

Combine Selector Switch and physical switch on Fibaro Relay Switch

Post by Nelissuh »

Hello,

I am a newby in DzVents, and hope to get some help with my issue below. I searched the forum, but couldn't find the solution.

My situation:

* I put some black tubes on my roof to heat my children's swimming pool.
* A pump pumps the swimming pool water through these tubes.
* The pump is connected to 1 output of a Fibaro FGS-223 double switch 2.

I created a DzVents script based on these 2 inputs:
- The actual Solar Power
- A 3-way selector switch Off / Auto / On

The script tuns fine.
> Selector Off : Pump Off
> Selector Auto : Pump switched On/Off based on solar power.
> Selector On : Pump On

What I would like to change:

A manual input pulse switch is connected to the input of the Fibaro switch.
With the script turned of, this input changes the state of the pump from On to Off and back.
With the script turned on every time the Solar Power state is updated (every 5 minutes), it reads the status of the Selector switch, and changes back the status of the pump to the original value.

So I am searching for a script to change the state of the 3-way Selector Switch when the button of the input is operated.

So:
-> Selector Off (& Pump Off) & input operated: Selector changed into "On" (pump will change from Off to On)
-> Selector Auto & Pump Off & input operated: Selector changed into "On" (pump will change from Off to On)
-> Selector Auto & Pump On & input operated: Selector changed into "On" (pump will change from On to Off)
-> Selector On (& Pump On) & input operated: Selector changed into "On" (pump will change from On to Off)

Probably, when I am able to read the actual operation of the Fibaro input, I am able to create the rest of the script.

Thanks in advance!
Nelissuh
Posts: 12
Joined: Friday 09 December 2016 0:10
Target OS: NAS (Synology & others)
Domoticz version: 4.10717
Location: The Netherlands
Contact:

Re: Combine Selector Switch and physical switch on Fibaro Relay Switch

Post by Nelissuh »

Deleted :oops:
Nelissuh
Posts: 12
Joined: Friday 09 December 2016 0:10
Target OS: NAS (Synology & others)
Domoticz version: 4.10717
Location: The Netherlands
Contact:

Re: Combine Selector Switch and physical switch on Fibaro Relay Switch

Post by Nelissuh »

I thought I solved the issue, but after some extra testing I found the script wasn't working. I used the "changed" variable of the Pump, but this doesn't work. In case I switch the Selector in Auto, and the script switches the pumprelay from On to Off (or the other direction) the script recognises this as an change of the Pump, and moved the Selector also from Auto to On or Off....

Is there no way to read the activation/operation of the input channel of the Fibaro switch?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Combine Selector Switch and physical switch on Fibaro Relay Switch

Post by waaren »

Nelissuh wrote: Monday 06 August 2018 23:18 ...
In case I switch the Selector in Auto, and the script switches the pumprelay from On to Off (or the other direction) the script recognises this as an change of the Pump, and moved the Selector also from Auto to On or Off....
..
Is this also the case if you add the option .silent() to the switchOn() / switchOff() commands to the pumprelay ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Nelissuh
Posts: 12
Joined: Friday 09 December 2016 0:10
Target OS: NAS (Synology & others)
Domoticz version: 4.10717
Location: The Netherlands
Contact:

Re: Combine Selector Switch and physical switch on Fibaro Relay Switch

Post by Nelissuh »

Thanks for the tip!

No idea, I will check asap, probably tonight. I will keep you updated.

My other option is to make a variable high for a short period when the relay is switched by the script, and ignore the switch when the variable is high, but I would prefer the "Silent" switch.
Nelissuh
Posts: 12
Joined: Friday 09 December 2016 0:10
Target OS: NAS (Synology & others)
Domoticz version: 4.10717
Location: The Netherlands
Contact:

Re: Combine Selector Switch and physical switch on Fibaro Relay Switch

Post by Nelissuh »

I split the script into 2 scripts:
- Script A, triggered by the selector or a change in solar power, to switch the relay On or Off (silent)
- Script B, triggered by the relay (switch), to move the selector to On or Off (silent).

I tried it, but the silent() does not do the trick (always), even when I think it should be the solution.

I have the feeling this issue with the Fibaro FGS-223 is causing the issue.

I just switched the selector a few times from On -> Auto.

In case the switch command was sent once to the relay, it moved from On = On to Auto = Off (as it is dark so the solar heating isn't working) => Okay

In case the switch command was sent twice to the relay, it moved from On = On to Off = Off => Which is not Okay... I have the feeling Domoticz only sends the 1st switch command silent. The 2nd is not silent, triggering script B. :oops:
Nelissuh
Posts: 12
Joined: Friday 09 December 2016 0:10
Target OS: NAS (Synology & others)
Domoticz version: 4.10717
Location: The Netherlands
Contact:

Re: Combine Selector Switch and physical switch on Fibaro Relay Switch

Post by Nelissuh »

I created a workaround by:

1: Creating a User Variable "Block_PS

2: Adding the following 2 lines to the switch command in the pump script:

Code: Select all

domoticz.devices(SolarPomp).switchOff().silent()
domoticz.variables('Block_PS').set(1)
domoticz.variables('Block_PS').set(0).afterSec(2)
3: Adding the following line as a condition to the script aligning the selector to the pump switch

Code: Select all

Block_PS ~= 1
Result: Every time the script is switching the pump, a variable is 2 seconds 1, blocking the selector alignment to be executed (so it will stay in the Auto position).
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest