Home Automation - Roller Shutter

Discussions about RaZberry - Z-Wave board for Raspberry computer
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Home Automation - Roller Shutter

Post by pofs »

jayce wrote:But the better solution is that zway add it automaticly.
Automatically add what? Command classes from XML file?
I do not agree. XML file may contain whatever info, and also it can be assigned wrong.
Also XML file assignment can be changed any time, so what to do to previously added commands then? Remove them? Keep them? It is just an overcomplicating of the logic and increase of entropy (junk data) in the config file.

NIF is a master source of information about command classes supported by device. It is a pity that a few devices announce their NIF wrong, but since it can be fixed by just making one http request, I don't see any reason to change anything.
jayce
Posts: 25
Joined: 21 Aug 2014 23:11

Re: Home Automation - Roller Shutter

Post by jayce »

And what is the solution ? (many users are using fibaro device)
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Home Automation - Roller Shutter

Post by pofs »

Something like:

Code: Select all

http://ip:8083/JS/Run/zway.devices[x].data.nodeInfoFrame.value=zway.devices[x].data.nodeInfoFrame.value.concat(0x26)
Then force re-interview for device (just thought that the new CC won't appear without re-interview, so you cannot just re-interview specific CC).

In the end run

Code: Select all

http://ip:8083/JS/Run/zway.devices.SaveData()
to make sure everything is saved and flushed to the SD card.
Last edited by pofs on 16 Sep 2014 16:28, edited 3 times in total.
jayce
Posts: 25
Joined: 21 Aug 2014 23:11

Re: Home Automation - Roller Shutter

Post by jayce »

Ok thx i test it tonight.
What is the utility of the xml files (which are the same that the pepper.net db) ?
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Home Automation - Roller Shutter

Post by pofs »

jayce wrote:What is the utility of the xml files (which are the same that the pepper.net db) ?
Device description and image, config parameters, alarm mappings…
jayce
Posts: 25
Joined: 21 Aug 2014 23:11

Re: Home Automation - Roller Shutter

Post by jayce »

Not used for the classes. ok Thx
jayce
Posts: 25
Joined: 21 Aug 2014 23:11

Re: Home Automation - Roller Shutter

Post by jayce »

The problem is not solving with this commands
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Home Automation - Roller Shutter

Post by pofs »

Assuming you've replaced "x" with a valid device id, please show the corresponding log fragment.
jayce
Posts: 25
Joined: 21 Aug 2014 23:11

Re: Home Automation - Roller Shutter

Post by jayce »

Here is my log. Device 4 is my roller shutter.
Attachments
export.zip
(3.9 KiB) Downloaded 332 times
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Home Automation - Roller Shutter

Post by pofs »

Oh, I see.
It just stops on the CC divider 0xEF, so you need to insert it in the middle of the array rather than append in the end:

Code: Select all

var nif=zway.devices[4].data.nodeInfoFrame.value;
var toAdd=0x26;
var pos=nif.indexOf(0xEF);
if (pos >= 0)
  nif = nif.slice(0,pos).concat(toAdd).concat(nif.slice(pos));
else
  nif = nif.concat(toAdd);
zway.devices[4].data.nodeInfoFrame.value=nif;
Now if you urlencode it, you'll get a command to execute:

Code: Select all

http://ip:8083/JS/Run/var%20nif%3Dzway.devices%5B4%5D.data.nodeInfoFrame.value%3B%0Avar%20toAdd%3D0x26%3B%0Avar%20pos%3Dnif.indexOf(0xEF)%3B%0Aif%20(pos%20%3E%3D%200)%0A%20%20nif%20%3D%20nif.slice(0%2Cpos).concat(toAdd).concat(nif.slice(pos))%3B%0Aelse%0A%20%20nif%20%3D%20nif.concat(toAdd)%3B%0Azway.devices%5B4%5D.data.nodeInfoFrame.value%3Dnif%3B
Last edited by pofs on 17 Sep 2014 21:56, edited 2 times in total.
Post Reply