Page 1 of 2
Send multiple values at once
Posted: 14 Oct 2017 11:08
by dawiinci
I want to send multiple values at once using zunoSendReport().
This is what I basically do:
Code: Select all
ZUNO_SETUP_CHANNELS(
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_VELOCITY, SENSOR_MULTILEVEL_SCALE_METERS_PER_SECOND, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS, getterWind),
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_VELOCITY, SENSOR_MULTILEVEL_SCALE_METERS_PER_SECOND, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS, getterGust),
ZUNO_SWITCH_MULTILEVEL(getLED, setLED));
...
zunoSendReport(1);
zunoSendReport(2);
zunoSendReport(3);
The problem is it only sends the first value. It might be because Parameter 11 is set to 30 (30 second between reports according to ZWAVE Plus rules). But it should be possible to send all values at once or shortly after. Even if I set Parameter 30 to 0 it still only sends the first channel. However, it sends the first channel three times... Doing a manual status request works.
Is there anything I have to setup as well?
Re: Send multiple values at once
Posted: 15 Oct 2017 12:23
by dawiinci
I just can't get it to work:
Code: Select all
zunoSendReport(1);
zunoSendReport(2);
zunoSendReport(3);
Sends immediately three times channel 1.
Re: Send multiple values at once
Posted: 15 Oct 2017 12:28
by petergebruers
I have not tried this kind of code yet. All my experiments only had one report to send (I am new to developing code on the Z-Uno). I do not know the answer. But if you share the code (via PM or here) I will try to find out how it works. Or wait for other people to chime in

Re: Send multiple values at once
Posted: 15 Oct 2017 12:43
by dawiinci
It is actually pretty easy to reproduce. If you just add another (virtual) sensor with the same function you should be able to test it. Basically just duplicate your existing sensor definition.
This calls the reports every 10 seconds (in loop):
Code: Select all
zunoSendReport(1);
zunoSendReport(2);
delay(10*1000);
Re: Send multiple values at once
Posted: 15 Oct 2017 12:48
by petergebruers
I see. This evening I can try what you say: make a minimal sketch with two (dummy) reports. And I'll adapt my MH-Z19 sketch. Now it only sends CO2 but I can add temperature...
Re: Send multiple values at once
Posted: 15 Oct 2017 13:07
by dawiinci
Thanks a lot in advance!
Re: Send multiple values at once
Posted: 15 Oct 2017 23:17
by petergebruers
I ran a test sketch based on your info (code below) on my Z-Uno 2.1.1 and Z-Way controller and it works as expected. Both light levels (one single channel and one multi channel) update every 10 s. All three wind values (one single channel and 2 multi channel) update at the same time every 30 s. Also, this device includes as a mains device, so no "battery gauge". I do not have a clue why it does not work for you...
Code: Select all
ZUNO_SETUP_CHANNELS(
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_VELOCITY, SENSOR_MULTILEVEL_SCALE_METERS_PER_SECOND, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS, getterWind),
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_VELOCITY, SENSOR_MULTILEVEL_SCALE_METERS_PER_SECOND, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS, getterGust),
ZUNO_SWITCH_MULTILEVEL(getLED, setLED));
word Wind, Gust;
byte Led;
void setup() {
}
void loop() {
Wind++;
Gust++;
Led++;
zunoSendReport(1);
zunoSendReport(2);
zunoSendReport(3);
delay(10000);
}
word getterWind() {
return Wind;
}
word getterGust() {
return Gust;
}
byte getLED() {
return Led;
}
void setLED(byte x) {};
Re: Send multiple values at once
Posted: 15 Oct 2017 23:41
by PoltoS
What controller do you have? I believe the problem is in the Associations/MultiChannelAssociations type?
When you have three channels of the same type, only the first can be reported if you have only Association assiged in LifeLine group. But if you use MCA (MultiChannelAssociations), all are reported. This is according to the Z-Wave Plus rules.
This is also why it works when polled explicitelly - the controller sends specially embeded MultiChannel command.
Please try to remove node #1 (controller is usually it is #1) from the the Association group #1 and add in MCA #1:0 (channel 0 of the controller). It will work then
Re: Send multiple values at once
Posted: 17 Oct 2017 10:28
by dawiinci
Thank you all.
I use Indigo. While I can remove channel 1 I can't add channel 0?
Re: Send multiple values at once
Posted: 17 Oct 2017 11:33
by petergebruers
In Indigo, when changing associations, do you see a distinction between "single channel" and "multi channel"? PoltoS wants you to check if your controller "1" was listed under "single". If it was, please remove it and add it under "multi". On Fibaro, you see two colums, one marked S and one marked M.