How to send MQTT to Node-RED Topic is solved
Moderator: leecollings
-
- Posts: 195
- Joined: Wednesday 31 May 2017 16:06
- Target OS: NAS (Synology & others)
- Domoticz version: 2024.7
- Location: NL
- Contact:
How to send MQTT to Node-RED
I want to send data from a few devices in Domoticz to Node-RED. I followed the wiki https://www.domoticz.com/wiki/MQTT
Passed Setup, More Options, Data Push, MQTT and configured the form like this picture:
The devices are updated every 5 minutes but I do not see any data in the log of Domoticz and also not in MQTT Explorer.
I expected twe new, fresh topics in Topic "energy"
Setup:
Running Domoticz V 2024.1 on Synology in Docker. All other MQTT-traffic to Node-RED is working fine.
Any help is appreciated.
Passed Setup, More Options, Data Push, MQTT and configured the form like this picture:
The devices are updated every 5 minutes but I do not see any data in the log of Domoticz and also not in MQTT Explorer.
I expected twe new, fresh topics in Topic "energy"
Setup:
Running Domoticz V 2024.1 on Synology in Docker. All other MQTT-traffic to Node-RED is working fine.
Any help is appreciated.
Synology with Domoticz build (V2024.7) in Docker
-
- Posts: 31
- Joined: Friday 20 January 2017 17:52
- Target OS: NAS (Synology & others)
- Domoticz version: 2024.2
- Location: Netherlands
- Contact:
Re: How to send MQTT to Node-RED
Hi Pieter,
I use Node-Red solely to 'inject' values from MQTT into Domoticz, and maybe you do that as well. So I'm no expert in how to inject from Domoticz --> Node-Red, but perhaps you have to use the 'MQTT Client Gateway with LAN interface' in the Hardware tab.
Remote Server: in your case the 192.168.1.18
Port 1883 (should not be a surprise)
User & password if required
Topic OUT Prefix: Energy; I leave this empty for all my 'hardware' IDX (I only use an IN Prefix), but I just tested with one of the IDX and as soon as I put some prefix in this field I get readings in MQTT explorer with this prefix
Hope this gives you an idea, but probably there are more solutions and maybe others can help you with other paths.
Good luck
I use Node-Red solely to 'inject' values from MQTT into Domoticz, and maybe you do that as well. So I'm no expert in how to inject from Domoticz --> Node-Red, but perhaps you have to use the 'MQTT Client Gateway with LAN interface' in the Hardware tab.
Remote Server: in your case the 192.168.1.18
Port 1883 (should not be a surprise)
User & password if required
Topic OUT Prefix: Energy; I leave this empty for all my 'hardware' IDX (I only use an IN Prefix), but I just tested with one of the IDX and as soon as I put some prefix in this field I get readings in MQTT explorer with this prefix
Hope this gives you an idea, but probably there are more solutions and maybe others can help you with other paths.
Good luck
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: How to send MQTT to Node-RED
Never used this function but they also not popup in the default Domoticz/out topic?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 536
- Joined: Monday 20 March 2023 14:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Somewhere in NL
- Contact:
Re: How to send MQTT to Node-RED
When you have configured the 'MQTT Client Gateway with LAN interface' hardware leave the Topic out prefix "domoticz/out"
The subscribe to "domoticz/out/<DeviceName>"
The subscribe to "domoticz/out/<DeviceName>"
Logic will get you from A to B. Imagination will take you everywhere.
-
- Posts: 195
- Joined: Wednesday 31 May 2017 16:06
- Target OS: NAS (Synology & others)
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: How to send MQTT to Node-RED
All members thnx for reply.
I had already a MQTT Client Gateway with LAN interface. In Setup were all devices (329) in the optionlist and they send a lot of data to domoticz/out... I was not able to filter that in MQTT Explorer.. My fault. If I put text in the searchfield it filters that topicname. But I want to filter a device in that topic... Maybe can someone explain that to me too?
This is the config of the MQTT client gateway:
And this is the actual setup:
But in the last hour there were no more messages send related to PVoutput. I do not see them passing by in MQTT Explorer and also not in debug screen of Node-RED.. This is how I subscribed to the input Node.
So up till now no results..
I made on proposal of skippy711 another hardware device with only subscription to energy and 2 selected options but no results either..
I had already a MQTT Client Gateway with LAN interface. In Setup were all devices (329) in the optionlist and they send a lot of data to domoticz/out... I was not able to filter that in MQTT Explorer.. My fault. If I put text in the searchfield it filters that topicname. But I want to filter a device in that topic... Maybe can someone explain that to me too?
This is the config of the MQTT client gateway:
And this is the actual setup:
But in the last hour there were no more messages send related to PVoutput. I do not see them passing by in MQTT Explorer and also not in debug screen of Node-RED.. This is how I subscribed to the input Node.
So up till now no results..
I made on proposal of skippy711 another hardware device with only subscription to energy and 2 selected options but no results either..
Last edited by PieterS on Monday 15 April 2024 19:58, edited 1 time in total.
Synology with Domoticz build (V2024.7) in Docker
-
- Posts: 195
- Joined: Wednesday 31 May 2017 16:06
- Target OS: NAS (Synology & others)
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: How to send MQTT to Node-RED
This is the setup of the MQTT client gateway
This are the properties of the device:
The kind of device might have to do with the problem?
This are the properties of the device:
The kind of device might have to do with the problem?
Synology with Domoticz build (V2024.7) in Docker
-
- Posts: 536
- Joined: Monday 20 March 2023 14:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Somewhere in NL
- Contact:
Re: How to send MQTT to Node-RED
Click in MQTT Explorer on the arrow of "domoticz/out"
Wait a moment until all or most of the "domoticz/out/<DeviceName> topic will be present.
Take that exact topic name to subscribe in Node-Red.
topic like: "domoticz/out/Electriciteit Verbruik"
Wait a moment until all or most of the "domoticz/out/<DeviceName> topic will be present.
Take that exact topic name to subscribe in Node-Red.
topic like: "domoticz/out/Electriciteit Verbruik"
Logic will get you from A to B. Imagination will take you everywhere.
-
- Posts: 195
- Joined: Wednesday 31 May 2017 16:06
- Target OS: NAS (Synology & others)
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: How to send MQTT to Node-RED
Ah, making progress! There is something passing by.
I guess that I have to change names: spaces not allowed. But the field "name" will be the name of the topic in NR?
So I will change the name of the device and use that as topicname in NR?
I guess that I have to change names: spaces not allowed. But the field "name" will be the name of the topic in NR?
So I will change the name of the device and use that as topicname in NR?
Synology with Domoticz build (V2024.7) in Docker
-
- Posts: 195
- Joined: Wednesday 31 May 2017 16:06
- Target OS: NAS (Synology & others)
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: How to send MQTT to Node-RED
Using the "name" PVoutput-Goodwe as topic in the input node in NR is not successfull.
It seems I need child topics based on the name of devices. So I changed in the configuration of MQTT client gateway:
This is about the result I need..
I will play further tomorrow. My problem seems to be solved
Thanks a lot gentlemen!
It seems I need child topics based on the name of devices. So I changed in the configuration of MQTT client gateway:
- Topic Out Prefix: energy
- Publish Topic: Name
This is about the result I need..
I will play further tomorrow. My problem seems to be solved
Thanks a lot gentlemen!
Synology with Domoticz build (V2024.7) in Docker
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: How to send MQTT to Node-RED
Better to use the default Domoticz/out as topic out prefix.
If you want to publish non energy related devices in the future to mqtt you will have a new problem....
If you want to publish non energy related devices in the future to mqtt you will have a new problem....
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 195
- Joined: Wednesday 31 May 2017 16:06
- Target OS: NAS (Synology & others)
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: How to send MQTT to Node-RED
If I understand the principle I can change and organize the topics.
Now I created a new hardware-object in Domoticz to keep the data of energy together.
It is one way or the other.
In this case it is a good solution. But thanks for comment
Now I created a new hardware-object in Domoticz to keep the data of energy together.
It is one way or the other.
In this case it is a good solution. But thanks for comment
Synology with Domoticz build (V2024.7) in Docker
Who is online
Users browsing this forum: No registered users and 0 guests