Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting status bits in send messages #41

Closed
LarsKoeppel opened this issue May 13, 2023 · 5 comments
Closed

Setting status bits in send messages #41

LarsKoeppel opened this issue May 13, 2023 · 5 comments

Comments

@LarsKoeppel
Copy link

Hello,

i use HA_enoceanmqtt which builds on enocean-mqtt to integrate and control my devices in Home Assistant.
As described in this discussion, my shutter only seems to respond to messages that have the status bits set correctly. So my question is if it would be possible to implement this functionality in enocean-mqtt.

Best regards

@romor
Copy link
Member

romor commented May 15, 2023

I read the discussion in the linked thread but I do not really understand what is missing.
The packet data are set using set_eep() in the underlying enocean library.

Are the status bits present there in the EEP profile and supported?
It is not my intention to forward you one more time, but I guess this topic is more related to the enocean library?

@LarsKoeppel
Copy link
Author

Hi @romor,

the status bits are present in the EEP and are requered from enocean. I used this EEP with this specification.
As can be seen in the debug output in the other discussion, the status bits are not taken into account in the array of data to be sent, which is why I assumed that it was already ignored when the message was created. Or is the message to be sent created in the enocean library? Is this methode used to generate the message to send?

This is the message from debug, in the other discussion:

['0xf6', '0x70', '0xff', '0xab', '0xf3', '0x1', '0x0']
[<EEP>, <data>, <sender>, <sender>, <sender>, <sender>, <status bits>]

And the status bits should be in this case a 0x30.

@mak-gitdev
Copy link
Contributor

mak-gitdev commented May 16, 2023

Hi @romor, Hi @LarsKoeppel

I think I found the problem.
The problem I think, comes from the set_eep() function which does not set the status bits of the packet.
The status bits have to be appended to the packet data in the same manner as it is done here.

As we use ERP1 and its DATA structure is always [<RORG><PAYLOAD><SENDER><STATUS>], we could solve this issue in communicator.py by adding after L461

packet.data[-1] = packet.status

@romor, is this OK for you or do you have a better idea ? If OK, do you want me to make the pull request ?

@romor
Copy link
Member

romor commented May 16, 2023

@mak-gitdev, thanks for your support!

I still do not fully understand why the status bits are not set within set_eep(). Is this intentionally not done there or just missing?

However, I trust in your proposal and for me it's fine to add it here, even if it is a work-around. Feel free to raise a pull request.

@mak-gitdev
Copy link
Contributor

@romor, I am as baffled as you are but I think it is done intentionally because in the Packet.create() function, the data payload is first set with the set_eep() function, then the status bits are set separately as aforementioned.

Ok for the pull request. Thanks.

mak-gitdev added a commit to mak-gitdev/enocean-mqtt that referenced this issue May 21, 2023
Set status bit when sending message.
See embyt/enocean-mqtt/embyt#41 for more details.
romor added a commit that referenced this issue May 25, 2023
@romor romor closed this as completed May 25, 2023
mak-gitdev added a commit to mak-gitdev/HA_enoceanmqtt that referenced this issue Jun 5, 2023
- Latest enocean-mqtt version which fixes status bits setting (see #65 and embyt/enocean-mqtt#41 for more details)
- From now, use mak-gitdev/enocean as Python EnOcean Library which fixes "list index out of range error" thanks to @kridgo patch (see kipe/enocean#134 and kipe/enocean#138 for more details).
- Add virtual A5-10-06 (#46)
- Add '%' as unit of measurement for A5-20-01 current value field (#53)
- Update F6-02-[01-02] mapping to send status bits thanks to @LarsKoeppel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants