Jump to content

btreinders

Members
  • Posts

    537
  • Joined

  • Last visited

Everything posted by btreinders

  1. I would say lately the login credentials window is popping up within 10-15 minutes while the AC is open. Sometimes within even 5 minutes. Any ideas why this might be happening? If I try to log back in it never completes either. I have to restart the AC. Thanks!
  2. @bmercier Has the maintenance completed? It's noon central and the portal says my ISY is offline and I have rebooted it twice. No joy.
  3. @Brian H Thanks! That did it. I didn't do that step because I had just done it on another card. I didn't realize the card contained the firmware. To me firmware is on an eprom.
  4. Yes, through putty on the com port.
  5. I think my SD card is failing because I had issues backing up (had to delete files to get them working)(thanks to @Michel Kohanim for fixing that issue a few weeks ago) but now the ISY has gone unresponsive twice so I thought I'd try a new SD card. I put it in and formatted it (16GB SanDisk Ulta 10 HCI) but when I try to restore my back up I get "reported file size invalid" error during the restore and it fails. Before the restore system status showed it could see the card and had the right amount of free space. I know the backup is good because I had to restore it to the original SD card earlier today when it went unresponsive and that worked. The SD card that works is a 32GB SanDisk 4 HC. Could this be a card speed issue? I tried another 32GB SanDisk 4 HC and got the same error so I don't really think that's the issue. Thanks!
  6. Thanks! That did it. I had to delete another as well but it is backing up successfully now.
  7. Not that I am aware of. It is doing the same between the two computers I have tried from. Edit: Jan 20 was the last java update and I have successful backups since then.
  8. @Michel KohanimI am getting a zip file could not be created with another error "Could Not Retrieve File /CONF/NODES/UN0205.BIN while trying to backup. I am running 5.0.16B and have successfully created backups previously with this version. I see other issues that are similar in the forums but none with a .bin extension. My question is, can I safely delete it and try again like the other similar issues? Or do I just need to go back to a previous backup and restore? I have several changes that I'd like to keep but if going back is the only way then I'll do that. Thanks!
  9. @kclenden Wow, I feel very stupid! I should have caught that. Thanks for the info! I really appreciate all the help in these forums!
  10. @Michel Kohanim Precip Today - [ID 04A3][Parent 03E0] If 'OpenWeatherMap / OpenWeatherMap' Rain Today is not '$PRECIP_TODAY Inches' And 'OpenWeatherMap / OpenWeatherMap' Rain Today > '$PRECIP_TODAY Inches' Then $PRECIP_TODAY = 'OpenWeatherMap / OpenWeatherMap' Rain Today Inches Else $PRECIP_TODAY += 'OpenWeatherMap / OpenWeatherMap' Rain Today Inches
  11. @Michel Kohanim Any ideas why this caused an infinite loop? @DaveStLou Thanks! I will definitely implement this!
  12. @Michel Kohanim Yes, and I used it to get things back but was just wondering why it happened in the first place. Setting a += for a node server value shouldn't cause that should it?
  13. @Michel Kohanim I do have Zwave but i added it to the ISY so I do have a PLM. I assume that will stop executing with the PLM unplugged or does just having Zwave let it execute with it unplugged? I definitely had an issue but I am not sure why. Under the else of a program I set a variable += to a node server rain today value and then to test it I ran the else. That is when it stopped responding. Even after a reboot it would not respond. Thanks!
  14. I waited over a half hour and the console would not respond. I rebooted it and never got back into the console. Even telneting was locking up intermittently, like no response from the prompt sometimes. Finally gave up and tried FR from telnet which didn't work. Had to hard reset to fix it.
  15. @Michel Kohanim Is there a command from a telent session to stop program execution? I had a program that uses a += that apparently has caused an infinite loop. Thanks!
  16. I had to hard reset my ST hub (had to change from ethernet to wireless, yeah, crazy) and now the hub does not find the ISY when it's in learn mode. I deleted the controller in the ISY and in ST app but still won't see the ISY. The ISY currently can control all the Z wave devices except the one I have paired back to the ST hub. If I add more Z wave devices back into the ST hub I am afraid I'll lose ISY control them too. Please help and thanks in advance.
  17. Thanks so much! That helped me figure it out. I had runthen vice runThen.
  18. @bmercier Any ideas? Thanks!
  19. @bmercier I have successfully made a call to IFTTT using async, promise and await. This is with the exact same code with just port changed to 80, https changed to http, username and password commented out and method changed to POST. Could it be something with the http versus https or my.isy.io just isn't responding? Here is the response I get back with GET and POST: <?xml version="1.0" encoding="UTF-8"?><RestResponse succeeded="false"><status>404</status></RestResponse> With POST: ?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Body><UDIDefaultResponse><status>715</status><info>n/a</info></UDIDefaultResponse></s:Body></s:Envelope>
  20. @bmercier It does work in Firefox. Chrome pops up the username and password box even those are in the URL and Edge does the same. If I put a console.log after the res.on it never makes it there.
  21. @bmercier I removed them and it still seems to return before the call is made. I have tried using a Promise but I don't really understand it. Sure appreciate all the help! I am also having trouble making the call from Chrome now too so I am not sure if I am using the right url. Does it look correct? Thanks!
  22. // 1. Text strings ===================================================================================================== // Modify these strings and messages to change the behavior of your Lambda function let speechOutput; let reprompt; let welcomeOutput = "Welcome to my home automation demo, You can ask me to demo the whole house, or just certain systems like lights, locks, cameras, audio video systems, ceiling fans, etc..."; let welcomeReprompt = "You can say something like demo the whole home, or demo the lights. I will give you short demo of the system of your choice."; // 2. Skill Code ======================================================================================================= "use strict"; const Alexa = require('alexa-sdk'); const APP_ID = undefined; // TODO replace with your app ID (OPTIONAL). speechOutput = ''; const handlers = { 'LaunchRequest': function () { this.emit(':ask', welcomeOutput, welcomeReprompt); }, 'AMAZON.HelpIntent': function () { speechOutput = 'Placeholder response for AMAZON.HelpIntent.'; reprompt = ''; this.emit(':ask', speechOutput, reprompt); }, 'AMAZON.CancelIntent': function () { speechOutput = 'Placeholder response for AMAZON.CancelIntent'; this.emit(':tell', speechOutput); }, 'AMAZON.StopIntent': function () { speechOutput = 'Ok, stopping my home demo'; this.emit(':tell', speechOutput); }, 'SessionEndedRequest': function () { speechOutput = 'Demo Ended'; //this.emit(':saveState', true);//uncomment to save attributes to db on session end this.emit(':tell', speechOutput); }, 'AMAZON.NavigateHomeIntent': function () { speechOutput = ''; //any intent slot variables are listed here for convenience //Your custom intent handling goes here speechOutput = "This is a place holder response for the intent named AMAZON.NavigateHomeIntent. This intent has no slots. Anything else?"; this.emit(":ask", speechOutput, speechOutput); }, 'playdemointent': function () { var speechOutput = ''; var speechReprompt = ''; //any intent slot variables are listed here for convenience let system_typeSlot = resolveCanonical(this.event.request.intent.slots.system_type); console.log(system_typeSlot); let lengthSlot = resolveCanonical(this.event.request.intent.slots.length); console.log(lengthSlot); var demos = { 'lights' : { 'short' : '/isy/<isy address>/rest/programs/0024/runthen', 'long': '/isy/<isy address>/rest/programs/0024/runthen' }, 'cameras' : { 'short' : '/isy/<isy address>/rest/programs/013F/runThen', 'long': '/isy/<isy address>/rest/programs/013F/runThen' }, 'fans' : { 'short' : '/isy/<isy address>/rest/programs/0367/runThen', 'long': '/isy/<isy address>/rest/programs/0367/runThen' }, 'pool' : { 'short' : '/isy/<isy address>/rest/programs/02C9/runThen', 'long': '/isy/<isy address>/rest/programs/02C9/runThen' }, 'Lock' : { 'short' : '/isy/<isy address>/rest/programs/0439/runIf', 'long': '/isy/<isy address>/rest/programs/0439/runIf' } } var lengths = [ 'short', 'long' ]; var demo = ''; var length = ''; if(!system_typeSlot) { this.emit(':ask', 'I did not hear a system. Which system do you want to demo?', 'You can say something like cameras, lights, audio video system, etc..'); } else { demo = system_typeSlot.toLowerCase(); this.attributes['demo'] = demo; } if(lengthSlot) { length = lengthSlot.toLowerCase(); } if(demos[demo]) { if(lengthSlot && lengths.indexOf(lengthSlot) > -1) { length = lengthSlot; } else { length = 'short'; } const url = demos[demo][length]; "use strict"; const https = require('https'); const username = 'xxxxxxx@hotmail.com'; const password = 'xxxxxxxx'; https.globalAgent = new https.Agent({ keepAlive: true }); exports.handler = function (event, context) { console.log('Input:', event); var options = { protocol: 'https:', hostname: 'my.isy.io', port: 443, path: url, method: 'GET', rejectUnauthorized: true, auth: username + ':' + password }; // console.log(); var req = https.request(options); // when the response comes back req.on('response', function(res){ res.body = ''; res.setEncoding('utf-8'); res.on('data', function(chunk) { res.body += chunk; }); // when the response has finished res.on('end', function() { console.log('DATA:', res.body); context.succeed(res.body); }); res.on('error', function (err) { console.log('ERROR:', err); context.fail(JSON.stringify({ error: 'error' })); }); }); // write data to request body //req.write(body); req.end(); // Can't recall if you need this for a GET }; speechOutput = 'Ok, here is a ' + length + ' demo of the ' + demo; this.emit(":tell", speechOutput); } else { speechOutput = 'Sorry, the system you asked for is not supported yet.'; speechReprompt = 'I support lights, locks, ceiling fans, audio video systems, cameras, pool equipment, etc..'; } this.emit(":tell", speechOutput); }, 'Unhandled': function () { speechOutput = "The skill didn't quite understand what you wanted. Do you want to try something else?"; this.emit(':ask', speechOutput, speechOutput); } }; exports.handler = (event, context) => { const alexa = Alexa.handler(event, context); alexa.appId = APP_ID; // To enable string internationalization (i18n) features, set a resources object. //alexa.resources = languageStrings; alexa.registerHandlers(handlers); //alexa.dynamoDBTableName = 'DYNAMODB_TABLE_NAME'; //uncomment this line to save attributes to DB alexa.execute(); }; // END of Intent Handlers {} ======================================================================================== // 3. Helper Function ================================================================================================= function resolveCanonical(slot){ //this function looks at the entity resolution part of request and returns the slot value if a synonyms is provided let canonical; try{ canonical = slot.resolutions.resolutionsPerAuthority[0].values[0].value.name; }catch(err){ console.log(err.message); canonical = slot.value; }; return canonical; }; function delegateSlotCollection(){ console.log("in delegateSlotCollection"); console.log("current dialogState: "+this.event.request.dialogState); if (this.event.request.dialogState === "STARTED") { console.log("in Beginning"); let updatedIntent= null; // updatedIntent=this.event.request.intent; //optionally pre-fill slots: update the intent object with slot values for which //you have defaults, then return Dialog.Delegate with this updated intent // in the updatedIntent property //this.emit(":delegate", updatedIntent); //uncomment this is using ASK SDK 1.0.9 or newer //this code is necessary if using ASK SDK versions prior to 1.0.9 if(this.isOverridden()) { return; } this.handler.response = buildSpeechletResponse({ sessionAttributes: this.attributes, directives: getDialogDirectives('Dialog.Delegate', updatedIntent, null), shouldEndSession: false }); this.emit(':responseReady', updatedIntent); } else if (this.event.request.dialogState !== "COMPLETED") { console.log("in not completed"); // return a Dialog.Delegate directive with no updatedIntent property. //this.emit(":delegate"); //uncomment this is using ASK SDK 1.0.9 or newer //this code necessary is using ASK SDK versions prior to 1.0.9 if(this.isOverridden()) { return; } this.handler.response = buildSpeechletResponse({ sessionAttributes: this.attributes, directives: getDialogDirectives('Dialog.Delegate', null, null), shouldEndSession: false }); this.emit(':responseReady'); } else { console.log("in completed"); console.log("returning: "+ JSON.stringify(this.event.request.intent)); // Dialog is now complete and all required slots should be filled, // so call your normal intent handler. return this.event.request.intent; } } function randomPhrase(array) { // the argument is an array [] of words or phrases let i = 0; i = Math.floor(Math.random() * array.length); return(array[i]); } function isSlotValid(request, slotName){ let slot = request.intent.slots[slotName]; //console.log("request = "+JSON.stringify(request)); //uncomment if you want to see the request let slotValue; //if we have a slot, get the text and store it into speechOutput if (slot && slot.value) { //we have a value in the slot slotValue = slot.value.toLowerCase(); return slotValue; } else { //we didn't get a value in the slot. return false; } } //These functions are here to allow dialog directives to work with SDK versions prior to 1.0.9 //will be removed once Lambda templates are updated with the latest SDK function createSpeechObject(optionsParam) { if (optionsParam && optionsParam.type === 'SSML') { return { type: optionsParam.type, ssml: optionsParam['speech'] }; } else { return { type: optionsParam.type || 'PlainText', text: optionsParam['speech'] || optionsParam }; } } function buildSpeechletResponse(options) { let alexaResponse = { shouldEndSession: options.shouldEndSession }; if (options.output) { alexaResponse.outputSpeech = createSpeechObject(options.output); } if (options.reprompt) { alexaResponse.reprompt = { outputSpeech: createSpeechObject(options.reprompt) }; } if (options.directives) { alexaResponse.directives = options.directives; } if (options.cardTitle && options.cardContent) { alexaResponse.card = { type: 'Simple', title: options.cardTitle, content: options.cardContent }; if(options.cardImage && (options.cardImage.smallImageUrl || options.cardImage.largeImageUrl)) { alexaResponse.card.type = 'Standard'; alexaResponse.card['image'] = {}; delete alexaResponse.card.content; alexaResponse.card.text = options.cardContent; if(options.cardImage.smallImageUrl) { alexaResponse.card.image['smallImageUrl'] = options.cardImage.smallImageUrl; } if(options.cardImage.largeImageUrl) { alexaResponse.card.image['largeImageUrl'] = options.cardImage.largeImageUrl; } } } else if (options.cardType === 'LinkAccount') { alexaResponse.card = { type: 'LinkAccount' }; } else if (options.cardType === 'AskForPermissionsConsent') { alexaResponse.card = { type: 'AskForPermissionsConsent', permissions: options.permissions }; } let returnResult = { version: '1.0', response: alexaResponse }; if (options.sessionAttributes) { returnResult.sessionAttributes = options.sessionAttributes; } return returnResult; } function getDialogDirectives(dialogType, updatedIntent, slotName) { let directive = { type: dialogType }; if (dialogType === 'Dialog.ElicitSlot') { directive.slotToElicit = slotName; } else if (dialogType === 'Dialog.ConfirmSlot') { directive.slotToConfirm = slotName; } if (updatedIntent) { directive.updatedIntent = updatedIntent; } return [directive]; }
  23. @bmercier After more research I have found that the handler function is exiting because the this.emit is being executed. I have tried using async and promise with the same result. The function is just exiting too soon. Any ideas? This is driving me crazy. Thanks!
  24. @bmercier Yes, I believe you are correct. The function is terminating before the http request is finished. Any idea on how to force it to wait? I don't see a context.succeed() after the call but the function does exit.
  25. @bmercierYes, it does get triggered, I put speech outputs after the call and it does execute them. I am using speech outputs as debug but I do notice that it will only execute the first one it comes to. I don't know if it stops at that point or continues to execute. Right now I just have it say Made It right after the https code you gave me and it does say Made it. Strangely if I do not have a speech output in there at all I get "There was a problem with the requested skill's response". What I am trying to accomplish is create a skill where Alexa will demo my home automation system. It will ask the user what system do you want to demo or demo the whole house. I would then have Alexa say something like, ok, demoing the lights, or here is a demo of cameras being cast to the TV, or I can lock the front door, etc....and make rest calls to execute the programs/devices/scenes etc.. in the ISY.
×
×
  • Create New...