Page 1 of 1

ZUNO_BLINDS stop event for Fibaro roller shutter stop button

Posted: 22 Feb 2019 20:15
by Alex27011
Hi,

i have developed a control system for VELUX roller blinds (Hard- + Software- solution).

Everything works well except for one thing:
fibaro_hc2_roller_shutter_control_stop.png
fibaro_hc2_roller_shutter_control_stop.png (10.66 KiB) Viewed 6121 times
There are four buttons to control roller blinds in Fibaro HomeCenter2 - up, down, close and pause/stop.

I use the ZUNO_BLINDS macro with getter and setter functions to control the blinds but there is no special pause/stop event.
I found out, that the getter function is called once if the stop button is pressed but a setter is not triggered.

Do you have any ideas how to get the pause/stop button click triggered?

Many thanks, best regards,
Alex

Re: ZUNO_BLINDS stop event for Fibaro roller shutter stop button

Posted: 23 Feb 2019 00:07
by PoltoS
As I remember, Z-Uno handles up/down/stop events internally and do fire setter every 5 steps. You do not get up/down/stop, but instead you get setter on specific intermediate values

Re: ZUNO_BLINDS stop event for Fibaro roller shutter stop button

Posted: 23 Feb 2019 01:32
by Alex27011
Sorry but i don't think that this is correct.

I used the serial monitor to debug the single steps.
If you click on the shutter down button the setter method is fired once with 0. If you click on the shutter up button the setter is fired once with 99. If you click on the pause/stop button nothing happens inside the setter method (something like 255 would be great here).
BUT on every single click on the up or down button the getter is called twice - on a click on the pause/stop button, the getter is called only once.
If i send the current value to the main controller (zunoSendReport - channel1; every 2 seconds at the moment while blinds are active) the getter method is called twice also...

Re: ZUNO_BLINDS stop event for Fibaro roller shutter stop button

Posted: 25 Feb 2019 13:57
by p0lyg0n1
Hi,
We have checked it with v 2.15 (the latest beta, with r2.14 it have to work too) it works ok. Please try this test-sketch. Screenshots & sketch attached.
Sketch (was refactored from RadioBklink example)

Code: Select all

// comment the next line if you don't need debug output. 
#define DBG_SERIAL Serial // Selects needed serial for debug output
//initial period of the blink is 1 second
byte dimmerValue=100;
//Next line sets up Z-Uno channels. In this case it adds the Switch Multilevel channel
ZUNO_SETUP_CHANNELS(ZUNO_BLINDS(getterFunction, setterFunction));

// the setup function runs once, when you press reset or power the board
void setup() {
  // set digital pin 13 as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  dimmerValue = 100;
   #ifdef DBG_SERIAL
   DBG_SERIAL.begin(115200);
   #endif 
}
// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
  delay(dimmerValue*10);           // wait for timeout
  digitalWrite(LED_BUILTIN, LOW);  // turn the LED off by making the voltage LOW
  delay(dimmerValue*10);           // wait for timeout
}
void setterFunction(BYTE currentValue) {
    dimmerValue=currentValue;
   #ifdef DBG_SERIAL
   DBG_SERIAL.print("dimmerValue=");
   DBG_SERIAL.println(dimmerValue);  
   #endif 
} 
BYTE getterFunction() {
    return dimmerValue;  
}
изображение-2.png
изображение-2.png (256.21 KiB) Viewed 6082 times
.
изображение.png
изображение.png (248.3 KiB) Viewed 6082 times

Re: ZUNO_BLINDS stop event for Fibaro roller shutter stop button

Posted: 28 Feb 2019 00:00
by Alex27011
Hi p0lyg0n1,

yes, the blinds are working very well - this is not the problem.
Your test-sketch is ok too - but the stop option is not implemented in it.
How have you validated the fibaro stop functionality? Please push the e.g. down button and wait for some seconds - then push the stop button (marked in my first screenshot attached) - nothing happens - there is no setter called.
I have the latest stable installed already.

Thanks a lot