Homey Community Forum

MQTT Hub/Gateway

#21

Did you install the BETA version of the MQTT client?

0 Likes

#22

I have the same issue as Stefan.
I have the beta app MQTT Client (v.2.2.0) and MQTT Gateway (v.2.0.0).

I do get something but no state changes, I receive this topic in node red but nothing else.
“Homey/unknown/home/system/general/state”

Rgds
John

0 Likes

#23

Yes, I have MQTT Client 2.2.0 beta.

Wen I restarted the Gateway app yesterday I now se that something (guessing the Gateway) transmitted:

homey_36af8cb2/status : Offline
homey_bac54d07/status : Offline
homey_79335a9b/status : Offline

I cant find anything i those “codes” which refers to any of my devices tough.

Just now i restarted the MQTT Client and now I’a also getting:

“Homey/unknown/home/system/general/state” containing the systemstatus

every 30 seconds so at least it’s transmitting something now :slight_smile: But still no devise state change och update.

0 Likes

#24

Same config and problem here.

0 Likes

#25

I was very excited after discovering the MQTT Gateway; this would be great for easy integration of some Node Red stuff. But here (using v1.00) it’s also not working. I installed through the CLI to get some extra info on what the programm is doing.

Rights after starting the app I see the following:

Blockquote
.< snip >.
20190118-10:47:28 Aqara Temperature and Humidity Sensor: aqara_temperature_and_humidity_sensor
20190118-10:47:28 subscribing to topic: homey/command
20190118-10:47:28 Devices registered
20190118-10:47:28 FlowTriggerDispatcher: not implemented
20190118-10:47:28 subscribing to topic: homey/+/+/+/+/describe
20190118-10:47:28 subscribing to topic: homey/+/+/+/+/request
20190118-10:47:28 subscribing to topic: homey/+/+/+/+/update
Notification added
Error: not_found
at function.r.__client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
Notification added
Error: not_found
at function.r.__client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
Notification added
Error: not_found
at function.r.__client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
Notification added
Error: not_found
at function.r.__client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)
at
at process._tickCallback (internal/process/next_tick.js:189:7)

And after that I get messages like these on every state change:

Blockquote
.< snip >.
20190118-10:53:04 object Message
20190118-10:53:04 PROPERTIES: {
“qos”: 0,
“retain”: false,
“mqttTopic”: “sensor/keuken/motion_sensor_keuken/alarm_motion/state”,
“mqttMessage”: true
}
20190118-10:53:05 sensor/keuken/motion_sensor_keuken/alarm_motion/state: true
20190118-10:53:05 object Message
20190118-10:53:05 PROPERTIES: {
“qos”: 0,
“retain”: false,
“mqttTopic”: “sensor/keuken/motion_sensor_keuken/measure_luminance/state”,
“mqttMessage”: 209
}
20190118-10:53:05 sensor/keuken/motion_sensor_keuken/measure_luminance/state: 209
20190118-10:53:05 object Message
20190118-10:53:05 PROPERTIES: {
“qos”: 0,
“retain”: false,
“mqttTopic”: “sensor/keuken/motion_sensor_keuken/alarm_battery/state”,
“mqttMessage”: false
}
20190118-10:53:05 sensor/keuken/motion_sensor_keuken/alarm_battery/state: false
20190118-10:53:05 object Message
20190118-10:53:05 PROPERTIES: {
“qos”: 0,
“retain”: false,
“mqttTopic”: “sensor/keuken/motion_sensor_keuken/measure_battery/state”,
“mqttMessage”: 79
}
20190118-10:53:05 sensor/keuken/motion_sensor_keuken/measure_battery/state: 79
(node:20758) UnhandledPromiseRejectionWarning: Error: not_found
at function.r.__client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:20758) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 16)
(node:20758) UnhandledPromiseRejectionWarning: Error: not_found
at function.r.__client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:20758) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 17)
(node:20758) UnhandledPromiseRejectionWarning: Error: not_found
at function.r.__client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:20758) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 18)
(node:20758) UnhandledPromiseRejectionWarning: Error: not_found
at function.r.__client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:20758) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 19)

I really hope this can be sloved, a program like this would really make integration with other software (like dashboards) a lot easier. So I hope you’ll find the time!

TIA, cheers,
/Cacti

0 Likes

#26

Greet feedback guys! I’ll try to address some of these issue this evening. I did not yet upgrade my Homey tot 2.0. So some of the issues are hard to reproduce. Maybe @scanno can assist here.

0 Likes

#27

Hi,

I upgraded to the Beta version of MQTT Client (nl.scanno.mqtt version 2.2.0) and now it’s working!!! Loads of messages flooding my node-red! Whoohooo!!! I was on the stable version (v2.1.1). Maybe you can do version check in your in your MQTTClient.js?

Anyways, many thanks. Donation on it’s way :thumbs up:

Cheers,
/Cacti

0 Likes

#28

Sounds great Harrie! :slight_smile:

I tried a lot of different topics thru mqtt yesterday since I thought that I might had misunderstood the format of the topic. I know it’s suppose to resolve the device id from the name but would it be possible to have it just listen for the device-id also rather then the whole “light/room/name”. It would be great to have it just lite “homey/device-id/onoff/update/” for example. Then you could move and rename both room and device names without breaking anything.
Just a thought :slight_smile:

0 Likes

#29

Actually I think it’s ideal as it is because you can then subscribe to changes that happen within a device category or within a room.

0 Likes

#30

I didn’t mean that it would replace the existing way but complement it.

0 Likes

#31

U can use wildcards to accomplish this.
Homey/+/+/name

0 Likes

#32

Yes I know, but then I can’t change the name of the device.

Just thought that as it resolves in the device-id anyway that it would be nice to be able to just use it directly instead of the name :slight_smile:

Maybe homey/+/+/device-id can be implemented more easily then just homey/device-id?

Note, this is by no way a showstopper, just a way to make it more convenient for some users :slight_smile:

0 Likes

#33

Hmmm something weird I see on incoming messages within Node Red:

Blockquote
18-1-2019 15:22:33node: 13961c11.80cca4homey/light/woonkamer/lampen_tv/onoff/state : msg.payload : string[4]
“true”
18-1-2019 15:22:34node: 13961c11.80cca4homey/light/woonkamer/lampen_tv/onoff/state : msg.payload : string[0]
“”

Logging from the app seems OK:

Blockquote
20190118-15:22:22 object Message
20190118-15:22:22 PROPERTIES: {
“qos”: 0,
“retain”: false,
“mqttTopic”: “light/woonkamer/lampen_tv/onoff/state”,
“mqttMessage”: true
}
20190118-15:22:22 light/woonkamer/lampen_tv/onoff/state: true
20190118-15:22:23 object Message
20190118-15:22:23 PROPERTIES: {
“qos”: 0,
“retain”: false,
“mqttTopic”: “light/woonkamer/lampen_tv/onoff/state”,
“mqttMessage”: false
}
20190118-15:22:23 light/woonkamer/lampen_tv/onoff/state: false

But “True” is being recieved when device are turned on, but “” is received when devices are turned off.

I think it’s a bug, but maybe I’m doing something wrong. Might be even be a Node Red problem. Can anybody confirm this behaviour?

TIA, Cheers,
/Cacti

0 Likes

#34

Fixed that by checking if the capability is onoff and then creating a string as message value.

0 Likes

#35

@scanno Hi - does that mean it was an issue in MQTT client or was it an issue in MQTT gateway … that you worked around ? All MQTT messages are textual in nature aren’t they ?

Is that in GitHub now for one of the Homey apps ?

Or perhaps do you mean you worked around it in NodeRED ?

Kevin

0 Likes

#36

It is in the Mqtt Gateway app. If you want to test, the fix is in my fork (beta branch) . Made a pull request to upstream (i.e. @HarriedeGroot)

Booleans are a bit nasty sometimes when converting to strings.

0 Likes

#37

Since the HomeyDuino app does not updates anymore I think about to change my ESP8266 devices to use MQTT instead. Does anyone have an Arduino example to share?

I was helpt a lot in the beginning with the examples on github for the Homeyduino.

0 Likes

#38

Tried that, but it’s 2.0. Could you elaborate what you changed where? I can’t seem to find it myself.

Thanks in advance.

0 Likes

#39

try

or use my master branch, guess that one is 1.5

0 Likes

#41

Take a look at this thread, a few alternatives are being discussed there.

I posted one here, where I use the MySensors library for ESP8266 to push lightsensor readings to Homey over MQTT.

0 Likes