MQTT Hub/Gateway

From what I read about it, it is not the same although nearly equal. (Homie & HA implementation of MQTT discovery)
I have not come across other ‘standards’ of any importance in my last evening search. HA’s MQTT discovery is more widely used in Tasmota/Espurna/Esphomelib/espeasy and that sort of thing.

Does anybody know what the differences are between Homie and HA MQTT discovery?

(PS you just can not have a conversation about this, it reminds me of Airplane (the movie):

1 Like

You can find some implementations here. It is not very wide spread but I couldn’t find much other standards like Blarp mentioned also.

Mapping the capabilties vs. the properties is not that hard. The standards has some special properties regarding Light/Color control which you need to adept to the correct Homey capabilities. All the other capabilities can easilly be mapped as strings, numbers (float/int) etc.

If I can assist in any way please let me know. I am willing to help. It is in all our interest to have one nice app which opens a lot of possibilities regarding dashboards, mobile apps etc.

The drivers reference contains a list of all capabilities & classes. Maybe that’s a good starting point?

The reference at https://developer.athom.com/docs/apps-reference is probably a better starting point, because you can view the complete definition of each capability there (if you click on the vertical ellipsis on the right).

Openhab has a reading about what they have done:

They too have noticed there are two ‘standards’ Homie and HA MQTT discovery

They have decided to:
“The new MQTT Things extension supports two conventions out-of-the-box” Homie and HA MQTT discovery

They stress:
“It cannot be stressed enough, to consider changing existing MQTT client devices to an MQTT convention like the mentioned Homie 3.x convention. That might not be possible in some cases though.”
The thing is, there are few that do.

Looks like you need both standards to accomplish a MQTT gateway.
If you want to single out a connection to node red, then maybe homie will be enough.

Hope this helps.

Here’s the raw JSON for each capability: https://github.com/athombv/node-homey-lib/tree/master/assets/capability/capabilities

Harrie,

Using lights as an example is it correct that On states are reported as ‘true’ and Off states have blank content in MQTT ?

Sounds like a small bug. I should have a look at it and change the values to be true and false.

OK,
I should probably have posted to GitHub too rather than here. Will do so in the future.

1 Like

This is something I really been missing with Homey so thank you for making this app!

However, I can´t get it to work. Is there something you have to activate somewhere or something else?
I have MQTT and Node-RED running on a RPi connected to Homey via the MQTT Client app, this works great with for example gBridge. But The MQTT Gateway doesn’t seem to connect to it. There is no state changes sent to the server and no commands seems to work so I’m guessing I’m doing something wrong.
I’m using Homey 2.0 and the beta version of you app.

1 Like

Did you install the BETA version of the MQTT client?

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

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.

Same config and problem here.

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

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.

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

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:

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.

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