homie-python
homie-python copied to clipboard
Homie (0.4.1)? no attribute mqtt_topic
Just going to look at moving an old script that runs as two pythong scripts, one for tmp one for fan control to homie.
It had been a while, so i performed a pip install --upgrade homie and it lists in pip as .4.1
But upon running I'm getting:
Setting up GPIO ports
GPIO ports set up on port 18
Starting homie
Traceback (most recent call last):
File "mqtt.homie.fancontrol.py", line 93, in <module>
main(args.configfile)
File "mqtt.homie.fancontrol.py", line 41, in main
Homie = homie.Homie(configfile)
File "/usr/local/lib/python2.7/dist-packages/homie/main.py", line 74, in __init__
self._initAttrs(config)
File "/usr/local/lib/python2.7/dist-packages/homie/main.py", line 119, in _initAttrs
config.get(
AttributeError: 'str' object has no attribute 'get'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/local/lib/python2.7/dist-packages/homie/main.py", line 462, in _exitus
self.mqtt_topic + "/$online",
AttributeError: 'Homie' object has no attribute 'mqtt_topic'
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/local/lib/python2.7/dist-packages/homie/main.py", line 462, in _exitus
self.mqtt_topic + "/$online",
AttributeError: 'Homie' object has no attribute 'mqtt_topic'
Which seems to be part of the homie framework. my config as follows:
{
"HOST": "localhost",
"PORT": 1883,
"KEEPALIVE": 10,
"USERNAME": "",
"PASSWORD": "",
"CA_CERTS": "",
"DEVICE_ID": "cupboard",
"DEVICE_NAME": "cupboard",
"TOPIC": "sensors/dht",
"dht": {
"frequency": 300,
"pin": 4
},
"relay": {
"pin": 18,
"log": "/var/log/mqtt/fancontrol-homie.log"
}
}
Any ideas? Here's the code https://github.com/psyciknz/OpenHAB-Scripts/blob/master/mqtt.homie.fancontrol.py