LiXee ZLinky_TIC DDF File

Is a PR possible?
Because it’s annoying to have to edit the general.xml file and add generic device files state_xxx.json. I guess these custom files are lost with every deCONZ update.

Sure, you can submit all PR you want, the problem is all are not valided ^^.
Separe them, I m almost sure a PR with changes on general.xml will be valided, especially since most of them are on cluster 0xff66, so they haven’t impact on other device.
If I m right you have one on the cluster 0x0702 ?
Can make like for this one

        <attribute-set id="0x0300" description="Develco specific" mfcode="0x1015">
          <attribute id="0x0300" name="Pulse Configuration" type="u16" access="rw" required="o" mfcode="0x1015"></attribute>
          <attribute id="0x0301" name="Current Summation" type="u48" access="w" required="o" mfcode="0x1015"></attribute>

Now I m almost sure the new field like “state/ngtf_optarif” will be not accepted, I have already tried with less specific field, and PR are still in waiting list since months.

And without them, the complete DDF miss too much features.

ok I will propose the PR(s).
I can’t read anywhere if ZHA or Z2MQTT sends this information, apart from the counters wh A et V.

Hello, I made a DDF for the ZLinky module which works in ‘historique’ and ‘standard’ mode, single-phase and three-phase as well as production mode. My linky is in ‘historique’ mode. If anyone is interested in testing the DDF in ‘standard’ mode, I can help you set it up. I’m interested in feedback on how it works.

How can I make the necessary PRs? I don’t know how to request changes in general.xml. I don’t want to lose everything in the next deCONZ update.

If you haven’t already done a PR and have only 1 file to edit, it’s so easy.
Just go on the file deconz-rest-plugin/general.xml at master · dresden-elektronik/deconz-rest-plugin · GitHub

And try to edit the file using the browser.

You will have a message saying you haven’t right, so github will create a Fork under your Girhub account witht your change and start to create the PR.
Don’t worry rollback are possible. When the PR is done the files are linked, so you can edit the file on your fork and the change will be visible on the PR in same time, so easy to edit.

Else if you have problem, just give me the file you are using I can make the PR.

Yes, I did that for a NodOn pilot wire DDF. The case is more complicated for the ZLinky. There is one DDF file, the general.xml file to complete and six state.xxx.item.json files to add for the DDF to work for all Linky modes.
I can do the files one by one, but it’s a set to make it work.
If this is the method, I can do the eight PRs by following the method you explain.

Eight PR ? ^^

I think you can do a PR for the general.xml, this one have 99% chance to be valided
One more PR for all state.xxx.item.json, but for me thoses one will be not valided, here for exemple DDF for Sonoff ZBMini R2 Extreme (ZBMINIR2) by duffbeer2000 · Pull Request #8034 · dresden-elektronik/deconz-rest-plugin · GitHub a PR blocked just because a config_on_delayedpoweron_item.json

And without thoses one a PR for the device is useless, so for me the DDF need to be with the state.xxx.item.json.

If you have already done a PR, better to delete your fork, and create a new one.
Then create a new branch How To Create a New Branch In GitHub? - Blog | GitProtect.io
Call it for exemple general_xml
Edit the general.xml file
Then you can do the PR procedure, Pull Request/New pull request up to have something like That

Here the branch is called HS2IRC
And after it’s always the green button.

For the next PR, create a new branch again
To make it simple, 1 branch > 1 PR, and you can edit more than 1 file by branch

NEVER make change on the “master” branch, always on new one.

I didn’t understand that sentence:

I didn’t make a PR.
I wrote a PHP script that reverts my changes to general.xml and restores my state.xxx.item.json files if deCONZ has been updated. But it would be so much better with a PR that validates everything.

Devs are realy shy to add new field, so few chance they accept the PR to add a state.xxx.item.json.

And without thoses fieds the Full DDF can’t work.

Ok. I wrote a php script that allows me to use my DDF and add my state.xxx.item.json files as well as the necessary modifications in general.xml. The php script checks for the presence of a line in general.xml. If the line is missing, in the case of a first installation or an update of deCONZ, the script restores all my necessary modifications. It works well. The script is made for the Synology docker version. It is easily adaptable for anyone who wants to use it.

function fix_lixie_files()
{
	### check update
	$path = [$_SERVER['DOCUMENT_ROOT'].'/volume1/@docker/btrfs/subvolumes/', '/usr/share/deCONZ/zcl/', '/usr/share/deCONZ/devices/generic/items/', $_SERVER['DOCUMENT_ROOT'].'/volume1/docker/deconz_backup/items/'];
	$scan = scandir($path[0]);
	foreach ($scan as $num => $name) if (file_exists($path[0].$name.$path[1].'general.xml') && str_contains($name, '-init') == false && str_contains($scan[$num+1], '-init') == false) break;
	$xmlPath = $path[0].$name.$path[1]; // general.xml folder
	$jsonPath = $path[0].$name.$path[2]; // state.xxx.item.json folder
	$xml = file_get_contents($xmlPath.'general.xml');
	$xmlOld = $xml;
	$add = ['<attribute id="0x0001" type="cstring" name="Couleur de demain" access="r" required="m"/>',
			'<attribute id="0x0010" type="cstring" name="Période tarifaire" access="r" required="m" default="0x00"/>',
			'  <attribute id="0x0020" name="PTEC Période Tarifaire en cours" type="cstring" access="r" required="m"></attribute>'];
	if (substr_count($xml, $add[1]) == 1) return;
	
	### fix general.xml in docker
	echo date('d/m/Y H:i:s').' deCONZ container updated, fixes files for Zlinky...'."\n";

	$src = ['<attribute id="0x0000" type="cstring" name="Option tarifaire" access="r" required="m"/>',
			'<attribute id="0x0008" type="u16" name="Avertissement de Dépassement D\'intensité P3" access="r" required="m" default="0x00"/>',
			'<attribute id="0x0001" name="Current Summation Received" type="u48" access="r" required="o"></attribute>'];
	foreach($src as $num => $name)
	{
		if (substr_count($xml, $name) == 1 && substr_count($xml, $add[$num]) == 0) $xml = str_replace($name, $name."\n".'		'.$add[$num], $xml);
		else echo 'Check line '.$add[$num].' in general.xml'."\n";
	}
	if ($xml != $xmlOld) file_put_contents($xmlPath.'general.xml', $xml);
	
	### copy item.json files in docker
	$items = ['state_demain_item.json', 'state_ltarf_item.json', 'state_ngtf_optarif_item.json', 'state_ntarf_item.json', 'state_optarif_item.json', 'state_stge_item.json', 'state_tariffPeriod_item.json'];
	foreach ($items as $item) copy($path[3].$item, $jsonPath.$item);
	echo date('d/m/Y H:i:s').' The files are fixed. You need to Stop/Reset/Start the container ...'."\n";
	return;
}

I’ve provided the necessary state.xxx.item.json files above. The script retrieves them from a folder and copies them to the correct deCONZ folder.

But for the “general.xml” change, I think you can make a PR, there is 98% of chance for the PR be valided.

Ok, I made a PR for general.xml file
Do you know when the next update is planned?

Manup is correcting so much issue ATM, the project is moving.
I can’t guess a date, but I think the next one will be in less than 1 month (but can be a Beta)