Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Q: How I can handle association group command from a device in the ​​​​​​​script (or VD)


Question

Posted (edited)

Hi!

 

Q: How I can handle association group command from a device in the script (or VD)?

binding to a physical device via 

Please login or register to see this image.

 

is not an option for me. Thanks! 

Edited by 10der

12 answers to this question

Recommended Posts

  • 0
Posted

I think that is undocumented. You can find  some inspiration in the "fix fgwp" script:

 

Please login or register to see this code.

I do not have code to set multichannel...

  • 0
  • Inquirer
  • Posted (edited)

    oh! maybe I was unclear.

     

    I have a device that can send association to Group #2 when some internal params for device occur.

    I don't wanna bind the physical device to turn on / off lighting for example. I want to run LUA scene and check additional params for lighting for example.

    .

     

    Please login or register to see this code.

     

    Edited by 10der
    • 0
    Posted

    Please link to the manual of the device.

     

    I can tell... it is a bit complioated. As far as I understand it, Z-Wave Plus tries to follow this principle: the device has one reporting group (number 1) and the device sends all status and values to the controller. All other groups are meant to help you control another device, not the controller. A device should report different "endpoints" like two relays or different sensor notifications like "Lux" or temp or windspeed, leading to different slaves. So if group 2 represents a "turn on device" (to close or open blinds eg) that might be represented by a generic light switch on your HC. But only if the manufacturer of the device decides to implement it like that. Groups have no automatic mapping to devices. I would say it is possible to add your controller to group "2" of your device, but I do not have a clue what your HC will do when it receives a "basic on" from device X... It might just ignore it...

     

    I bet you have looked at the manual and came to the the conclusion: the functionality of "group 2" does not exist on my controller (group 1). Seems quite possible to me and I do not think there is a way to fix that...

    • 0
  • Inquirer
  • Posted
    8 hours ago, petergebruers said:

    Please link to the manual of the device.

     

    Please login or register to see this attachment.

    8 hours ago, petergebruers said:

    All other groups are meant to help you control another device, not the controller.

     

    I wouldn't ask if there was another way. But Fibaro do not allow (unlike other like openhub UI/razberry UI etc) to use VD on a level physical devices!

    • 0
    Posted

    I kind of guessed it was this device, I had a look at the manual a long time ago.

     

    Quote: "After wake up, Z-Weather first serves the associated groups. This is in all cases Group 1. “Lifeline” where it sends all readings to. In case of an unscheduled event, the associated 
    groups 2-4 are also served."

     

    They unfortunately do not talk about endpoints so I make an educated guess: there are no extra devices... So you get all sensor data and have to mimic the behaviour of "group 2" through code.

     

    I understand what you say about VDs, allowing a VD to appear as a switch/dimmer/sensor would solve your problem and make HC more universal, (like for instance openhab).

     

    Sorry, no wise words, I do not know how to work around this issue ;(

    • 0
  • Inquirer
  • Posted
    3 minutes ago, petergebruers said:

    So you get all sensor data and have to mimic the behaviour of "group 2" through code.

    unfortunately, at the night device in deep sleep and doesn't update sensors and an only unscheduled event can wakeup device and report to #2 group - for example too much wind.

    so  I  can't emulate.

     

    6 minutes ago, petergebruers said:

    Sorry, no wise words, I do not know how to work around this issue

     

    Thank you so much, colleague!

     

     

    just FYI

     

    a statistic (now - 2AM 05/11/2018 ), last wake-up time is Thursday, May 10, 2018 10:28:44 PM 

    Please login or register to see this link.

     DST

    Please login or register to see this image.

    • 0
    Posted
    13 hours ago, 10der said:

    unfortunately, at the night device in deep sleep and doesn't update sensors and an only unscheduled event can wakeup device and report to #2 group - for example too much wind.

     

    Yes, the manual  mentions it uses a super capacitor and reporting is limited. They do mention reporting at time intervals, and it seems to depend on ambient light: "The wake up interval is between five minutes at noon in summer and five hours in the second half of the night in winter.".

     

    I knew I read something about that and it took me a while to find what that was. It was a review on Vesternet: "(...) The onboard capacitor only have enough power for 8 button clicks after which you have to wait for it recharge before you can continue any setup. (....)"

    That sounds pessimistic, so let's do some math. A button click keeps the device awake for 4 seconds according to the manual.  That is 32 seconds of full power run time. Assuming you have a good connection and your controller puts it back to sleep asap a report could be done in less than 0.25 seconds. I do not know the quiescent power consumption, I am guessing it is not significant over a one night period. So actually the capacitor holds enough energy to do somewhere between 8 and  32/.25 = 128 reports. Not to shabby, but indeed not quite unlimited either.

     

    If I combine ""After wake up, Z-Weather first serves the associated groups. This is in all cases Group 1. “Lifeline” where it sends all readings to. In case of an unscheduled event, the associated groups 2-4 are also served." with ""The wake up interval is between five minutes at noon in summer and five hours in the second half of the night in winter." and the three specific conditions that trigger a report to group:

     

      (2) "Wind speed is higher than 6 m/s (22 Km/h)"

      (3) "At the end of the dawn if it becomes bright"

      (4) "At the end of the dusk if it becomes bright"

     

    I'd say... If wind > 6 m/s then your HC should get an immediate report. That is assuming, the firmware correctly implements what it says :-)

     

    13 hours ago, 10der said:

    a statistic (now - 2AM 05/11/2018 ), last wake-up time is Thursday, May 10, 2018 10:28:44 PM 

    Please login or register to see this link.

     DST

     

    I do not know if that is really wrong, because

    (a) They do not give much detail about how the wake up interval changes throughout the night, but it could "5 hours".

    (b) The event log filters duplicate events, if a device reports "2" at 10:28:44 then again reports "2" at 11:12:34 then you only get the first timestamp.

     

    So I'm not sure what to think about the reporting of device 933...

    • 0
  • Inquirer
  • Posted
    50 minutes ago, petergebruers said:

    d say... If wind > 6 m/s then your HC should get an immediate report. That is assuming, the firmware correctly implements what it says

     

    Q:

    Please login or register to see this code.

    A:

    Please login or register to see this code.

    :)

     

    • 0
    Posted (edited)
    1 hour ago, 10der said:

    The information about much wind, will be send to devices in association group 2.

     

    Yeah, he repeats what is in the manual, if that implies "and we do not send it to the lifeline group" then they either have to change the manual or the implementation to make their customers happy. 

     

    Have you tried putting your controller in group 2 anyway? The do not say which command classes they send to "group 2". It will be "basic set" but I think the specs allow to also send other command classes, if I have correctly read those parts of the spec. If the primary function of group two is to control a relay, then it is probably limited to "basic set" because all Z-Wave devices understand it. I don't know :-(

     

    Some older devices (non-Z-Wave Plus) had "device 1" in *all* groups! I remember putting the controller in additional groups (log time ago) on either a Fibaro switch or a Wall Plug. Those normally have the controller only in the last group. Then I sniffed the network: there were no duplicate packets. So it did not make much difference, but it also did not hurt. Maybe I can find the time to repeat that test.

     

    For sake of completeness, a device "reporting" is technically "not awake" unless it is a FLiRS) so I do not think a controller could "poll" the device... 

     

    I keep talking about this because I keep thinking "there has to be a workaround, one that does not require you to buy a 'dummy' relay just to get info reported to group 2"

     

    You know... there is something else... I think it is possible this station only sends data if speed > 6m/s. So it might not send a cancellation if wind back <= 6 m/s. So you still might not be happy with that workaround, if you expect it to give some idea about wind speed at night.

     

    BTW the manual says it sends reports at least every 5 hours... That statement is incorrect? This is the complete paragraph:

    Quote

    During normal operation, Z-Weather is limiting continuous measurement to wind speed and
    solar radiation, other sensors are operating only on demand. This conservative energy
    management ensures continuous operation with the limited energy harvested from the solar
    cell powering Z-Weather. The Z-Wave radio frequency transmitter is turned off most of the
    time and is turned on if there is too much wind, at twilight time and on a continuous base,
    depending on the energy budget. The wake up interval is between five minutes at noon in
    summer and five hours in the second half of the night in winter.

     

    So the only ambiguity exists between "depending on the energy budget" and "The wake up interval is between five minutes at noon in summer and five hours in the second half of the night in winter"

     

    Is it possible, the capacitor did not get fully charged, so it is unable to report at night though it should do so after 5 hours?

     

    I wonder if you have 15 minutes to use my script to display all event data from that station in the debug log. The output looks like this and is easier for me to read. Here are for example 4 motion sensors:

     

    322229412_2018-05-1211_45_35-HomeCenter2.png.82d1de0ba0f5dc1501f0eec7ac97dcf1.png

     

    Code:

    Please login or register to see this attachment.

    Edited by petergebruers
    typos
    • Thanks 1
    • 0
  • Inquirer
  • Posted

    cool!

    I was a bit lazy. I am alwais query manually like a:

    /api/panels/event?deviceID=933&last=100&type=id

     

    and after 

    Please login or register to see this link.

    ;) Hahahaha

     

    Thank you!

     

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    so, as we can see at the night - 22h (I mean it's not night it evening), 03h and 5h cuz dawn.

    ше make sad me.

    during the winter (guess) it will feel even sadder! 22h / 3h / 7h

     

     

     

    • 0
    Posted

    Thanks! So this is a truly a "sunny weather only device". :?

    14 minutes ago, 10der said:

    during the winter (guess) it will feel even sadder! 22h / 3h / 7h

    I looks like it is going to report only 1 maybe 2 times per night, indeed.

    And I see no 15 m/s wind speed, so it really is not reporting that...

    Idea for the next, improved version: separate solar panel, 5-10 times the size of the present one, (replaceable) LiIon cell instead of supercap, new firmware to fix reporting to controller + report 5-10 times per night... DIY project, anyone?

    • 0
  • Inquirer
  • Posted
    1 minute ago, petergebruers said:

    DIY project, anyone?

     

    pay a lot of money ($200 dead presidents of America) and make from device DIY aaaaaaaaaaaa! :D you make my day. 

     

    btw, I already thought about Aliexpress 

    Please login or register to see this link.

    The only thing stopping  ShippingUS $44.09 to 

    Please login or register to see this link.

    and  Total PriceUS $85.88 

     

    or 

    Please login or register to see this link.

     

    but when I think what I will need sniff 433 interfaces.... omg...

     

    UPD: ooops! 

    Please login or register to see this link.

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...