Skip to content

Instantly share code, notes, and snippets.

@integrii
Last active November 22, 2022 13:03
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save integrii/021f272f2cad0540fc3c to your computer and use it in GitHub Desktop.
Save integrii/021f272f2cad0540fc3c to your computer and use it in GitHub Desktop.
RaZberry API ZAutomation/ZAPI Examples
# I had a LOT of trouble finding working examples of the ZAutomation API for RaZberry API. I eventually figured out what exactly to use by combining information from multiple sources and sniffing requests from the 'Expert UI'. Some areas I found information:
- http://docs.zwayhomeautomation.apiary.io/
- http://wiki.micasaverde.com/index.php/ZWave_Command_Classes
- https://www.npmjs.org/package/mqtt-zway
- The included PDFs
- The expert API area on the device web UI
- https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo?hl=en (Postman POST/GET sniffer)
# Some general RaZberry API commands:
Find information about controller
- http://192.168.2.2:8083/ZWaveAPI/Run/controller
Add a device to network (start include process)
- http://192.168.2.2:8083/ZWaveAPI/Run/controller.SetLearnMode(1)
Stop looking for a device to add to the network
- http://192.168.2.2:8083/ZWaveAPI/Run/controller.SetLearnMode(0)
Find all devices with all their information
- http://192.168.2.2:8083/ZWaveAPI/Run/devices
Find the command classes available on device 2
- http://192.168.2.2:8083/ZWaveAPI/Run/devices[2]
Send on command to device id 3 in group 0 with command class 38:
- http://192.168.2.2:8083/ZAutomation/api/v1/devices/ZWayVDev_3:0:38/command/on
Send exact level (0-100) to device 3 on channel 0 and command class 38:
- http://192.168.2.2:8083/ZAutomation/api/v1/devices/ZWayVDev_3:0:38/command/exact?level=20
Send off command to device id 3 in group 0 with command class 38:
- http://192.168.2.2:8083/ZAutomation/api/v1/devices/ZWayVDev_3:0:38/command/off
Change blue color on Zipato RGBW light bulb when it is device 3:
http://raspberrypi:8083/ZWaveAPI/Run/devices[3].instances[0].commandClasses[0x33].Set(4,255)
NOTES:
- Your added devices will start out at device id 2 and number upwards.
- The command class must be the numerical vaue of the type your device supports on the wiki
- The different command options are available on http://docs.zwayhomeautomation.apiary.io/ in the devices section
@mandy-0810
Copy link

Hi, Is there any API from which i can get the current status of the devcie

@packdev122
Copy link

Hi
I can get the events of locks from the doorlocklogging command class.
But the time is incorrect. Also the results are not in good order and I cannot understand how to work with them.
Could you please help me?

@mguinness
Copy link

Find the command classes available on device 2
- http://192.168.2.2:8083/ZWaveAPI/Run/devices[2]

I had trouble getting this to work with curl and figured out that I had to encode the square brackets.

So the url became http://192.168.2.2:8083/ZWaveAPI/Run/devices%5B2%5D instead to work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment