Jump to content

bmercier

Employees
  • Posts

    219
  • Joined

  • Last visited

Everything posted by bmercier

  1. This is not usual. Please open a ticket referencing this thread with your uuid. I will check the logs. Benoit Sent from my iPhone using Tapatalk
  2. Feedback to Amazon I guess. I never tried to report/investigate why a specific spoken would not work. Benoti
  3. This must be a temporary Amazon issue. Did you try asking vocally, through the mobile app, or the web app? If vocally, Alexa might have understood something else.
  4. Then there is an error in the URL. You should be getting an XML message coming from ISY, and your program should be running. You should get this working first before trying using the network resource. Also make sure to change your portal password as you just shared it with this post. Sent from my iPhone using Tapatalk
  5. What do you get when trying from a browser? Sent from my iPhone using Tapatalk
  6. To help troubleshoot this, keep an eye on that page. You can refresh using the refresh icon. No need to edit it. Technically, it should never be changed, except when editing if the values are considered invalid. I would suggest to change the spoken and retry. Sometimes, Alexa will understand incorrectly, especially if you have other devices with similar spokens. Try with something simple like "test", "kitchen" or "living room", common names that are easily recognizable.
  7. What is the ISY Category (The "ISY Cat." column) ? After switching it to light and saving, does the Alexa Cat. column still shows it as Light?
  8. Programs do have a status. It’s on, or it’s off, and it depends on if the program last ran the then , or the else. If you want to have a brightness level, then just expose a state variable directly. You can still turn it on or off, which will set the variable to the on value or the off value. You can then have a program that reacts to the on or off values. Benoit Sent from my iPhone using Tapatalk
  9. Not a problem. I'll delay my replies next time Benoit
  10. Yes it does. If the program is constantly restarted every 5 minutes, the 6 minute wait will never complete. The program does not have to be stopped. Restarting it using runThen is enough.
  11. There is no need for an external computer. All that is required is an ISY, and ISY Portal. Benoit
  12. Yes, that's possible. First of all, create a program that you will call via ISY Portal every 5 minutes or so: Heartbeat timer If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then $PI_Heartbeat_active = 1 Wait 6 minutes $PI_Heartbeat_active = 0 Else - No Actions - (To add one, press 'Action') And: Heartbeat notification If $PI_Heartbeat_active is not 0 Then Send Notification to 'myself@gmail.com' content 'PI Heartbeat restarted' Else Send Notification to 'myself@gmail.com' content 'PI Heartbeat stopped' Then, you need to create a network resource to trigger that program via ISY Portal. First of all, find the ID of the heartbeat program (The first one above). In the admin console, when you have your list of programs, that will be the rightmost column. It's a 4 hexadecimal digits. To get the correct URL to call this program, go to ISY Portal, on your ISY, use Select tools | ISY information. The "URL to ISY" is the base URL to call rest commands. It will look like this: https://my.isy.io/isy/969f220dfc964cdb9c4cf4ef40275a580f7f8836ed3b7dc12047aa73f7e6f999 To that URL, add /rest/programs/<Program ID>/runThen Replace <Program ID> with your program ID. You can try this URL in a browser to make sure you are getting it right. Now to create the network resource, in the admin console, go to Configuration | Network resources. Click Add. Choose https, GET, host: my.isy.io, Port: 443, Path: Everything after my.isy.io (from the above URL), encode URL: no, use SNI: No In the HTTP headers, click Add, choose Authorization, and enter your portal user ID and password. Calling this network resource should trigger your heartbeat program Now, it's a matter of creating a program that will call this network resource every 5 minutes. If the network connectivity is lost, the heartbeat program will not be fired, and your variable will become 0, which will allow the second program to send a notification, or do whatever you want to do when there is no connectivity. This program would work. If ISY is restarted, the program would start looping at 6AM next day. test If Time is 6:00:00AM Then Resource 'test' Wait 5 minutes Run Program 'test' (Then Path) Else - No Actions - (To add one, press 'Action') Benoit
  13. If you have scenes that you want to brighten/dim, set the Alexa category to light.
  14. Those are responses from the ISY. The calls are getting throught. Now it's a question of having the correct URL to achieve the result that you want. If you try the same URLs with GET and POST directly to the ISY, without portal, you should be getting the exact same result. In the first case, you are getting a 404. I believe the URL is not valid. Try it in a browser. In the second case, I assume it's a post to /service. If I recall correctly, the 715 is an error code related to subscriptions. Benoit
  15. Then I don't know what it is. It may not reach the request at all either. Adding console.log just before would help to find where the issue is. Benoit
  16. Try the URL in a browser. Those are GET requests, so that's an easy way of test them. Benoit
  17. This code is not triggering the request to ISY because the request is not actually called. At line 118, where you have: exports.handler = function (event, context) { You are reassigning a new function to exports.handler (The lambda starting point). You can't do that. It's already assigned at line 183, which is your main lambda function. And since you are just assigning a function to a variable, you are not calling the function at all. So, just remove the line "exports.handler = function (event, context) {", including the closing bracket, and try it again. Benoit
  18. I need to see the code to help. Sent from my iPhone using Tapatalk
  19. I have not seen the code. But if you simply added code at the "end" to return some Alexa voice, then the call to portal probably does not go through at all. If so, your code at the end probably does a context.succeed() which basically ends the lambda function, before the call to portal has a chance to go through. Benoit
  20. Is the lambda function triggered at all? I would suggest to add console.log() at a few places to see where it fails. Benoit
  21. Uncomment this line and check the log: // console.log('DATA:', res.body) You may be getting an error message from ISY. Also, what's the URL? Are you using runif or runthen? If you use IFTTT, you don't need to pass a username or password. The key is what identifies you. Benoit
  22. For sure, this is possible. Here's untested code that could get you started. There are easier ways to make an http calls, using the request module for example, but this one below has the advantage that you can do inline editing of your lambda function, as opposed to always having to update your code via an upload. "use strict" const https = require('https'); const username = 'portal user' const password = 'portal password' 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: '/set/your/path/here', method: 'GET', rejectUnauthorized: true, auth: username + ':' + password } 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 } If your lambda function only has to trigger a program, there's an easier and more secure way too. In ISY Portal, go to Connectivity | IFTTT / Webhooks. Click "Set Key" to set an API key Create an entry for your program Click on the small blue icon, which will give you a URL Use this URL to trigger the program. Please note that you need to use POST (Not GET)
  23. A fix has been done. It should work better now. Benoit
  24. If both HTTP/HTTPS ports were changed, you could use telnet to get command line access. The command CWP would allow you to change back your HTTP or HTTS ports. Benoit
×
×
  • Create New...