-
Posts
14889 -
Joined
-
Last visited
Everything posted by larryllix
-
You have unlinked references in your programs because you didn't follow the instructions given. Your programs have then been labelled manually with paragraph numbers that do not relate to anything else. The "why" is so other people can read your programs not imagine what they actually contain, and then offer help or advice. eg: Where is the program this line runs? Run Program 'Casita Lights Off Execution' (Then Path) Note: A scene is not required to dim lights. Program lines can do this quite well. Personally I would set the lights to a dim value (as a warning) and then turn them off maybe 30-60 seconds later all inside the same program. Each to his own here and whatever you feel comfortable with, though. Programs can dim to any value, at any dimming rate, you desire.
-
admin console | right click programs | copy to clipboard | past in code <> box in forum.
-
Look it over and extract what you can. Ask pointed questions and I will try to help smaller pieces at a time. This took a long time to extract from documents and I found most of the "official" documents still don't work as they state. Python3 is still a zoo and there doesn't ever seem to be any manual that 100% works. BTW: There is free python3 app for windows 10 and they work very well, along with better editors that analyse, format your code, and give good hints for problems. Some Win 10 python3 code is slightly different but not likely you will ever find the differences. One snag is the EOL codes are different between linux and Win 10 editors.
-
#!python3 NRbridge.py #Program to pass ISY Network Resource calls to MagicHome LED controller drivers #by larryllix (UDI forum), March 3, 2021 # Format Network resource as 'ledenet'/command/bulb/colour/RGBlevel/Wlevel/speed/effect # Device type ='magichome' # command = 'on', 'off', 'set', 'effect' # bulb = 0, 1 - n. 0 = all bulbs on controller # colour = 0-255, 0=Red, 85=Green, 170=Blue # RGBlevel = 0-100% brightness of the RGB LEDs # Wlevel = 0-100% brightness of the white LEDs # speed = used for multi-bulb effects # effect = 0-? native bulb effects or 23-37 for multi-bulb animations from http.server import BaseHTTPRequestHandler, HTTPServer import urllib.request import base64 import time from magichome import magichome # Server (this CPU) IP address server_IP = '192.168.0.179' server_port = 8000 # ISY parameters to be defined by user ISY_username = 'xxxxxx' ISY_password = 'xxxxxxxx' ISY_IP = '192.168.0.161' # Heartbeat into ISY variable ISY_HBpage = 2 # 1=Integer, 2=State ISY_HBaddr = 83 # ISY heartbeat variable ISY_HBperiod = 90 # In seconds. toggles ISY flag variable ISY_HBlast_sent = 0.0 # HTTPRequestHandler class class myHTTPServer_RequestHandler(BaseHTTPRequestHandler): def do_GET(self): global last_time global ledenet_passed, ledenet_passed_valid global bulbList words = self.requestline.split() passed = words[1].split("/",20) if len(passed) > 3: type = str(passed[1]).strip().lower() if type == 'magichome': self.send_response_only(200) # send ACK response self.end_headers() time.sleep(0.001) # allow I/O time slice message, bulbList = magichome(bulbList, passed[2:]) report(message) else: self.send_error(501) # send format error response self.end_headers() time.sleep(0.001) # allow I/O time slice report("NRbridge: Type undefined. Received:" + str(type) + " ***") else: # wasn't a GET self.send_error(400) # send NAK response self.end_headers() time.sleep(0.001) # allow I/O time slice report("NRbridge: ISY GET:format error! ***") return # Write ISY handshake variable via REST i/f def write_ISY(data): ISY_rest = "/rest/vars/set/%s/%s/%s" % (ISY_HBpage, ISY_HBaddr, data) get_url = urllib.request.Request('http://' + ISY_IP + ISY_rest) #format the URL ISY_authorise = base64.b64encode((ISY_username+":"+ISY_password).encode('utf-8')) #encode it get_url.add_header("Authorization", 'Basic %s' % ISY_authorise.decode('utf-8')) try: r = urllib.request.urlopen(get_url) time.sleep(0.001) # allow I/O time slice returned = r.read() r.close() time.sleep(0.001) # allow I/O time slice except: report("NRBridge: ISY heartbeat send failed!***") return #------------------------------------- # Get server setup try: httpd = HTTPServer((server_IP, server_port), myHTTPServer_RequestHandler) except: print('') report("NRbridge: Not started! May already be running * * * * * *") exit() print('') report('NRbridge: started. . .') heartbeat = 0 # Get list of sockets and status of all bulbs message, bulbList = magichome(bulbList, ['initialise']) report(message) # Main loop while(True): # Check for incoming command httpd.timeout = 2.0 httpd.handle_request() # ISY heartbeat signal if time.time() >= ISY_HBlast_sent + ISY_HBperiod: if heartbeat != 1: heartbeat = 1 else: heartbeat = -1 write_ISY(heartbeat) ISY_HBlast_sent = time.time() Here is some code to receive a NR GET command as well as a handshake back into ISY's REST protocol to flip a variable back and forth, so ISY knows if my NRbridge.py is alive. This was originally on a RPi but I moved it onto polyisy until polyglot v2 came out which caused it to stall randomly. It now is back on an RPi working fine again. The NR looks like this http://192.168.0.xx:8000/magichome/set/bulb#/hue/RGBlevel/Wlevel/..... You can parse as many parameters as you like. I just pass them through to my MagicHome handler to sort out the specifics for that protocol. Parameters received via Ethernet are all Ascii text and numbers need to be type converted. The NR is mostly ISY Integer variables so that one Effect, one Set, one On, and one Off NR (total of 4 NRs) handle everything you can do to my thirty five bulbs and 10 RGBWW strip controllers.
-
It is both. It will trigger program evaluation at both of it's node times, evaluating as True to run Then, and as False to run Else. It is also a status that is True between the times, and False outside the time framing. When used in a program that is disabled it becomes only a status condition. ISY will only make available whichever construct each conditional offers.
-
...and one cannot use AND between three control/switched conditions. Only one control/switched condition line can ever be true at one time, and the combined result will always be False. To use AND (in this instance) one must use status conditions.
-
Most programs became "red" after upgrading to 5.3.0?
larryllix replied to jruben4's topic in IoX Support
If you are still concerned, check the Program Summary tab for the Last Run column times indicated. -
UDI may be aware of a method to save his bacon. Other than that, you can factory reset your ISY. load an ISY image, restore a good backup, and be back in business with new security credentials in about an hour.
-
Most programs became "red" after upgrading to 5.3.0?
larryllix replied to jruben4's topic in IoX Support
They should be red, indicating they last ran False / Else until the next trigger leaving them green, indicating they last ran True / Then. BTW: You have modified your Christmastree programs and haven't saved the changes. -
One step missing is to reload the ISY firmware image. IIRC it will be one of the only options available on the admin console the first access. Then you can load your backup file. Sent from my SM-G781W using Tapatalk
-
yeah. I have been thinking about an HTML chart to show the options of all the devices to show what andcwhen with just checkmark but have never gotten a 'round tuit. Sent from my SM-G781W using Tapatalk
-
Changing state from 10% to 11% is also an event. It's mostly about semantics anyway.
-
Note: A "control switched on/off" is always false when tested by another initiation/trigger. It can only be True when it calls the attention of the program to evaluate it. eg. If control X is switched On AND If control Y is switched On. will never be true. One statement can be true but, the other will always be False at the same time.
-
Did you do a power cycle? I find many warm reboots on devices don't seem to do it properly for me anymore.
-
Just use the old ISY technique using a long off delay timer, and set the MS II timer to something short...say 15 or 30 seconds, to avoid too much battery and Insteon protocol action. You may want to disable the Off commands from the MS II, if you are not going to use them, to save battery life. This should work if motion is not continuously seen by the MS II during your time out period. If motion is seen before the MS II internal timeout then your light may time off occasionally. You may be able to use a one and only one set of programs to ensure a long timer, ignoring retriggers, while a shorter timer using retriggers runs, and ORed together to get the best of both timing logics.
-
Telnet is not the Internet and no Internet access is needed. Port forwarding is not needed and should not be enabled much, if at all. The IP addresses you are posting would not even work outside your LAN. I forget the syntax for Telnetting (look it up on duckduckgo.com) but it is done from an open command window on your PC or laptop. https://www.lifewire.com/what-is-telnet-2626026
-
Nope. I never have worked out a decent way. I let the MSII do the timing and turn the lights on and off now. However ISY can dim the light in the scene dependent on time of day. Only the length of time cannot be adjusted. My MS IIs have all been retired to occupancy detectors now, except one in my laundry room. The internal timer is retriggerable too so it works OK in that application.
-
Yup, my google calendar connection disappeared two weeks ago, and when I got it back it was inside my other gmail account somehow???. Suddenly last week, the original account connection appeared again and I had duplicate events all through my calendar, until I removed the google calendar found inside my other google account. Google plays with their security process frequently and annoys the heck out of clients with repeated logins every time some code writer thinks s/he has a better idea. Then, they try to make the client think they forgot their password, so they can get another piece of personal information each new login, from him/her.
-
Use the "restore" command on each device in the admin console and then test again. You may be missing a link in some fan controllers.
-
I use a few state variables that trigger banks of programs, scenes, and NRs to control my coloured lighting and my white lighting. When I want Chistmas lighting I use this. Set $sRGBW.mode = $cMODE.XMAS Set $sWhite.mode = $cMODE.XMAS <---- some predefined permanent value in the constant variable (Integer type) ..and the banks of programs do it all. When you "borrow" a lamp for temporary usage/flashing alarms, etc, the status quo can be returned by replacing the variable with the saved/same value, and your ISY will restore everything again.
-
Welcome to Google security advances beta! I get this on some google or gmail service about once per month for the last five years. Another new summer student working on his latest security idea.
-
I use a combination of techniques. For alarming methods I use scenes containing every Insteon light and noise maker in one scene, so I can flash it on and off. For controlling levels of Insteon bulb circuits in my Gathering room I use programs and continuously vary the levels via programs to simulate sunset and late night lighting fade down. Of course a lot of that is combined with 15 or so WiFi RGBW bulbs and lighting strips too. If you operate a lot of Insteon devices from a program you need to insert Wait 1-2 seconds between more than 2-3 operations or you can overrun ISY's Insteon protocol cache. That gives a random bulb change look that isn't desirable. Ramping can help that somewhat. I do use scenes for my same Gathering room bulbs but they are grouped into scenes like "FullOn", "Bright", "Dim", "TV Watching", "Reading". Those are then combined with WiFi RGBW lighting to create the same brightness levels as well as festive coloured lighting. My decks and porch do the same. The MagicHome bulbs are under $10 each and I run a piece of software on a RPi that groups them into scene operations. That is controlled by three ISY NR's and variables inside ISY all based on percent levels.
-
Use programs to scale through useful brightness levels. I won't use scenes much. I find the really only useful levels to be about 100%, 40%, 20% , and 10-12%, depending on LED bulbs low end capabilities without flickering and extinguishing. It should oly take a few minutes to drag and drop 75 devices into each scene. You aren't going to do it more than once. ISY V5 has made setting levels to a variable and I use it do gradually dim many bulbs to simulate a sunset style lihting drop by multiplying the level of each bulb by a fixed percentage each iteration. I wouldn't try this with scenes as you may wear a few Insteon device EPROMs out, constantly rewriting them.
-
Polisy has become musical when rebooting. Is this normal?
larryllix replied to gviliunas's topic in Geek Batch
Can we use it for a musical instrument until fixed?