HomeGenie Forum
General Category => Troubleshooting and Support => Topic started by: amselem on March 05, 2017, 11:48:51 AM
-
Hello,
When setting a zwave dimmer via web api I use an url like this (to set the dimmer at 25%):
/api/HomeAutomation.ZWave/3/Control.Level/25
But when querying this same value with this url
/api/HomeAutomation.HomeGenie/Config/Modules.ParameterGet/HomeAutomation.ZWave/3/Status.Level
The returned value is 0.25 instead of 25
I think this is incoherent, HG is multiplying/dividing by 100 somewhere.
I'm binding this value to slider of an external application (which I don't control) and the get/set operations doesn't work correctly.
-
I agree that this is a bit non-intuitive. But, perhaps the reason is because the URL would be more complicated with a decimal value? I don't know the reason why you HG would return 25 rather than 0.25 as HG actually uses 0-1 for level values in code.
-
Hi, amselem.
That's because you are setting the value directly to ZWave device (range [0-100]) but are reading the value from HG's module properties (range [0-1]).
I suggest you use following API endpoints and read data directly from device:
- /api/HomeAutomation.ZWave/3/SwitchMultilevel.Set/35
- /api/HomeAutomation.ZWave/3/SwitchMultilevel.Get
-
Thank you very much Bounz!
You were right, I was Reading/Writing to different sources (Zwave device vs HG Module).
The api you suggested works as expected.
Regards