Z-Wave Hook Question - order?

Posted on
Thu Oct 25, 2018 11:59 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Z-Wave Hook Question - order?

I have set-up hooks in my plugin to intercept Z-Wave received and sent.

Device wakeup gives this in the log:
2018-10-25 18:29:21.914 TRV

TRV Z-WAVE > SENT: 01 09 00 13 69 02 84 08 24 AD 8B (node 105 ACK after 0 milliseconds)
TRV Z-WAVE > TRANSLATION: Name = 'Dining Room - Spirit - Remote - 2', Address = 105, Length = 2, Class = Wakeup


2018-10-25 18:29:21.916 TRV

TRV Z-WAVE > RECEIVED: 01 08 00 04 00 69 02 84 07 1B (node 105)
TRV Z-WAVE > TRANSLATION: Name = 'Dining Room - Spirit - Remote - 2', Address = 105, Length = 2, Class = Wakeup


Assuming I am understanding the Z-Wave messages correctly, it seems to suggest that Indigo sends a Wakeup to the device and then gets an immediate response, which seems unlikely. I thought the device would wakeup and therefore Indigo would receive a response before replying. Is there another hidden interaction that isn't shared with the Z-Wave hook?

Also, it seems that the percentage of valve opening (Spirit Thermostat) is being shown in the UI as one more than the actual value passed back in the message. Is there a reason for this - just checking? Message example:
2018-10-25 18:50:01.358 TRV

TRV Z-WAVE > RECEIVED: 01 09 00 04 00 63 03 26 03 50 E7 (node 099)
TRV Z-WAVE > TRANSLATION: Name = 'Spirit - TRV [Testing 1]', Address = 99, Length = 3, Class = Switch Multilevel, Valve = Open 81%

2018-10-25 18:30:05.896 TRV

TRV Z-WAVE > RECEIVED: 01 09 00 04 00 4A 03 26 03 63 FD (node 074)
TRV Z-WAVE > TRANSLATION: Name = 'Dining Room - Spirit - Thermostat', Address = 74, Length = 3, Class = Switch Multilevel, Valve = Open 100%
To emulate what appears in the Indigo UI, I am adding 1 to the value if is greater than zero. Unless, it is a Z-Wave feature, I would think it would be better to leave the values as is anele 99 then make it 100?

Interpreting the Z-Wave messages is a bit of a black art as far as I am concerned. Is there any simple documentation to aid interpretation of the various messages?

Posted on
Thu Oct 25, 2018 1:13 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Z-Wave Hook Question - order?

autolog wrote:
Assuming I am understanding the Z-Wave messages correctly, it seems to suggest that Indigo sends a Wakeup to the device and then gets an immediate response, which seems unlikely. I thought the device would wakeup and therefore Indigo would receive a response before replying. Is there another hidden interaction that isn't shared with the Z-Wave hook?

Turn on Indigo's internal Z-Wave debug logging and capture the wakup again (along with your logging). I'll better be able to figure out / explain what is going on seeing both logs captured.

autolog wrote:
Also, it seems that the percentage of valve opening (Spirit Thermostat) is being shown in the UI as one more than the actual value passed back in the message. Is there a reason for this - just checking?

I agree it is a bit odd, but from the spec:

Code: Select all
The Multilevel Switch value 0x00 MUST represent the least light, i.e. covering fully closed. The Multilevel Switch value 0x63 MUST represent the most light, i.e. covering fully opened.

So the range is 0 to 99, which Indigo then internally scales for the UI (and its device state) using:

Code: Select all
int(round(100.0 * (statusByte / 99.0)))

Image

Posted on
Thu Oct 25, 2018 1:41 pm
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Z-Wave Hook Question - order?

matt (support) wrote:
Turn on Indigo's internal Z-Wave debug logging and capture the wakup again (along with your logging). I'll better be able to figure out / explain what is going on seeing both logs captured.


As requested, here is a log snippet :) :
Code: Select all
2018-10-25 20:35:59.747   Z-Wave Debug   RCVD nodeAwake: 01 08 00 04 00 65 02 84 07 17
2018-10-25 20:35:59.747   Z-Wave Debug   . .  nodeAwake: node 101
2018-10-25 20:35:59.748   Z-Wave Debug   . . . . . . . : skipping battery check (next check in 712 mins)
2018-10-25 20:35:59.748   Z-Wave Debug   SENT goToSleep: 01 09 00 13 65 02 84 08 24 24 0E
2018-10-25 20:35:59.760   TRV   


TRV Z-WAVE > SENT: 01 09 00 13 65 02 84 08 24 24 0E (node 101 ACK after 0 milliseconds)
TRV Z-WAVE > TRANSLATION: Name = 'Spirit - Remote Thermostat [for Testing 1]', Address = 101, Length = 2, Class = Wakeup


2018-10-25 20:35:59.762   TRV   


TRV Z-WAVE > RECEIVED: 01 08 00 04 00 65 02 84 07 17 (node 101)
TRV Z-WAVE > TRANSLATION: Name = 'Spirit - Remote Thermostat [for Testing 1]', Address = 101, Length = 2, Class = Wakeup


2018-10-25 20:35:59.767   Z-Wave Debug   RCVD packet: 01 07 00 13 24 00 00 02 CD (hex)
2018-10-25 20:36:00.891   Z-Wave Debug   RCVD nodeAwake: 01 08 00 04 00 41 02 84 07 33
2018-10-25 20:36:00.892   Z-Wave Debug   . .  nodeAwake: node 065

Posted on
Thu Oct 25, 2018 2:13 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Z-Wave Hook Question - order?

Okay, so this one is a bit particular:

Incoming (received) commands are broadcasted to plugins after they are done being parsed and processed.

Outgoing (sent) commands are broadcasted to plugins after they are sent.

Normally that does what one would expect, but in this case part of the "processing" part of the incoming command is to immediate tell the module to go to sleep. No queue is used as it is a priority command (the faster the module receives the sleep command, the less battery drain there will be). So in this case the goToSleep command is broadcasted to the plugins before the received hey-I-am-awake command.

I agree that is counter-intuitive and not really what you probably want. Changing it would be non-trivial, unfortunately. The obvious solution of broadcasting out received commands first (before processing) presents its own problems, so I think to fix it I would have to batch-up the send command broadcasting to be occur after all the processing is complete. Doable, but given all the places and depths the sending can occur it isn't as easy as I would like. On a scale of 1 to 10, how badly do you need the order in this case (and other cases where you are having problems) to be flipped? 1: no problem, 3: tiny problem but easy to live with, 5: meh, 7: can work around it with moderate pain, 10: please fix ?

Image

Posted on
Thu Oct 25, 2018 3:27 pm
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Z-Wave Hook Question - order?

matt (support) wrote:
... On a scale of 1 to 10, how badly do you need the order in this case (and other cases where you are having problems) to be flipped? 1: no problem, 3: tiny problem but easy to live with, 5: meh, 7: can work around it with moderate pain, 10: please fix ?

It isn't actually causing me any problem, it was just that I couldn't understand it and thought maybe I was misunderstanding how it was meant to work.

So the answer to your question is: 1: no problem :)

Thanks for the detailed explanation. :D

Posted on
Thu Oct 25, 2018 3:34 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Z-Wave Hook Question - order?

That is the answer I was hoping for! :)

Image

Posted on
Thu Oct 25, 2018 4:16 pm
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Z-Wave Hook Question - order?

I’m curious. Where does one order a Z-Wave hook? I’m trying to figure out what I could use it for.

Code: Select all
received “Front Coat Closet” sensor update to “Coat Removed”



Sent from my iPhone using Tapatalk

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Oct 26, 2018 6:55 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Z-Wave Hook Question - order?

The SDK has an example plugin that catches the 2 Z-Wave broadcasts (one for commands received, another for commands sent).

Image

Posted on
Sat Oct 27, 2018 6:01 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Z-Wave Hook Question - order?

Hi Matt,
Further to the discussion on the range 0-99.

The Spirit thermostat is using the range 0 to 98 = 0 to 98 and 99 = 100. I can see this because the Spirit displays the amount of valve percentage in its LED display. So for higher numbers (above 50), Indigo's algorithm makes its UI to be out by one e.g. Indigo shows 76, the Spirit shows 75. :)

Not important in the scheme of things but thought I should bring it to your attention. :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 9 guests