Issue - Update device from api
Posted: 05 Aug 2015 15:46
I have found a bug, in my setup its very critical, i have to say that right now its a show stopper.
Let me explain what i have done so far and the function that i need.
I have a complicated setup with many rules that decide if a light should be on or off, based on time, light, buttons, windows open/close and so on.
The calculations for this is made right now in another program, i might move all over to zway but it will take much time to make modules for all calculations, but that is not the problem right now.
The issue i have right now is the function that the light should be Off when a window is open and On when window is closed, I am using a Fibaro door/window sensor for this. Here is the current flow:
Fibaro status --> Module send status to external program --> calculates if light should be on/off --> Send update to DummyDevice via /ZAutomation/api/v1/devices/ --> DummyDevice is included in If/else module and turn the light on/off.
This is working almost as it should, if i change the state on the Fibaro to fast then on or off commands get lost in space. I have debugged this and the reason is that if you send several commands in a row through /ZAutomation/api/v1/devices/ commands get lost, it does not queue the requests.
You could reproduce the issue very easy, you don't have to send commands that quick, try with on / wait 1 sek / off / wait 1 second...and commands are most likely lost.
So the question is, is there a better communication protocol that i could use instead of /ZAutomation/api/v1/ or is that api going to be rewritten to handle multiply requests?
Let me explain what i have done so far and the function that i need.
I have a complicated setup with many rules that decide if a light should be on or off, based on time, light, buttons, windows open/close and so on.
The calculations for this is made right now in another program, i might move all over to zway but it will take much time to make modules for all calculations, but that is not the problem right now.
The issue i have right now is the function that the light should be Off when a window is open and On when window is closed, I am using a Fibaro door/window sensor for this. Here is the current flow:
Fibaro status --> Module send status to external program --> calculates if light should be on/off --> Send update to DummyDevice via /ZAutomation/api/v1/devices/ --> DummyDevice is included in If/else module and turn the light on/off.
This is working almost as it should, if i change the state on the Fibaro to fast then on or off commands get lost in space. I have debugged this and the reason is that if you send several commands in a row through /ZAutomation/api/v1/devices/ commands get lost, it does not queue the requests.
You could reproduce the issue very easy, you don't have to send commands that quick, try with on / wait 1 sek / off / wait 1 second...and commands are most likely lost.
So the question is, is there a better communication protocol that i could use instead of /ZAutomation/api/v1/ or is that api going to be rewritten to handle multiply requests?