embyt / enocean-mqtt

Receives messages from an enOcean serial interface (USB) and provides selected messages to an MQTT broker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError: 'mqtt_host'

ozett opened this issue Β· comments

commented
root@eg-buero-olaf:/usr/src/enocean-mqtt# enoceanmqtt
Traceback (most recent call last):
  File "/usr/local/bin/enoceanmqtt", line 9, in <module>
    load_entry_point('enoceanmqtt==0.1.0', 'console_scripts', 'enoceanmqtt')()
  File "/usr/src/enocean-mqtt/enoceanmqtt/enoceanmqtt.py", line 105, in main
    com = Communicator(conf, sensors)
  File "/usr/src/enocean-mqtt/enoceanmqtt/communicator.py", line 41, in __init__
    self.mqtt.connect_async(self.conf['mqtt_host'], port=int(self.conf['mqtt_port']),
KeyError: 'mqtt_host'
root@eg-buero-olaf:/usr/src/enocean-mqtt#

any hint on this? i checked out latest version today and used the sample.conf

commented

It seems that the config file was not read.

Did you follow this step from the installation section in the readme?:

adapt the enoceanmqtt.conf.sample file and put it to /etc/enoceanmqtt.conf

commented

thanks for fast solution πŸ˜„
i try to put the config into /etc.

i upgraded from version 0.1.0 and did not notice this chance, because in old version the config did not have to be in /etc...

image

i will report my findings.. πŸ˜„

commented

"can" make a udev-device?
seems that i "must" make a udev-device...
i will try again

image

commented

i set it all up now. but no verbose messages anymore... it there an option for debug-output?

image

You can include the "--debug" command line option or set "debug = true" to the "[CONFIG]" section, to get the debugging logs on the console. Hmm, I forgot to document this option in enoceanmqtt.conf.sample when I updated logging in my PR, although it does show you that this option is available in the output enoceanmqtt --help.

commented

yes, thanks.
just a second ago i found cmd-line options in the source here:
https://github.com/romor/enocean-mqtt/blob/840c304dc134be26ff1867b87dd1bae83c949b28/enoceanmqtt/enoceanmqtt.py#L19

i will try

commented

almost there... i get responses from the rocker.
but i am a bit clueless how to handle/stop this "learning-modes" (even after a jear.., sorry.)
any hints for me?

image

commented

i think i go a one year circle and come back to #1

a little bit unsure, how to use the syntax of this option: log_learn
(i will search the source..)
---update:
https://github.com/romor/enocean-mqtt/search?q=log_learn&unscoped_q=log_learn

commented

Up and running!
πŸ˜„ πŸ‘

image

commented

"can" make a udev-device?
seems that i "must" make a udev-device...

In the config file, you can configure enocean_port to e.g. /dev/ttyUSB0. Then you do not need to configure udev.

However, the device name may change if you have multiple devices connected to USB, so the udev rule is preferable.