XKNX/xknx

Feature Request : Integration of DPT 235.001 / DPT_Tariff_ActiveEnergy

bbreton09 opened this issue · 19 comments

Hello, do you think it's possible to integrate the DPT 235.001. Is a 6bytes DPT. This contains DPT 13.010 and 5.006+1 data validity byte.

image

Thank you

Hi 👋

Currently we don’t support “compound” DPTs as sensors. It would need a quite big change in how HA entity creation works.

Such a feature could also be used for other DPTs like RBG color etc.

Hi, it's bad new :'( thank you for quick answere.

It's not like this feature wouldn't be welcomed. It's just that someone would need to find time to implement it.

🤔 thinking about that a little bit more, it might actually be trivial to add support for HA events and services (not sensors / entities).
I guess that would be a good start as sensors might get created from templates easily then.

@bbreton09 do you want to start working on that?

🤔 thinking about that a little bit more, it might actually be trivial to add support for HA events and services (not sensors / entities). I guess that would be a good start as sensors might get created from templates easily then.

@bbreton09 do you want to start working on that?

Hi @farmio,

Unfortunately, I'm not a developer at all. I can however test things I have a machine with Hass.io and a module that supports DPT 235.001.

Hi @bbreton09,

could you tell me a little bit more about your usecase with this particular DPT? What would you want to do with it?

@marvin-w

I have a Hager TX230 module which receive the active energy in kWh via teleinfo. Unfortunately this module uses DPT 235.001. Therefore active energy DPT 13.010 is combined with Tariff DPT 5.006. The goal here is therefore to be able to recover the active energy in kWh to use the HA energy module.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please make sure to update to the latest version of xknx (or Home Assistant) and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Hi, any news about this DPT ? How can i help ?

Not shure it help but in jeedom KNX plugin the décoding is make like this:

case "235":
	if ($dpt != "235.001"){
	/*if ($value < 0)
	$value = (abs($value) ^ 0xffffffff) + 1 ; */
	foreach(explode('|',$option["ActiveElectricalEnergy"]) as $tarif => $ActiveElectricalEnergy){
	$value=cmd::byId(str_replace('#','',$ActiveElectricalEnergy))->execCmd();
	$data= array(($value>>24) & 0xFF, ($value>>16) & 0xFF,($value>>8) & 0xFF,$value & 0xFF,$tarif,(0<< 1) & 0x02 | 0);
	}
}
			case "235":
				if ($dpt == "235.001"){
					$value = $data[5] & 0x01;  
					if($value == 1)
					   break; 
					log::add('eibd', 'debug', 'La valeur de la énergie electrique est valide');		
					$value=($data[5]>>1) & 0x01;
					if($value == 1)
					   break;
					log::add('eibd', 'debug', 'La valeur du tarif est valide');	
					if ($option != null){
						if ($option["ActiveElectricalEnergy"] !=''){	
							$ActiveElectricalEnergy=explode('|',$option["ActiveElectricalEnergy"]);
							$Tarif=$data[4];
							log::add('eibd', 'debug', 'Nous allons mettre à jour le tarif '. $Tarif);	
							$ActiveElectricalEnergyCommande=cmd::byId(str_replace('#','',$ActiveElectricalEnergy[$Tarif]));
							if (is_object($ActiveElectricalEnergyCommande)){
								$valeur =$data[0] << 24 | $data[1] << 16 | $data[2] << 8 | $data[3] ;
								if ($valeur >= 0x80000000)
									$valeur = -(($valeur - 1) ^ 0xffffffff);  # invert twos complement    
								log::add('eibd', 'debug', 'L\'objet '.$ActiveElectricalEnergyCommande->getName().' à été trouvé et va être mis à jour avec la valeur '. $valeur);
								$ActiveElectricalEnergyCommande->event($valeur);
								$ActiveElectricalEnergyCommande->setCache('collectDate', date('Y-m-d H:i:s'));
							}
						}
					}
				}
farmio commented

Hi 👋!
No news on this front. The first answer to this issue still applies.
Parsing the payload is not the problem - handling the result down the pipeline in xknx devices, HA entities, services and events etc. is.

Thank you ! Do you know how many time is take to this update is include in haos ?

It will need some changes in the integration code and the frontend too. And some testing would be good too.
So definitely not in the coming release (that's in 2 days).

I did plan to release this as part of a bigger (breaking) change to xknx.