This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Official
Comments
Don't forget to check the console tho, if it is a bug within my code (and i highly doubt is) then i can fix it
Working on speech recognition now, kinda tricky but hope to get it working
Nice library to work with tho: https://www.talater.com/annyang/
Well, seem to have speech working....but to make things complicated Chrome keeps asking on every "speech command" if i allow the microphone. A quick google learned me that it only saves the choice on https urls. Currently trying to setup my own server with a self signed certificate. If this works i'll upload the current code with an option in the configs.json to enable or disable speech.
The worst part: It's hard to continuously listen for voice if you are not connected to the dashboard over https. You will have to "allow" the microphone every single time. If someone finds a workaround let me know
So to get the voice input working you have to have your webserver running on https with a self signed cert. Then you need to enable the voice in the config.json (set it to true). Then change the language to yours as well. (en-EN for english and nl-NL for dutch)
The dashboard is active listening to the Oké homey command, it doesn't bleep or anything if it recognizes that. So you just have to try "Oké homey lights on". In my tests this worked pretty well on a small distance.
On the plus side: Athom might change the way how devices are requested and controlled trough the api. This might open up ways to publish the dashboard as an app. If so, athom uses https to connect to the cloud with the cloud id. Connecting trough the homey worked trough local http requests. This is changed it the current code to homey cloud requests, since locally homey isn't able to work with https.
TL;DR
- Speech recognition working, dashboard is still speechless.
- Local requests changed to athom cloud requests due SSL (https)
- To get speech working you need to set up https for your webserver
- Athom might update their api's so this could be released as an app (not need to fiddle around with your own webserver and self signed certificates)
Here an example: (Doing it out of my head, since i dont have access to my pc at home now )
"homey_enablespeech": false,
"homey_speechlanguage": "nl-NL"
Don't mind reading it all, though!
You could (some point in the future) use some sort of wizard on first startup on which it asks for the user to put in the language, cloud ID and bearer token?
Great work! I got a feeling your paving the way for custom dashboards for Homey!
The down side on using a wizard would be to input the apikey/bearer token, not a fun thing to do on a tablet or something. Once configured in the config.json it should work on all devices. If/When Athom changes their api's there isn't much need left for the config.json. I then could use the app token to control the devices, other options then can be set within the settings page in the dashboard. Ip isn't relevant anymore as well since its localhost.
So when you have another tablet you shouldn't have to input the bearer etc?
Or did I read that wrong?
Yeah, that's something really nice.
I guess the dashboard would run on Homey itself?
The dashboard is now configured to run of a webserver, so you have to edit the config.json once. And you can connect with any device to it. (So short: Yes, set once.)
The dashboard is already capable on running on the homey itself (or at least should be, untested )
Because of using the bearer token and rest api, it isn't going to get trough appstore aproval. Another downside, you will have to connect to your dashboard trough the athom cloud (since that only uses https, local is just http). If internet is down, your dashboard will not work
I do hope somewhere in the future to publish this as an app, for now i keep developing this as if it's a webapp/website.
There is no way for an app to have it run as a web page right now, is it?
My guess is that Athom will expand the API for dashboard apps, some time in the future.
They are going "to do" something with dashboard as well, not sure how. Jeroen said on slack probably around version 1.2.0.
I hope they are going to update their regular api's sooner. This would allow for other apps more possibilities as well. For now apps are just not allowed to control or get states from devices.
I unfortunately also have some remarks.
- I would rename the config.json, "homey_cloudid" to "homey_bearertoken" this would be more in line with how homey named it.
- there seem to be a bug where lights get to be refreshed a lot every 1 to 2 seconds. causing the lights to be empty and at other times have twice the amount of lights with duplicates. on rooms with many lights this seem to be happening more often than rooms with less lights.
So for now i am not going to change that part
The duplicate entries (and missing ones) has to do with the promises on the api update interval. Somehow it isn't working as i want to. It's a known bug, but didn't found time to fix it
Thanks for letting me know tho, i'll create some issues on github to remind myself.
Well, it was planned this way. If athom changes the api's this could be done trough an app settings page.
Because my synology server is accessible from the outside, and I don't wont someone except myself to control my lights.
but i also don't want to enter a password every time.
Or is this something i should fix on the server side?
simple way:
create a .htaccess file in the homey dashboard directory (the one that contains index.html)
containing:
Thats all.
192.168.0 is my local range.
And the other is my work ip (not exactly of course)
dont know how many times a day/year for example your phone ip changes, or of this work to mac adresses (not very safe)
Check: http://www.htaccessredirect.net/
http://www.htaccesstools.com/articles/password-protection/
Works great now
Thanks for developping
Htacces is now:
btw are you Jer**** van V1?
Nice solution!
security is still an issue, not sure how this is working out when it get it to run on the homey itself.
What do you mean with "btw are you Jer**** van V1?" ?
Great its working for you tho
Your welcome.
@luccie_007, klopt!
Nu weer OT