Module that send events over TCP/UDP or websocket

Discussions about Z-Way software and Z-Wave technology in general
SReibert
Posts: 11
Joined: 20 Jan 2016 20:35

Module that send events over TCP/UDP or websocket

Post by SReibert »

Hello,

I search since 1 Year that anyone can help me for my problem.

I need a Z-way Module that can send all events that happen in z-way. Not only the few events from the virtual devices that send the onboard websocket service. It is a long time ago but I remeber that a few events wasn´t send i.E. switchbinary class of the Fibaro FGR-222 and battery level but in the logfile and dataholder you had seen the changes.

I need the z-way server only as a API interface between zwave and my Home automation software.
I hope that for one that can Javascript it is no problem to write such a module.
The Module must only send all events. For receiving I can use the z-way API, thats no problem.
The Module must send very fast. So please not reading the logfile or so.
The Module should send over TCP, UDP or Websocket

Here older tpics from me with the same problem:
https://forum.z-wave.me/viewtopic.php?f=3419&t=22761
https://forum.z-wave.me/viewtopic.php?f=3419&t=22840

I will pay 150 Euro

Please write here in the topic or pn if you will make it for me. If I found one, I write it here that the order is allocate. Of course if the module works I make it free for all.

Regards
Steffen
pah111kg
Posts: 25
Joined: 02 Sep 2016 18:49

Re: Module that send events over TCP/UDP or websocket

Post by pah111kg »

Hi,

I have implemented a module that sends all device state changes to openHAB, either via HTTP or WebSockets. What do you mean with all events, only with regard to the device status or also something like, new devices, new rooms, notifications, ...? What is the API of the other system?

Patrick
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Module that send events over TCP/UDP or websocket

Post by pz1 »

pah111kg wrote:I have implemented a module that sends all device state changes to openHAB, either via HTTP or WebSockets.
Is this a module that you could/are willing to share in the App store?
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Module that send events over TCP/UDP or websocket

Post by pz1 »

Did a quick read. Very well documented. Congratulations!
Pieter
SReibert
Posts: 11
Joined: 20 Jan 2016 20:35

Re: Module that send events over TCP/UDP or websocket

Post by SReibert »

Hello Patrick,

Thank you for your answer.
What do you mean with all events
here I describe it: https://forum.z-wave.me/viewtopic.php?f ... 761#p60689
i.E. If the Fibaro FGR-222 change the status of switchbinary you dont see it as a event and the onboard websocket will send nothing. But in the logfile you will see it or in the dataholder you see that the value has changed. I think that in some cases the vdev do filter because of not understanding? But I need all status changes of the devices.
only with regard to the device status or also something like, new devices, new rooms, notifications, ...?
Normally I need "only" all status changes of the physical Z-wave devices. New device include /exclude and other infos are good but if this is impossible, its ok.
What is the API of the other system?
The other system is IPSymcon. It can receive data in lots of ways. Server, client, TCP, UDP, Websocket. The Z-way module must send only the raw data. I.E.:

Code: Select all

{"type":"Z-way","data":{"devId":"ZWayVDev_zway_23-0-38","devType":"switchMultilevel","devProbeType":"dimmer","devName":"Fibar Group (23.0) Dimmer","lvl":4}}
This example I have make with the websocket funktion from z-way. I have switched the switch binary but z-way only send the multilevel status not the switchbinary status. (Fibaro RGBW)


I have looked into your "ZWay-OpenHABConnector" index.js file. But for me it is to complex to figured out how it works and that I can use it for me.


Regards
Steffen
pah111kg
Posts: 25
Joined: 02 Sep 2016 18:49

Re: Module that send events over TCP/UDP or websocket

Post by pah111kg »

I've implemented a mini App, which publishes all device status changes via WebSockets.

1.) add token: sse_zwickau_ws_beta
2.) download WebSocket Configurator
3.) instantiate the app
4.) one-time initialization or, for new devices, the following command: [url]http://YOUR_IP:8083/ZAutomation/api/v1/devices/WebSocketConfigurator/command/refresh[/url]

My NodeJS Websocket test application gets all the changes in the form:

Code: Select all

{
	"type":"Z-way",
	"data":{
		"devId":"ZWayVDev_zway_23-0-38",
		"devType":"switchMultilevel",	
		"devProbeType":"dimmer",
		"devName":"Fibar Group (23.0) Dimmer",	
		"lvl":4
	}
}
Please let me know if it works with you. Then I would expand that:
1.) other device types do not have the level property, for example rgb bulbs, ...
2.) notification via HTTP to a specific address

Patrick
SReibert
Posts: 11
Joined: 20 Jan 2016 20:35

Re: Module that send events over TCP/UDP or websocket

Post by SReibert »

Hello Patrick,

thank you very much for that App.

Sadly I am not able to add the token. If a add a token zway say: "Unable to update data"
After lot of testing and version changes, my zway server is very instable. But it works.
In the next days I go to a friend. He has a clean zway server for testing.

I write here if I have test your app.

Regards
Steffen
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Module that send events over TCP/UDP or websocket

Post by pz1 »

@SReibert
Which z-way version do you have? I could add the token without a problem under the Management/App Store Access menu. Under On Line Apps tab change the "Featured Apps" tab into "All", and the WS configurator is visable
SReibert
Posts: 11
Joined: 20 Jan 2016 20:35

Re: Module that send events over TCP/UDP or websocket

Post by SReibert »

pz1 wrote:@SReibert
Which z-way version do you have? I could add the token without a problem under the Management/App Store Access menu. Under On Line Apps tab change the "Featured Apps" tab into "All", and the WS configurator is visable
Hello,

I have version Win v2.1.2-rc17 but after upgrade to Win v2.2.4 and selfdowngrade back to v2.1.2-rc17 my zway server is very broken. the problem was that my polling script did not work with v2.2.4. With v2.1.2-rc17 it works and my Zwave system in my house do his job. But if I shutdown and restart my zway server, the interview of the most zwave device are lost and it cost a lot of time to make all work. So for me it is better to test the WebSocket Configurator App by my friend with his fresh zway Win server v2.2.4.


I hope that we can test today.

Before we become the problem that we can not connect and /or receive data from the WebSocket Configurator App.

Code: Select all

<script type="text/javascript">
    var websocket = new WebSocket('ws://IP_TO_ZWAY_SERVER:8083');
	
	websocket.onclose = function(event) {
  if (event.wasClean) {
    console.log('Verbindung geschlossen');
  } else {
    console.log('Verbindung unterbrochen');
  }
  console.log('Bei: ' + event.code + ' Grund: ' + event.reason);
};
    websocket.onopen = function(ev) {
        console.log("connected");
    };
    websocket.onclose = function(ev) {
        console.log("disconnected");
    };
    websocket.onmessage = function(ev) {
        if (!ev.data) {
            console.log("ping");
        } else {
            console.log(ev.data);
        }
    };
    websocket.onerror = function(ev) {
        console.log("error: " + ev.data);
    };
</script>
Do this script work with the WebSocket Configurator App or what must be change?

Regards
Steffen
Post Reply