Support DSMR data read via RFXtrx with integrated P1 reader#63529
Conversation
…core into feature/dsmr-rfxtrx
|
Hey there @RobBie1221, @frenck, mind taking a look at this pull request as it has been labeled with an integration ( |
|
I would also suggest to make a documentation PR and link it here. It could use a few words in the documentation. |
RobBie1221
left a comment
There was a problem hiding this comment.
Some suggestions from my side.
Also, it would be good to add a smoke test to test_sensor.py, that would also fix failing CodeCov.
I can't think of much more than just mentioning that the combination of RFXtrx and P1 cable is also supported. |
|
Under chapter "CONNECTING TO THE METER" there are options to make connections. I'd add here that the RFXtrx device is supported. It seems to me useful for users that want to know if the integration supports the device. I think the checkbox is quite self explanatory with above note. |
|
First question: We have an RFXtrx integration... That seems a better fix than putting rfxtrx stuff into the DSMR integration? |
That was exactly my first thought, which is why I started working on Danielhiversen/pyRFXtrx#125. The RFXtrx integration is based on the assumption that one RF packet equals one or more sensor updates in HA. A second problem is that we need to "put DSMR stuff into the rfxtrx integration". After trying for days to "put DSMR stuf into RFXtrx", I started looking at the DSMR integration. I found out that it was trivial to filter and skip the RF related data on the transport level. So "putting RFXtrx into DSMR" turned out to be a much better fit. Extending the API of the In the DSMR integration all it needs to know is whether it reads directly from a P1 port, or via the RFXtrx. |
|
Would it work when using rfxtrx and dsmr integration in parallel on the same serial port? |
No, serial ports can't be shared. Which is the main reason for my comment. |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Please test a create entry result for the new protocol in the config flow.
Added for both serial and network. |
|
Is there anything more I need to do to finish this PR? which does not match the codecov/patch results. I did not touch the not covered lines at all. I do not really understand the lines reported by codecov/patch. It looks to me like the tool is confused. |
|
See #63669 (comment) Config flow requires 100% coverage but since some protocols were tested with import and import code has been completely removed, coverage in the repo is below 100%. |
So, I'm just the unlucky guy that changed something right after this happened? See #65238. |
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Proposed change
ndokter/dsmr_parser#98 adds a new set of API functions to dsmr_parser that allows reading DSMR data from a RFXtrx device with an integrated P1 reader.
The new API functions expect the DSMR telegram to be wrapped up as RF packages and strip away the RF packet headers to get to the actual telegram data. They also discard any non telegram related packets.
This PR makes these new functions available to the DSMR integration by auto-detecting whether using a RFXtrxDSMRProtocol is needed.
It introduces an additional boolean config property, that can be enabled in the config flow, when a RFXtrx with P1 device is used. In this case the code will use the rfxtrx variation of the functions to read the telegram from the DSMR device.Type of change
Additional information
The dependency update to version 0.32 of dsmr_parser that holds the new API functions is already handled in a previous PR.
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: