Device Sharing

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Device Sharing

Post by FireWizard »

Hans,
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?
Sorry, I do not know. I noticed it too. And Yes, using MQTT is a workaround.

Regards
evertide
Posts: 14
Joined: Wednesday 19 November 2014 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Contact:

Re: Device Sharing

Post by evertide »

Hi,

I agree that it would be more then nice to have the virtuals in the remote share. I have been using the Sonoff mini in quite a few remote light bulbs and since they are virtual devices they are not shared.

Setting up an alternative MQTT stream feels counter intuitive.
What would be the reason of not sharing virtual devices and how can we help?

Regards


Verzonden vanaf mijn iPad met Tapatalk
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Device Sharing

Post by manjh »

It gets weirder as time progresses...
I decided to grab an old temperature sensor that my RFLink picked up a long time ago.
Wrote a small LUA to grab the download value and stick it into the sensor.
I can see the value on my remote Domoticz, but it never comes in at the central!

Could it have something to do with the way a device is updated?
Hans
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Device Sharing

Post by FireWizard »

Hi,

It is a long existing issue.
See: https://github.com/domoticz/domoticz/issues/2642

It has indeed something to do with the way, the devices are updated.

Regards
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Device Sharing

Post by manjh »

FireWizard wrote: Sunday 19 January 2020 23:46 Hi,

It is a long existing issue.
See: https://github.com/domoticz/domoticz/issues/2642

It has indeed something to do with the way, the devices are updated.

Regards
Ah, yes. So it is not necessarely the type of sensor, but more in the way of updating values.
I tried doing it via a LUA script, so nothing exotic.

Code: Select all

commandArray['UpdateDevice'] = tostring(otherdevices_idx["test"])..'|0|'..tostring(down)
Where "down"is the variable containing the value I want to transmit.
Is there an alternative?

Edit: I found out that the "tostring" for the value is not needed for numeric devices. Does not solve the problem, though...
Hans
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Device Sharing

Post by manjh »

FireWizard wrote: Sunday 19 January 2020 21:41 Hans,
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?
Sorry, I do not know. I noticed it too. And Yes, using MQTT is a workaround.

Regards
So, without any scientific proof: I get the feeling that these devices are updated, but the mechanism to send it out to the master Domoticz does not notice this. And, since the R-Pi motherboard sensors are actually transmitted, it must be possible somehow. I would look into the code for this plugin, but that is above my paygrade... :shock:
Isn't there a trick to this? Some kind of "grep" to mark a device as "updated"?
Hans
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Device Sharing

Post by manjh »

Latest finding... I "borrowed" an active sensor which I know for a fact that is being sent to my central Domoticz, and inserted a fake value into it.
I can see the device reading change on my remote Domoticz, but on the central nothing happens.
After a while the "normal" reading comes in and is shown both remote and local.

So I guess this proves that it is not the nature of the device, but the way it is updated.
Is there anyone in this community that understands this, and (hopefully) can supply a solution?
Hans
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Device Sharing

Post by manjh »

Just a thought... I am using a JSON call from a bash file to put the values into the devices.
Anything to be gained there?
This is an example of a call:

Code: Select all

http://$host/json.htm?type=command&param=udevice&idx=$idxdl&svalue=$download
Where:
$host contains userid:pw@url:port.
$idxdl has the idx of the device
$download has the value I want to store

I tried to find a list of params to the command, but did not get any solution from that...
Help, someone?
Hans
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Device Sharing

Post by manjh »

Another way to update: from Node-Red.
I see the device change value in the remote Domoticz, but it is still not transmitted to central Domoticz.
So I guess this uses the same update mechanism, and results in the same error: not being transmitted.
Hans
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Device Sharing

Post by manjh »

I decided to take the MQTT route to transfer these values to my central Domoticz.
Immediately I noticed something weird: Domoticz does not "see" the device change, therefor it does not transmit via the shared device link.
But: it DOES transmit into MQTT!
Weird, if it transmits to MQTT, then why not the "own" link...

Anyway, this is what I did to get things done:

1. install MQTT and Node-Red on the remote R-Pi, and add MQTT in the hardware tab of Domoticz
2. open the MQTT port in the router in the central location and redirect it into the R-Pi
3. install an MQTT-out node from the remote Node-Red into the central MQTT
4. install an MQTT-in node on the central Node-Red
5. fiddle around with the data, and submit a JSON update into Domoticz on the central location. This updates a locally defined device with the value from remote

This works. Took a lot of trial-and-error to get it done, but step by step I got it to work.
Hans
HM31
Posts: 56
Joined: Friday 04 August 2017 16:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Device Sharing

Post by HM31 »

Hi,

I'm using Domoticz V4.9700 on two Synology NAS and I got the same issue that seems to be based on the type of device more than on the type of hardware (and them may be the way it is updated). I mean, I have to virtual devices on the slave server, one as a Switch device (On/Off) and one as a Text device. Both updated using a lua script.

The switch is synced with the master server but the Text device never appears on the master.

I'll try using json executed from slave to master after creating the receptive virtual device on the master server ... Configuring MQTT seems to be overkill just for that for my needs.
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Device Sharing

Post by manjh »

HM31 wrote: Tuesday 10 March 2020 17:04 Hi,

I'm using Domoticz V4.9700 on two Synology NAS and I got the same issue that seems to be based on the type of device more than on the type of hardware (and them may be the way it is updated). I mean, I have to virtual devices on the slave server, one as a Switch device (On/Off) and one as a Text device. Both updated using a lua script.

The switch is synced with the master server but the Text device never appears on the master.

I'll try using json executed from slave to master after creating the receptive virtual device on the master server ... Configuring MQTT seems to be overkill just for that for my needs.
Makes sense, that's what I found as well. The strange thing is the fact that Domoticz does not synchronize via the shared device link, but it does pass the update on to MQTT. That puzzles me.
After I put an MQTT link in place for the two text devices that I wanted to share, I decided to leave the shared device approach, and transfer all devices that I need on my central server via MQTT. Works 100% OK, and it feels like more control. On the downside, it takes a bit of work to set up, where the shared device approach is more or less automatic..
Hans
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: Device Sharing

Post by Number8 »

I have had for quite a long time a master / slave working setup. I recently add a zwave device on the slave that has been discovered on the master without problem. I have also an Oregon Temp/Hum sensor on the slave that will not show up in the master devices list. I removed it, reinserted it, no luck. Since I read that update mechanism is related to the type of sensor, could it be that a Temp/Hum sensor is not transmitted? I know I could make an dzvent script to update a virtual temp/hum sensor on the master, it is a bit overkilled I guess. Any clue?
Thank you
Running
RPi 2020.1 on the slave
RPi 4.11214 on the master
Debian buster on NUC and three RPi with buster.
blueberryPie
Posts: 18
Joined: Sunday 19 November 2017 20:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Device Sharing

Post by blueberryPie »

Looks like somewhere between 2024.1 and 2024.4 the Domoticz Device Sharing protocol was changed.
As of 2024.1 Device sharing was working to versions as far back as 2021.1. But now device sharing produces the following error on the remote Domoitcz:
Error: UNHANDLED PACKET TYPE: FS20 49

Updating the remote Domoticz does seems to resolve the issue but creates all new devices that need to be replaced into the old devices.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Device Sharing

Post by waltervl »

blueberryPie wrote: Thursday 29 February 2024 16:39 Looks like somewhere between 2024.1 and 2024.4 the Domoticz Device Sharing protocol was changed.

Updating the remote Domoticz does seems to resolve the issue but creates all new devices that need to be replaced into the old devices.
Indeed, see for example https://www.domoticz.com/forum/viewtopi ... =6&t=41411
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest