Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

Posted

hi

 

i trying to make a scene with WOL but with no success

I already have one scene that turn on the projector, home theater and i whant to wake up xbmc(KODI) with WOL but there are no options in the scene maker to do that

 

thanks

 
 

 

 

Posted

i have that setup using LUA,

have had a look in block scene and looks like it cant be done. i didnt see the options.

 

under lua

 

fibaro:call(deviceID, 'turnOn')

  • 2 weeks later...
Posted
--[[ 

 %% properties 

 %% globals 

 --]] 

 

 -- convert MAC adress, every 2 Chars (7-bit ASCII), to one Byte Char (8-bits) 

local selfId = fibaro:getSelfId();    

 local icon = fibaro:get(selfId, "deviceIcon"); 

 fibaro:call(selfId, "setProperty", "currentIcon", icon)

 

function convertMacAddress(address) 

   local s = string.gsub(address, ":", ""); 

   local x = "";  -- will contain converted MAC 

   for i=1, 12, 2 do 

     x = x .. string.char(tonumber(string.sub(s, i, i+1), 16)); 

   end 

   return x; 

 end 

 

 fibaro:log("Start process"); 

 

 -- MAC adress 

 local _macAddress = convertMacAddress("74:D0:2B:7F:B5:6F"); --put here your macadress

 -- Create Magic Packet 6 x FF 

 local _magicPacket = string.char(0xff, 0xff, 0xff, 0xff, 0xff, 0xff); 

 -- Broadcast Address 

 local _broadcastAddress = "255.255.255.255"; 

 -- Default port used 

 local _wakeOnLanPort = 9; 

 

 fibaro:sleep(750); 

 

 for i = 1, 16 do 

   _magicPacket = _magicPacket .. _macAddress; 

 end 

 

 fibaro:log("Magic packet successfully created"); 

 

 fibaro:sleep(1000); 

 

 socket = Net.FUdpSocket(); 

 socket:setBroadcast(true); 

 

 local bytes, errorCode = socket:write(_magicPacket, _broadcastAddress, _wakeOnLanPort); 

 --check for error      

 if errorCode == 0 then 

   fibaro:log("Successfully sent"); 

 else 

   fibaro:log("Transfer failed"); 

 end 

 

 -- clean up memory 

 socket = nil; 

 

 fibaro:sleep(1000); 

 fibaro:log("Please wait for the server startup."); 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...