Hello Pieter, @PieterS
You wrote:
Thank you for your reply! Glad to get an example for a flow. Did not make any progress till now. I am an early beginner.
You are very close to the end result, but first I like to explain a little.
As we already discussed earlier and it was already mentioned earlier, SBFspot is not able to communicate directly with Domoticz, as Domoticz requires its own data format So we have to convert the data from, what is send by SBFspot, to what Domoticz understand.
This "data conversion" is done, in this case, by Node Red.
We have chosen to communicate by means of MQTT.
This means that SBFspot publishes (sending) its data to a MQTT server (broker. e.g. Mosquitto). Node Red subscribes (receiving) to that data. Therefore SBFspot should publish the data under a topic, in this case sbfspot/data and Node Red subscribes to the same topic.
Next step is that Node Red converts the data to the format, required by Domoticz and publishes again to a topic that Domoticz can read.
Default Domoticz subscribes to domoticz/in (and publishes to domoticz/out). So Node Red publishes the data to domoticz/in.
I assume you have 1 MQTT server (broker) on your network.
Let us step through your post.
I got no errors about JSON in the latest beta version of Domoticz with topic domoticz/in. Not in any tab. And then I got at least some input from SBFspot...
That is okay, do not worry if you do not receive errors
When i change the topic in the configuration file of SBFspot to what you suggest than there are no readings in Domoticz.
Okay that is correct. If I look to your screenshots. I see that it picks one value for each IDX in svalue.
No idea what it presents, but it are not the IDX's that SBFspot will use.
So this is okay again
So MQTT seems to work.
Correct. This is okay.
This is the part of the config-file about MQTT in SBFspot. I set the host to 192.168.1.18 and topic to sbfspot/data
Conclusion:
SBFspot will publish its data to a MQTT server (broker) with IP address 192.168.1.18 and the default port 1883 and the topic sbfspot/data.
I also see it will publish the data in JSON format. Perfect.
In MQTT Explorer there is a new topic with a stream of data on the broker which runs on my Synology.
If you look to the message in MQTT Explorer, you see the following:
IP address: 192.168.1.18. REMEMBER that IP Address.
You also see that Domoticz publishes on domoticz/out (not important for now) and that "something" publishes to domoticz/in (which writes a value of 16.1 to IDX 179. That looks very good, although I do not know, what it represents.
Then the internal message $SYS from the broker. This has to be there.
And then the important one:
Data published under sbfspot/data in JSON format.
Perfect, this means that your communication between SBFspot and the MQTT server (broker) is okay.
On the Raspberry (192.168.1.15) I made a new flow by making an import of your example.
Okay and try to REMEMBER the IP Adress of the Pi (192.168.1.15)
In Node-RED: The MQTT out node has as server localhost and Topic domoticz/in because Node-REED and Domoticz run both on this machine.
Okay, so you have Node Red and Domoticz running on the same device, with IP Address of 192.168.1.15, but your MQTT server runs on 192.168.1.18.
(Do you remember!)
Node Red has to publish its data to the MQTT server and not to localhost, even if both Node Red and Domoticz runs on the same device.
On localhost you do not have a MQTT server installed. So impossible to communicate with the non-existing server.
So change to server in the MQTT out node to 192.168.1.18 (the same as the SBFspot In node) and it will start to work. I am quite sure.
In Domoticz I made all virtual sensors
Be aware that different virtual sensors require different formats.
See:
https://www.domoticz.com/wiki/MQTT#Upda ... .2Fsensors
For the different formats of the sensors, you can have look at:
https://piandmore.wordpress.com/2019/02 ... -domoticz/ and
https://www.domoticz.com/wiki/Domoticz_ ... re_3_Phase
But there is no input in logfile in Domoticz (192.168.1.15) from Node-red...
That is the default behavior in the latest versions (from 13179), So nothing to worry. Search the forum,if you need it.
See:
viewtopic.php?f=6&t=36171&p=274250&hilit=MQTT#p274250
Seems there is no data from SBFspot to Nodered..
There is, and if you want to see it, then you should connect a "Debug" node to the output of the MQTT input node (SBFspot In)
One warning:
Be careful with the data you send to domoticz/in on 192.168.1.18.
For the voltage and current I am sure it correct, but the other you should check the format.
Let me know.
Regards