Device Sharing
Moderator: leecollings
-
- Posts: 27
- Joined: Sunday 11 February 2018 18:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Location: Montrouge, France
- Contact:
Re: Device Sharing
It works !
Indeed it was a port issue.
The good configuration is : port 8080 for both Master and Slave as you recommended, but 6144 in the Remote Server Config (see screenshot below) The next step will be to test a similar configuration on my normal installation (a Rpi Zero and a Rpi B+) with my Xiaomi sensor and non-beta domoticz version.
Thank again "FireWizard" for all.
Best regards
Indeed it was a port issue.
The good configuration is : port 8080 for both Master and Slave as you recommended, but 6144 in the Remote Server Config (see screenshot below) The next step will be to test a similar configuration on my normal installation (a Rpi Zero and a Rpi B+) with my Xiaomi sensor and non-beta domoticz version.
Thank again "FireWizard" for all.
Best regards
- FireWizard
- Posts: 1771
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Device Sharing
@duodiscu92
Ok, that is nice to hear.
And you know: Never give up
Regards
Ok, that is nice to hear.
And you know: Never give up

Regards
-
- Posts: 27
- Joined: Sunday 11 February 2018 18:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Location: Montrouge, France
- Contact:
Re: Device Sharing
Right ... never give up
So it works well in my standard configuration Rpi Zero and Rpi B+, Wifi network, last non-beta Domotics version.
All "Motherboards Sensors" are well shared. But the Virtual Sensor I use for my Xiaomi sensor is not shared properly, I mean visible on slave side but not visible on master side.
I think it is an issue already discussed on the forum : Vitual Sensors seems difficult to share.
Trying now to solve this new issue ...
So it works well in my standard configuration Rpi Zero and Rpi B+, Wifi network, last non-beta Domotics version.
All "Motherboards Sensors" are well shared. But the Virtual Sensor I use for my Xiaomi sensor is not shared properly, I mean visible on slave side but not visible on master side.
I think it is an issue already discussed on the forum : Vitual Sensors seems difficult to share.
Trying now to solve this new issue ...

- FireWizard
- Posts: 1771
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Device Sharing
Hi,
Indeed, I have the same with virtual sensors. Mostly Python scripts.
See: https://github.com/domoticz/domoticz/issues/2642
But you said that you are running MQTT in parallel. Maybe you can try that.
Regards
Indeed, I have the same with virtual sensors. Mostly Python scripts.
See: https://github.com/domoticz/domoticz/issues/2642
But you said that you are running MQTT in parallel. Maybe you can try that.
Regards
-
- Posts: 27
- Joined: Sunday 11 February 2018 18:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Location: Montrouge, France
- Contact:
Re: Device Sharing
Yes this is what I have done and it worksBut you said that you are running MQTT in parallel. Maybe you can try that.
But after all these efforts to make working device sharing it's a real pity not to be able to use it for virtual sensors.2019-12-11 23:30:09.076 MQTT: Topic: domoticz/in, Message: {"idx" : 1025, "nvalue" : 0, "svalue" : "23.0;38.1;0"}
Best Regards
-
- Posts: 731
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Device Sharing
I fully agree. I also find it strange that there is no warning against this in the Wiki. There is an excellent step-by-step description of the Device sharing setup. But nothing about omission of virtual devices...duodiscu92 wrote: ↑Wednesday 11 December 2019 23:39Yes this is what I have done and it worksBut you said that you are running MQTT in parallel. Maybe you can try that.capteur-mi-ble.png2019-12-11 23:30:09.076 MQTT: Topic: domoticz/in, Message: {"idx" : 1025, "nvalue" : 0, "svalue" : "23.0;38.1;0"}
But after all these efforts to make working device sharing it's a real pity not to be able to use it for virtual sensors.
Best Regards
Hans
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Device Sharing
The nicest feature of the wiki pages on domoticz.com is that the are by-, from- and for us all. Just create a user-id or when not yet possible because of recent spam attacks ask @gizmocuz to create one for you and improve the information on the wiki.
Your fellow forum members will be grateful and it will give you the warm feeling that you contributed.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 731
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Device Sharing
I understand that, but it feels a bit wrong. I think the author of this particular piece of code is the ideal person to maintain the page.waaren wrote: ↑Wednesday 15 January 2020 22:10The nicest feature of the wiki pages on domoticz.com is that the are by-, from- and for us all. Just create a user-id or when not yet possible because of recent spam attacks ask @gizmocuz to create one for you and improve the information on the wiki.
Your fellow forum members will be grateful and it will give you the warm feeling that you contributed.
Having said this, if that person won't/can't do it, I guess I'll voluteer... I will add some text.
Hans
-
- Posts: 85
- Joined: Thursday 12 May 2016 15:47
- Target OS: Linux
- Domoticz version: 11838
- Location: South of France
- Contact:
Re: Device Sharing
A while ago, I had the need to send any kind of device (dummy or not) to a remote domoticz, so I wrote this little LUA function to do it easily via json
You can call the function at your choice on a devicechanged or regularily...
Code: Select all
function UpdateRmt(credentials,ipp,local_dev,remote_idx)
--[[Update a sensor on a remote domoticz
credentials : string "login:pw" of remote domoticz
ipp : string "ip:port" of remote domoticz
local_dev : name of local device to transmit
remote_idx : index of device on the remote domoticz
]]--
cmd = "http://"..credentials.."@"..ipp.."/json.htm?type=command¶m=udevice&idx="..tostring(remote_idx).."&nvalue=0&svalue="..otherdevices_svalues[local_dev]
--print(cmd)
os.execute('curl "'..cmd..'" &') -- Or we could do it with a 'OpenURL' in a CommandArray...
end
-
- Posts: 731
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Device Sharing
This could be helpful, but it would mean opening the Domoticz port through my router. Is that safe? I assumed that the "device sharing" port is OK, but the regular IP port?aleph0 wrote: ↑Friday 17 January 2020 11:12 A while ago, I had the need to send any kind of device (dummy or not) to a remote domoticz, so I wrote this little LUA function to do it easily via json
You can call the function at your choice on a devicechanged or regularily...Code: Select all
function UpdateRmt(credentials,ipp,local_dev,remote_idx) --[[Update a sensor on a remote domoticz credentials : string "login:pw" of remote domoticz ipp : string "ip:port" of remote domoticz local_dev : name of local device to transmit remote_idx : index of device on the remote domoticz ]]-- cmd = "http://"..credentials.."@"..ipp.."/json.htm?type=command¶m=udevice&idx="..tostring(remote_idx).."&nvalue=0&svalue="..otherdevices_svalues[local_dev] --print(cmd) os.execute('curl "'..cmd..'" &') -- Or we could do it with a 'OpenURL' in a CommandArray... end
Hans
-
- Posts: 731
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Device Sharing
OK. Nice solution. I first tested this while port 8080 was routed through my router to the R-Pi on which Domoticz runs.aleph0 wrote: ↑Friday 17 January 2020 11:12 A while ago, I had the need to send any kind of device (dummy or not) to a remote domoticz, so I wrote this little LUA function to do it easily via json
You can call the function at your choice on a devicechanged or regularily...Code: Select all
function UpdateRmt(credentials,ipp,local_dev,remote_idx) --[[Update a sensor on a remote domoticz credentials : string "login:pw" of remote domoticz ipp : string "ip:port" of remote domoticz local_dev : name of local device to transmit remote_idx : index of device on the remote domoticz ]]-- cmd = "http://"..credentials.."@"..ipp.."/json.htm?type=command¶m=udevice&idx="..tostring(remote_idx).."&nvalue=0&svalue="..otherdevices_svalues[local_dev] --print(cmd) os.execute('curl "'..cmd..'" &') -- Or we could do it with a 'OpenURL' in a CommandArray... end
I was able to send values into my Domoticz devices, so the mechanism works.
Obviously, I did not want to keep 8080 open for a second longer than really needed to test, so I removed that NAT line, and instead entered 443.
Changed "http" into "https"in your code, and 8080 into 443.
Unfortunately this does not work. Also tried removing the port alltogether, but no.
I then tried using a browser from outside my network, using the https connection works OK (although I do get a warning from the browser). This proves that my NAT settings are good.
Any suggestions?
Hans
-
- Posts: 85
- Joined: Thursday 12 May 2016 15:47
- Target OS: Linux
- Domoticz version: 11838
- Location: South of France
- Contact:
Re: Device Sharing
I did not test this, as my remote domoticz was accessible from inside a VPN. I'll make some tests with https to understand what's going on
Envoyé de mon moto g(6) en utilisant Tapatalk
Envoyé de mon moto g(6) en utilisant Tapatalk
-
- Posts: 731
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
-
- Posts: 731
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Device Sharing
I am looking at a new approach to get virtual device values across to the master domoticz.
Perhaps I could somehow create a device, copy the value into that, and catch it at the master side?
I have three virtual devices, with values from the speedtest: upload Mbit, download Mbit, and ping msec.
Any recommendations as for the type of transport device I should be using?
Perhaps I could somehow create a device, copy the value into that, and catch it at the master side?
I have three virtual devices, with values from the speedtest: upload Mbit, download Mbit, and ping msec.
Any recommendations as for the type of transport device I should be using?
Hans
- FireWizard
- Posts: 1771
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Device Sharing
Hi manjh,
Did you see my last post at: https://www.domoticz.com/forum/viewtopi ... 60#p234060
I believe probably the simplest way to go is to use MQTT.
Regards
Did you see my last post at: https://www.domoticz.com/forum/viewtopi ... 60#p234060
I believe probably the simplest way to go is to use MQTT.
Regards
-
- Posts: 731
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Device Sharing
Ah, thanks. I had not seen that yet.FireWizard wrote: ↑Sunday 19 January 2020 20:26 Hi manjh,
Did you see my last post at: https://www.domoticz.com/forum/viewtopi ... 60#p234060
I believe probably the simplest way to go is to use MQTT.
Regards
I do need Domoticz on the remote location, and I also want to be able to see the speedtest results in Domoticz variables.
But on my home Domoticz, I would like to collect the speedtest results and show them in a Node-Red dashboard...
Opening MQTT or Node-Red to the outside internet is something I would like to prevent. Currently the only ports that are in the NAT are VPN and remote-Domoticz. Adding more ports is not something I look forward to...
Hans
-
- Posts: 731
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Device Sharing
A question that keeps coming back into my mind.
What is the rationale for Virtual Sensors not being sent across to the master Domoticz server? Is there a good reason, or was it simply never implemented before?
Also, is this true for all types of virtual sensors?
What is the rationale for Virtual Sensors not being sent across to the master Domoticz server? Is there a good reason, or was it simply never implemented before?
Also, is this true for all types of virtual sensors?
Hans
- FireWizard
- Posts: 1771
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Device Sharing
Hi,
You wrote.
You can try to publish the Speedtest results to your MQTT server from your Remote Pi and to subscribe to it with your Master Pi.
You have to open port 1883 on your router. On the other hand you can close port 6144.
Regards
You wrote.
I cannot answer that question, but maybe some of the developers can.A question that keeps coming back into my mind.
What is the rationale for Virtual Sensors not being sent across to the master Domoticz server? Is there a good reason, or was it simply never implemented before?
Also, is this true for all types of virtual sensors?
You can try to publish the Speedtest results to your MQTT server from your Remote Pi and to subscribe to it with your Master Pi.
You have to open port 1883 on your router. On the other hand you can close port 6144.
Regards
-
- Posts: 731
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Device Sharing
I understand. But I have more devices and sensors for which I use the 6144 link.FireWizard wrote: ↑Sunday 19 January 2020 21:24 Hi,
You wrote.
I cannot answer that question, but maybe some of the developers can.A question that keeps coming back into my mind.
What is the rationale for Virtual Sensors not being sent across to the master Domoticz server? Is there a good reason, or was it simply never implemented before?
Also, is this true for all types of virtual sensors?
You can try to publish the Speedtest results to your MQTT server from your Remote Pi and to subscribe to it with your Master Pi.
You have to open port 1883 on your router. On the other hand you can close port 6144.
Regards
It feels like a work-around..... I would much prefer to use the Domoticz sharing method.
Hans
-
- Posts: 731
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Device Sharing
To add to my confusion: I checked the sensors coming in on my central Domoticz, and noticed that the Raspberry Pi Motherboard sensors plugin actually uses a couple of General Custom Sensor devices. And they really do come through across the 6144 link!
So why are these sensors different from the ones that I create using the "create virtual sensors: button in the hardware tab?
So why are these sensors different from the ones that I create using the "create virtual sensors: button in the hardware tab?
Hans
Who is online
Users browsing this forum: No registered users and 0 guests