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.
Official

[BETA Release] HomeyDash a Dashboard app for homey

1235742

Comments

  • Eternity said:
    After the first screen - which showd my Homey zones -  I now get blank screens gain. This must be caused by my server. Will check that out later today, other work to do.

    Thanks @swttt !
    Your welcome!
    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 :)
  • phbphb Member
    @swttt it's working for me now  :)
  • @phb Cool Good to know :)

    Working on speech recognition now, kinda tricky but hope to get it working :)

  • phbphb Member
    Wow that would be great  :)
  • Should be a new record, 50 minutes and i got speech commands working :D
    Nice library to work with tho: https://www.talater.com/annyang/
  • I have been following this thread on the background for quite sometime now.. Felt the urge to say you're doing a good job! Going to test it in a couple of days. Keep it up!
  • @Mwahhh Great! Let me know how it works for you :)

    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.
  • Oké, got the speech input working. The tablet isn't talking back tho.

    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)

  • Oh btw, noticed i didn't pushed the new config.json to github.

    Here an example: (Doing it out of my head, since i dont have access to my pc at home now :) )

    {
    "homey_cloudid": "YOUR CLOUD ID HERE",
    "homey_api": "YOUR BEARER TOKEN HERE",
    "homey_enablespeech": false,
    "homey_speechlanguage": "nl-NL"
    }
  • Updated github with the right config.json, and fixed forced https requests.
  • swttt said a lot of stuff

    TL;DR should be at the top, lol!
    Don't mind reading it all, though! :lol: 

    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!
  • @RobinVanKekem Ye was kinda late again yesterday. Noticed the TL;DR to late, so paste it somewhere in the middle. You can see it as specially put there for people who scan text first before reading ;)

    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. 
  • swttt said:

    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. 
    Agreed.
    Once configured in the config.json it should work on all devices. 

    So when you have another tablet you shouldn't have to input the bearer etc?
    Or did I read that wrong?

    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. 

    Yeah, that's something really nice.
    I guess the dashboard would run on Homey itself?

  • @RobinVanKekem ;

    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.
  • @swttt ;

    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.
  • Looks great! Certainly something I will use.
  • @RobinVanKekem Not sure if they changed it already, but it should be possible. Has already been discussed on page 1 in this topic :)

    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.
  • edited August 2016
    What is the best way to run this awesome webapp on a raspberry pi. Through Apache ? 
  • @dennisvanderhave: I am running it on apache within a docker. (<33 dockers) This docker enables https as well with a self signed certificate, so you can use the speech commands. https://hub.docker.com/r/linuxserver/apache/
  • What is the best way to run this awesome webapp on a raspberry pi. Through Apache ? 
    I use nginx web server on my Raspberry pi.
  • I have installed your dashboard and i really love the looks of it!!!!

    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.
  • @nklerk Thanks, i know the apikey isn't really a logic name.But i still hope for api changes that could make the dashboard run on the homey itself. This means we don't need a config.json anymore ;)
    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.

  • Actually, homey_cloudid is called Athom Cloud ID on Homey itself! ;)
  • @DieterKoblenz I used the homey prefix to differentiate it from (possible) other settings. If everything to control homey works stable etc. (still need to add thermostat control and a colorwheel for rgb lights) then i'll add a sabnzbd page as well. (you could turn it on/off in the settings, and provide the other details there.) This means that the config var for the ip is going to be sabnzbd_api etc.

    Well, it was planned this way. If athom changes the api's this could be done trough an app settings page.

  • luccie_007luccie_007 Member
    edited August 2016
    Is there also going to be a way to disable external access to it with a one time password?
    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:

    deny from all
    allow from 192.168.0
    allow from 80.246.200.210

    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)


  • Is there also going to be a way to disable external access to it with a one time password?
    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?
    You could put it in a folder with an .htaccess document for now. For example to add a password or to only allow connection from your internal network ip range.

    Check: http://www.htaccessredirect.net/

  • luccie_007luccie_007 Member
    edited August 2016
    found an simple tutorial,

    http://www.htaccesstools.com/articles/password-protection/

    Works great now
    Thanks for developping


    Htacces is now:
    AuthType Basic
    AuthName "Homey"
    AuthUserFile /volume1/web/Homey/.htpasswd
    Require valid-user
    deny from all
    allow from 192.168.0
    allow from 80.246.200.210

    btw are you Jer**** van V1?


  • @luccie_007 ;

    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.
  • @swttt, haha it is code language  ;)

    @luccie_007, klopt!
  • @swttt, haha it is code language  ;)

    @luccie_007, klopt!
    Ik dacht je foto al te herkennen een tijdje terug.

    Nu weer OT :smile: 

Sign In or Register to comment.