Hello
I would like read the mux legs every minutes, digital values are present. I created rule for read the the mux legs, but it is not working properly.
Code: Select all
On Clock#Time do
gpio,13,0
gpio,32,0
gpio,33,0
gpio,34,0
gpio,35,0
publish home/%sysname%/C00,[SIG#Output]
gpio,32,1
gpio,33,0
gpio,34,0
gpio,35,0
publish home/%sysname%/C01,[SIG#Output]
gpio,32,0
gpio,33,1
gpio,34,0
gpio,35,0
publish home/%sysname%/C02,[SIG#Output]
gpio,32,1
gpio,33,1
gpio,34,0
gpio,35,0
publish home/%sysname%/C03,[SIG#Output]
gpio,32,0
gpio,33,0
gpio,34,1
gpio,35,0
publish home/%sysname%/C04,[SIG#Output]
gpio,32,1
gpio,33,0
gpio,34,1
gpio,35,0
publish home/%sysname%/C05,[SIG#Output]
gpio,32,0
gpio,33,1
gpio,34,1
gpio,35,0
publish home/%sysname%/C06,[SIG#Output]
gpio,32,1
gpio,33,1
gpio,34,1
gpio,35,0
publish home/%sysname%/C07,[SIG#Output]
gpio,32,0`
gpio,33,0
gpio,34,0
gpio,35,1
publish home/%sysname%/C08,[SIG#Output]
gpio,32,1
gpio,33,0
gpio,34,0
gpio,35,1
publish home/%sysname%/C09,[SIG#Output]
gpio,32,0
gpio,33,1
gpio,34,0
gpio,35,1
publish home/%sysname%/C10,[SIG#Output]
gpio,32,1
gpio,33,1
gpio,34,0
gpio,35,1
publish home/%sysname%/C11,[SIG#Output]
gpio,32,0
gpio,33,0
gpio,34,1
gpio,35,1
publish home/%sysname%/C12,[SIG#Output]
gpio,32,1
gpio,33,0
gpio,34,1
gpio,35,1
publish home/%sysname%/C13,[SIG#Output]
gpio,32,0
gpio,33,1
gpio,34,1
gpio,35,1
publish home/%sysname%/C14,[SIG#Output]
gpio,32,1
gpio,33,1
gpio,34,1
gpio,35,1
publish home/%sysname%/C15,[SIG#Output]
gpio,13,1
Endon
The [SIG#Output] is a switch device. GPIO13 is enable/disable the mux (it not necessary i think). GPIO32-35 address pin of the mux.
This rule is muxing the pins and succesfully pulish to the MQTT server but the values are not changing. It publises the switch device last value. I tested the switch output, it is get the muxed leg value but doesn't change the switch state. I thought maybe the reading too fast and the switch can't follow the muxed value (or my theory is faulty which is higly possible
).
And I tested with this rule:
Code: Select all
On Clock#Time do
gpio,32,0
gpio,33,0
gpio,34,0
gpio,35,0
publish home/%sysname%/C00,[SIG#Output]
timerSet,1,3
Endon
On Rules#Timer=1 do
gpio,32,1
gpio,33,0
gpio,34,0
gpio,35,0
publish home/%sysname%/C01,[SIG#Output]
timerSet,2,3
Endon
On Rules#Timer=2 do
gpio,32,0
gpio,33,1
gpio,34,0
gpio,35,0
publish home/%sysname%/C02,[SIG#Output]
timerSet,3,3
Endon
On Rules#Timer=3 do
gpio,32,1
gpio,33,1
gpio,34,0
gpio,35,0
publish home/%sysname%/C03,[SIG#Output]
Endon
And this rule is behaving like the original. It looks my theory is false.... I think i need to find the another way to get the muxed output value.
I tried to use an analog pin too (ex: ADC#Value) but it sends the last ADC value like a switch device.
Any idea?
Maybe somebody can hack the _P180_Mux.ino on the plugin playground? I tied but that is too high for me or the documentation is weak....
I don't want to use any other I2C mux. The challenge is to use this. (I bought 3 pcs)
Thanks for advance.