Is it possible to get an event on an ip device if the user status has changed? Send userid and new status to an ip?
best regards holger
Is it possible to get an event on an ip device if the user status has changed? Send userid and new status to an ip?
best regards holger
Hey.
First let me ask, by IP you mean IP address, right? And by use status we are talking about the strong the use can set (e.g. on holiday). Correct so far?
I am pretty sure, but I have not confirmed it yet that you can create an app that will listen to user events. The change of the status will probably be one of these events (hopefully). Then, you would have the trigger.
Now, what do you mean by sending the data to an IP? A rest call? Some other protocol? What exactly?
Chris
Hi Chris,
yes, you are right.
the protocol form NC to this signaling device itself could be plain udp in the first steps.
My question is how to start, what would in need to do.
I heart from the hooks, But they are depreciated?! What else to use, do i need to write a Plugin/ App?
best regards
Holger
Okay, it seems you have not stated to develop for the NC ecosystem, that is fair and I highly suggest to read/work through the tutorials and the documentation.
NC core (the server that you install) provides you the ability to install custom plugins called apps. There are some out but you are free to create a new one for your use case.
You will need the app to listen to the events. The event system is not deprecated. In contrast, it is highly used in the core for various tasks. What you mean is the hook system and the anonymous events. This was legacy code and did not provide with the benefits of type safety. Normal (typed) events are well usable.
When the event is fired, you are free to do in your app/plugin. Whatever PHP can do, can be achieved (mostly). So, if you wanted to open a UDP socket and send some datagramms, you can do this by means of
$socket = fsocketopen('udp://IP.of.the.device:port/')
However, I would (if I were in your shoes) try to use TCP of even HTTP as higher level protocols. Depends a bit on the use case (if it is IT go with HTTP, if it is OT, go eventually with MQTT).
I hope this helps you for now.
Chris
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.