Advertisement
Guest User

Simple Z-way login and command

a guest
Sep 11th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.51 KB | None | 0 0
  1. function test_function() {
  2.     $.ajax({
  3.         url: "http://192.168.0.188:8083/ZAutomation/api/v1/login",
  4.         method: "POST",
  5.         data: {
  6.             form: true,
  7.             login: "admin",
  8.             password: "password",
  9.             keepme: false,
  10.             default_ui: "1"
  11.         },
  12.     });
  13.     $.ajax({
  14.         url: "http://192.168.0.188:8083/ZWave.zway/Run/devices[5].instances[0].commandClasses[38].Set(25)",
  15.         method: "GET",
  16.         xhrFields: {
  17.             withCredentials: true
  18.         }
  19.     });
  20. };
  21.  
  22. $(function() {
  23.     $('.light-switch').on('click', function() {
  24.         test_function();
  25.     });
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement