hansrune / homely-tools

Homely alarm tools
GNU Affero General Public License v3.0
14 stars 1 forks source link

MQTT authentication #3

Open peslung opened 2 years ago

peslung commented 2 years ago

Just got Homely installed, only smoke detectors. No alarm installed, maybe later. I have Home Assistant in use and wanted to get the status from the smoke detectors, entities like temperature, battery, LQI signal etc.

Your code were almost perfect for this! Except I needed MQTT username and password. Almost never used python before, but added it directly in your code.

mq = mqtt.Client(progname) mq.username_pw_set(mqtt_username,mqtt_pwd) mq.connect(args.mqttserver, port=args.mqttport, keepalive=600) mq.loop_start()

The MQTT connections is successful and I can see some entities created, only temperature so far and not all have values. Will this service only write entities and values if they change?

peslung commented 2 years ago

All entities is updating fine in HA now.

Device sensor values for LQI/signal, battery, tampered and online status should maybe be separated to to specific sensors/entities in HA instead of one for all. E.g. the entity "homely_device links" changes it's value each time one random sensor reports the signal. Would be nice to see wich sensor have bad or good signal strength.

Screenshot_20221005_200522