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

No mqtt message outgoing #1

Closed HarterHorst closed 6 years ago

HarterHorst commented 7 years ago

Hi, i have a problem with outgoing mqtt messages. Button is recognised, but no mqtt message is generated.

Any ideas?

Logfile

2017-06-27 16:31:53,242 INFO: Connected to MQTT broker with result code 0 2017-06-27 16:31:53,243 INFO: SerialCommunicator started 2017-06-27 16:31:53,244 WARNING: Replacing Packet.optional with default value. 2017-06-27 16:31:53,352 INFO: Sending packet 2017-06-27 16:31:53,353 DEBUG: 0x05 ['0x8'] [] OrderedDict() 2017-06-27 16:31:53,455 DEBUG: 0x02 ['0x0', '0xff', '0xb0', '0x72', '0x80'] ['0xa'] OrderedDict() 2017-06-27 16:31:53,456 INFO: got response packet: OK 2017-06-27 16:32:01,299 DEBUG: FE:F9:59:1B->FF:FF:FF:FF (-45 dBm): 0x01 ['0xf6', '0x30', '0xfe', '0xf9', '0x59', '0x1b', '0x30'] ['0x3', '0xff', '0xff', '0xff', '0xff', '0x2d', '0x0'] OrderedDict() 2017-06-27 16:32:01,301 INFO: received: FE:F9:59:1B->FF:FF:FF:FF (-45 dBm): 0x01 ['0xf6', '0x30', '0xfe', '0xf9', '0x59', '0x1b', '0x30'] ['0x3', '0xff', '0xff', '0xff', '0xff', '0x2d', '0x0'] OrderedDict() 2017-06-27 16:32:01,303 INFO: learn request received 2017-06-27 16:32:01,471 DEBUG: FE:F9:59:1B->FF:FF:FF:FF (-45 dBm): 0x01 ['0xf6', '0x0', '0xfe', '0xf9', '0x59', '0x1b', '0x20'] ['0x3', '0xff', '0xff', '0xff', '0xff', '0x2d', '0x0'] OrderedDict() 2017-06-27 16:32:01,473 INFO: received: FE:F9:59:1B->FF:FF:FF:FF (-45 dBm): 0x01 ['0xf6', '0x0', '0xfe', '0xf9', '0x59', '0x1b', '0x20'] ['0x3', '0xff', '0xff', '0xff', '0xff', '0x2d', '0x0'] OrderedDict() 2017-06-27 16:32:01,475 INFO: learn request received

Config file

# the general section defines parameter for the mqtt broker and the enocean interface [CONFIG] enocean_port = /dev/ttyAMA0 log_packets = 1

mqtt_host = 192.168.0.2 mqtt_port = 1883 # the prefix is used for the mqtt value names; this is extended by the sensor name mqtt_prefix = enocean/ # optionally also set mqtt_user and mqtt_pwd

# all other sections define the sensors to monitor

[Schalter] address = 0xFEF9591B rorg = 0xF6 # BS1 func = 0x02 type = 0x01

romor commented 7 years ago

I see two issues:

HarterHorst commented 7 years ago

I clearly missed some important basics regarding the protocol. Do you have a shortcut?

What do I have to do to make my Eltako FT55 (PTM215 DB) sending non-learning requestsel? Any hints and links appreciated.

romor commented 7 years ago

I also would not expect that teach-in requests are sent by a switching actuator. Maybe this discussion could also be raised in the enocean library (https://github.com/kipe/enocean), which parses the RF packet.

Details on enocean protocol: http://www.enocean.com/esp

ozett commented 6 years ago

hi, i found the same problem, followed the bug description to the originating library and issue-discussion. but i am puzzled. i did not get it, if there was a solution or only discussion .... maybe one could post here, if there is a solution to this problem of the etako switch.. thanks

ozett commented 6 years ago

i have limited enocean knowledge, just started. i followed to the lib: https://github.com/kipe/enocean changed the hardcoded /dev/AMA0 to my usb200 /dev/ttyUSB0 and let it running. no messages of learning mode. looks good. 😁

my conclusion: somewho it is working.. but why not mqtt messages? still a bug? a missing feature?

the enocean lib seems ok for the entako switch ...

anybody with a hint?

romor commented 6 years ago

I think this topic is still open. The enocean library sets the learn flag as a default and the maintainer will not change this (#66).

This library does not emit mqtt messages on learning requests but only on "normal" messages.

ozett commented 6 years ago

maybe one more post to clarify this?

as i trigger the switch with the library-tools, i see some infos about the button-click, but nothing about the "learing" mode.

with yout tool using the library, i see something about "learing" mode. and if if follow the issue on the library-thread, the reasons seems that there is a "profile" missing..

i dont know how to implement such a profile, but maybe that could help`?

romor commented 6 years ago

The enocean lib sets the learn bit but does not log this. A new profile will not help.

If you are willing to test this I can add an option to also forward learn requests to mqtt.

ozett commented 6 years ago

Yes, please.

if you implement forwarding, than i could test if the button press in the default (learning) state of my eltako ft55-rw (which includes the enocean ptm 215) would be send to mqtt.

that would solve my simple case...: "button-press -> mqtt-message" 😁

romor commented 6 years ago

Commit d2dea8e introduces a new config file option log_learn. If this is set for a specific sensor, this will also forward learn packets to mqtt.

Please give feedback whether this works for you as I do not own such a device for testing.

ozett commented 6 years ago

hey, wonderful. thanks. i will see if i can test this tomorrwo or on the weekend. as soon as is have a result, i will report back here.

romor commented 6 years ago

I assume this can be closed now.