embyt / enocean-mqtt

Receives messages from an enOcean serial interface (USB) and provides selected messages to an MQTT broker.
GNU General Public License v3.0
42 stars 21 forks source link

MQTT topic /switch/R1 -- Button 0 same as RELEASE Code 0 #5

Closed ozett closed 5 years ago

ozett commented 5 years ago

hi, on the Topic /switch/R1 the Button Number of the pressed button from 4 button-switch is published. But on RELEASE, it got the same 0 (means Zero) as the button number 0 (means zero).

i cannot trigger anything on a single button number from this topic, as it confuses the button nummer 0 with a 0 for release. (i dont want to combine two topics as it would complicate things)

could that be changed? or am i on the wrong track? another way to get around this?

many thx for help...

image

ozett commented 5 years ago

i tried simply to edit the EEP.xml, mcedit /usr/local/lib/python3.4/dist-packages/enocean-0.41-py3.4.egg/enocean/protocol/EEP.xml

but run into an error...this did not work

image

romor commented 5 years ago

The EnOcean message profile descriptions are documented here. You may need to study it to understand the messages.

The interpretation of the EnOcean messages is done by the used EnOcean library. For such topics you better raise the questions there.

ozett commented 5 years ago

thanks for reply, i had a (simply) quick lock at both sources, i think the actual behavior is pretty enocean standard and ok.

what helped me would be to have just one simple mqtt-topic, on which i can clearly trigger actions if (and only) one of the rocker-button is pressed. as enocean-mqtt is coded i think: actually i would have to combine programmatically two topics to identify a bressed button, which could raise some more problems at another place.

to say it another way: it could be helpful to have a MQTT payload or topic, on which one could clear identify with a single message 1)if and 2)which button is pressed.

this mapping/topic seems to me could come from enocean-mqtt, because i seems to be a design-question how mqtt-messages a generated an send from the enocean-standard and underlying libs..

what do you thing?

romor commented 5 years ago

Subject of the enocean-mqtt library is to forward EnOcean packets to mqtt and vice versa.

While I understand your problem and request, I do not think that it is a good approach to implement device specific adaptations in a generic library. Probably you could adapt/derive it to extend such custom behaviour.