bbreton09
(Bbreton09)
December 18, 2022, 2:22pm
1
Hello, do you think it is possible to integrate the DPT 235.001 into the KNX plugin. This contains DPT 13.010 and 5.006+1 data validity byte. The decoding description is avaible here : Particularité du DPT 235.001 - Forum Communauté Jeedom .
Thanks
farmio
(Matthias Alphart)
December 18, 2022, 2:48pm
2
Hi !
Currently we don’t support “compound” DPTs as sensors. It would need a quite big change in how the entity creation works.
You may use a knx_event
trigger in a template sensor and work with the raw payload meanwhile.
Hello,
Do you have any news about this feature?
Thank you
farmio
(Matthias Alphart)
June 17, 2023, 4:24pm
4
Not really.
I did some drafts to see which implementation would fit better for such things… but didn’t come to any conclusion yet.
XKNX:main
← XKNX:dptcomplex
opened 06:27PM - 03 Jun 23 UTC
<!--
You are awesome! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template!.
-->
## Description
<!--
Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context.
List any dependencies that are required for this change.
-->
Use Dataclasses as container for complex DPT values.
The first example is XYYColor.
Pros:
- properly typed, any type supported
- lightweight (in py3.10 I think we can even set it `slotted=True`)
- useable with data validation libraries (eg. pydantic) - maybe outsource dict / json serialisation to external library
- decoupled internal data schema (for use in xknx Devices) from user-visible (HA events etc.)
Cons:
- extra conversion step needed to get from user input (dict / json) to data
- extra step needed to get displayable data (eg. for group monitor) - maybe `dataclass.asdict()` or custom
- extra documentation effort required
Fixes # (issue)
## Type of change
<!--
Please tick the applicable options.
NOTE: Ticking multiple options most likely indicates
that your change is to big and it is suggested to split it into several smaller PRs.
-->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Code quality improvements to existing code or addition of tests
## Checklist
- [ ] The documentation has been adjusted accordingly
- [ ] Tests have been added that prove the fix is effective or that the feature works
- [ ] The changes are documented in the changelog (docs/changelog.md)
XKNX:main
← XKNX:dptdict
opened 06:20PM - 03 Jun 23 UTC
<!--
You are awesome! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template!.
-->
## Description
<!--
Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context.
List any dependencies that are required for this change.
-->
Use TypedDict as container for complex DPT values.
The first example is XYYColor.
Pros:
- readable
- no need to convert from dicts (from user input - eg. HAs `knx.send`) to other type
- can probably be used to auto-create documentation
Cons:
- lots of `dict.get()` needed
no default values supported in TypedDict
- no dot-notation supported
- changing dict-schema would introduce breaking changes in the future (user input schema coupled to data schema)
- no direct validation from user input - would need an extra step
currently `total=False` is used - maybe it would be better to switch to `total=True`
Fixes # (issue)
## Type of change
<!--
Please tick the applicable options.
NOTE: Ticking multiple options most likely indicates
that your change is to big and it is suggested to split it into several smaller PRs.
-->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Code quality improvements to existing code or addition of tests
## Checklist
- [ ] The documentation has been adjusted accordingly
- [ ] Tests have been added that prove the fix is effective or that the feature works
- [ ] The changes are documented in the changelog (docs/changelog.md)
2 Likes
bbreton09
(Bbreton09)
September 8, 2023, 12:14pm
5
HI,
I hope you find a solution. It’s sad not to be able to extract the kwh directly. In any case, thank you for the work done on xknx.