2014-02-22, 11:44
(2014-02-21, 16:08)giftie Wrote:(2014-02-21, 10:28)wo0d1e Wrote:(2014-02-21, 04:57)giftie Wrote: If all that iRule needs is UDP Broadcasts you can do them directly from home_automation.py. This is how I wrote the home_automation.py for EventGhost.
The EventGhost Version is available here -> https://github.com/Giftie/home_automatio...omation.py
I have a UDP Broadcast function in the script's utils module.
How to use it:
You need to call the function in the following way:
Code:utils.broadcastUDP( data, port = 8278, ipaddress = '255.255.255.255' ):
data - data being sent to iRule
port - data port to broadcast on
ipaddress - Send it on the general broadcast port or you can point it to a specific ip.
Not much else... Hope this helps...
Wow :-) a response direct from the man himself. Thanks for the response Giftie. So I can do this direct from within the home_automation.py. If I use your linked EG home_automation.py. where you have:
utils.broadcastUDP( "<b>CE_Automate<li>trivia_intro</b>" ) Which calls EG (But is not needed for my needs)
I can swap this for
utils.broadcastUDP( !R1D1FdP32, port = 9760, ipaddress = '255.255.255.255 ) (and fire out a direct UDP broadcast tp the listening WifiLink)
Correct me if I am wrong Giftie, I promise my learning curve is a short one :-) and thanks again for such a quick response.
You would need to make the data into a string by surrounding it by quotes:
Code:utils.broadcastUDP( "!R1D1FdP32", port=9760 ) # don't need the ipaddress as 255.255.255.255 is already set
I didn't want to clog up the forums with a million replies, but I just wanted to say a huge thanks for the advice regarding the HA and my query. I am moving home at the moment so I cannot wait to try the script out at the new pad. I will no doubt be back if I run into difficulty. One final query though you mentioned # don't need the ipaddress as 255.255.255.255 is already set.
Does this mean I can straight drop the EG home_automation.py. to userdata/addon_data/script.cinema.experience/ha_scripts and just adjust my call functions for my needs? Oh ok maybe one more thing, if I don't use a particular feature say "Coming attractions intro" cam I omit the code from beneath it in your script? or can i leave it as it wont't trigger if I don't have it enabled ? Thanks in a advance for your advice or the advice of any other member of the forum.