Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IA7 Issue Tracking #490

Closed
hplato opened this issue Mar 18, 2015 · 31 comments
Closed

IA7 Issue Tracking #490

hplato opened this issue Mar 18, 2015 · 31 comments
Milestone

Comments

@hplato
Copy link
Collaborator

hplato commented Mar 18, 2015

Created a wiki page for usage, wanted to create a thread to track issues.
https://github.com/hollie/misterhouse/wiki/Modern-Web-Interface---IA7

@hplato
Copy link
Collaborator Author

hplato commented Mar 18, 2015

print_speaklog is a bit of a kludge. The print_speaklog_current_time returns $Print_Log_Time instead of $Speak_Log_Time and json_server.pl print_speaklog sub has to add an empty array item otherwise the javascript self-call doesn't get activated.

@hplato
Copy link
Collaborator Author

hplato commented Mar 18, 2015

javascript.js updateStaticPage mixed content script also doesn't work with a time parameter. So right now it constantly polls all objects via json which might put a load that could impact other processing.

Fixed: added item= parameter to json_server.pl

@hplato
Copy link
Collaborator Author

hplato commented Mar 18, 2015

Be good to load all the libraries locally (bootstrap, font awesome, jQuery) to reduce the dependancy of the internet on local MH operations. Have started this.

Done

@hplato
Copy link
Collaborator Author

hplato commented Mar 18, 2015

Remove Audrey stuff since the Audrey can't operate IA7 anyways

Done

@hplato
Copy link
Collaborator Author

hplato commented Mar 18, 2015

Add in the weather station & RRD graphs

Weather station added. Issue: graphs don't show up on iPads?

@hollie
Copy link
Owner

hollie commented Mar 18, 2015

I'm trying to follow the docs on the IA7 wiki page. The first thing I would need to do fails for me: I've set the ia7_enable parameter.

But then I should do:

copy the data/collections.json and put it in your local data directory

I don't find this 'collections.json' file in my data folder.

Am I missing something? I'm running the latest version from master. Should I see somewhere in the logs when this file is created?

@hplato
Copy link
Collaborator Author

hplato commented Mar 18, 2015

Ah, can you change that to data\web\collections.json? Its showing there on my branch.

Sent from my mobile device.

On Mar 18, 2015, at 3:19 PM, Lieven Hollevoet notifications@github.com wrote:

I'm trying to follow the docs on the IA7 wiki page. The first thing I would need to do fails for me: I've set the ia7_enable parameter.

But then I should do:

copy the data/collections.json and put it in your local data directory
I don't find this 'collections.json' file in my data folder.

Am I missing something?


Reply to this email directly or view it on GitHub.

@hollie
Copy link
Owner

hollie commented Mar 18, 2015

Hmm, it does not show up for me in data/web either.

I verified that ia7_enable is working fine and that the wiki link is fixed. So I have your latest changes in my clone.

@hplato
Copy link
Collaborator Author

hplato commented Mar 18, 2015

Do you have a separate data directory? This file exists in the mh/data directory. You should be able to find it on my github page.

Collections.json is there otherwise things wouldn't work! You only need to copy it if you want to have a separate unique version.

Sent from my mobile device.

On Mar 18, 2015, at 3:32 PM, Lieven Hollevoet notifications@github.com wrote:

Hmm, it does not show up for me.

I verified that ia7_enable is working fine and that the wiki link is fixed. So I have your latest changes in my clone.


Reply to this email directly or view it on GitHub.

@hollie
Copy link
Owner

hollie commented Mar 21, 2015

OK, I was not completely following your thought process :-) I was under the impression the collections.json file was generated based on the items on your setup and hence that is was generated under my local data/web folder. Part of this confusion was that I have a custom web interface for ia5 and that you had to define the folder for customization in mh.in with the 'html_alias_my_mh' field.

Now I understand it is the collection of times that show on the web interface. The file is indeed present in the MisterHouse install directory /data/web.

I've adapted the wiki to make this more clear. And I have to say: this method of adapting the web interface is very convenient/much nicer compared to the IA5 method over overwriting html files.

@hollie
Copy link
Owner

hollie commented Mar 21, 2015

@hplato one thing I wonder: how is authentication for the web interface handled? Some time ago I have 'whitelisted' all devices on my local private LAN to be able to easily control our house. On the IA5 interface there was a login button on the upper right that allowed people to fill in a password for 'admin access'.

Would people who have no such whitelist run into problems when testing out the IA7 interface?

@hollie
Copy link
Owner

hollie commented Mar 21, 2015

@hplato thinking further about the location to put the custom collections.json file: is data/web the best place to put this? I was under the impression that everything that is under 'data' are generated files at runtime and no user configuration.

Would local/web or local/ia7 not be a better place to put such configuration?

@hplato
Copy link
Collaborator Author

hplato commented Mar 21, 2015

Good point. Maybe a config item that would point to where a user-specific configuration could be?

On Mar 21, 2015, at 10:54 AM, Lieven Hollevoet notifications@github.com wrote:

@hplato https://github.com/hplato thinking further about the location to put the custom collections.json file: is data/web the best place to put this? I was under the impression that everything that is under 'data' are generated files at runtime and no user configuration.

Would local/web or local/ia7 not be a better place to put such configuration?


Reply to this email directly or view it on GitHub #490 (comment).

@hplato
Copy link
Collaborator Author

hplato commented Mar 21, 2015

I whitelist my LAN so I’ve never used the authentication button. Could add as a button on the ‘gear’ sunscreen? What do you think?

On Mar 21, 2015, at 3:28 AM, Lieven Hollevoet notifications@github.com wrote:

@hplato https://github.com/hplato one thing I wonder: how is authentication for the web interface handled? Some time ago I have 'whitelisted' all devices on my local private LAN to be able to easily control our house. On the IA5 interface there was a login button on the upper right that allowed people to fill in a password for 'admin access'.

Would people who have no such whitelist run into problems when testing out the IA7 interface?


Reply to this email directly or view it on GitHub #490 (comment).

@hollie
Copy link
Owner

hollie commented Mar 22, 2015

Authentication linked to 'gear': yep, that would ensure people who don't have a whitelist on their setup to control the login.

@hplato
Copy link
Collaborator Author

hplato commented Mar 22, 2015

OK, I don’t use the authenticate button. Looking at stock IA5, my link is: http://ip/UNSET_PASSWORD?user=admin Is this the correct link? If so it’s trivial to add it to IA7 through a collection item.

On Mar 22, 2015, at 3:02 PM, Lieven Hollevoet notifications@github.com wrote:

Authentication linked to 'gear': yep, that would ensure people who don't have a whitelist on their setup to control the login.


Reply to this email directly or view it on GitHub #490 (comment).

@hollie
Copy link
Owner

hollie commented Mar 23, 2015

Yes, this looks to be the correct link according to me!

@hplato
Copy link
Collaborator Author

hplato commented Mar 23, 2015

OK, I added a link in the settings for authorize. However I’m not having much luck making it work. Something to look at after I figure out the mixed mode problem.

On Mar 23, 2015, at 2:27 PM, Lieven Hollevoet notifications@github.com wrote:

Yes, this looks to be the correct link according to me!


Reply to this email directly or view it on GitHub #490 (comment).

@hollie
Copy link
Owner

hollie commented Apr 11, 2015

@hplato am I correct that you told about an update to IA7 where you allow direct state changes from the web interface for devices that have only an on and an off state? I don't see this reflected in the current master for xPL_Plugwise devices.

Every time I want to change the state of such device I still get a popup asking me to what state to change. On that screen there is only on and off.

Do I need to set a specific feature for a device to enable this functionality?

Regards,
Lieven.

@hplato
Copy link
Collaborator Author

hplato commented Apr 11, 2015

What should there be? Ia7 parses the states json output for object (i think it's set_states). When i get to my pc i'll send you the url you can use to output the raw json data.

Sent from my mobile device.

On Apr 11, 2015, at 1:00 PM, Lieven Hollevoet notifications@github.com wrote:

@hplato am I correct that you told about an update to IA7 where you allow direct state changes from the web interface for devices that have only an on and an off state? I don't see this reflected in the current master for xPL_Plugwise devices.

Every time I want to change the state of such device I still get a popup asking me to what state to change. On that screen there is only on and off.

Do I need to set a specific feature for a device to enable this functionality?

Regards,
Lieven.


Reply to this email directly or view it on GitHub.

@hplato
Copy link
Collaborator Author

hplato commented Apr 11, 2015

I use curl to check the json to see if it’s a javascript to json_server issue. So to see the details about your object, you can do:

$ curl --compressed "http://127.0.0.1:8080/json/objects?items=&fields=state,type,states,state_log”

So in my case, here’s what I get for state, state_log and the states. Those are the states that are shown in the state modal dialog. I also filter it a little to remove non-end user states, such as status, a bunch of the % values, etc…

{
"data" : {
"gen_dim" : {
"state" : "on",
"state_log" : [
"04/11/15 11:02:54 AM on set_by=web [127.0.0.1]",
"04/11/15 11:02:38 AM off set_by=web [127.0.0.1]",
"04/11/15 10:16:02 AM on set_by=web [127.0.0.1]",
"04/11/15 10:15:13 AM off set_by=web [127.0.0.1]",
"04/11/15 10:09:21 AM on set_by=web [127.0.0.1]",
"04/11/15 10:09:18 AM off set_by=web [127.0.0.1]",
"04/11/15 10:09:08 AM on set_by=web [127.0.0.1]",
"04/11/15 10:07:01 AM off set_by=web [127.0.0.1]",
"04/11/15 10:06:56 AM 20% set_by=web [127.0.0.1]",
"04/11/15 10:03:34 AM 60% set_by=web [127.0.0.1]"
],
"states" : [
"off",
"10%",
"20%",
"30%",
"40%",
"50%",
"60%",
"70%",
"80%",
"90%",
"on"
],
"type" : "Generic_Item"
}
},
"meta" : {
"args" : {
"fields" : [
"state",
"type",
"states",
"state_log"
],
"items" : [
"gen_dim"
]
},
"path" : [
"objects"
],
"time" : 1428781078052.57
}
}

On Apr 11, 2015, at 1:00 PM, Lieven Hollevoet notifications@github.com wrote:

@hplato https://github.com/hplato am I correct that you told about an update to IA7 where you allow direct state changes from the web interface for devices that have only an on and an off state? I don't see this reflected in the current master for xPL_Plugwise devices.

Every time I want to change the state of such device I still get a popup asking me to what state to change. On that screen there is only on and off.

Do I need to set a specific feature for a device to enable this functionality?

Regards,
Lieven.


Reply to this email directly or view it on GitHub #490 (comment).

@hollie
Copy link
Owner

hollie commented Apr 11, 2015

Hey @hplato

for the object I'm testing with the response is:

{
   "data" : {
      "desklight" : {
         "state" : "on",
         "state_log" : [
            "04/11/15 22:13:00  on set_by=",
            "04/11/15 21:42:41  off set_by=",
            "04/11/15 20:31:00  on set_by=",
            "04/10/15 22:10:00  off set_by=",
            "04/10/15 20:50:00  on set_by=",
            "04/09/15 23:00:31  off set_by=",
            "04/09/15 20:25:00  on set_by=",
            "04/08/15 22:57:07  off set_by=",
            "04/08/15 22:30:00  on set_by=",
            "04/08/15 22:10:00  off set_by="
         ],
         "states" : [
            "on",
            "off"
         ],
         "type" : "xPL_Plugwise"
      }
   },
   "meta" : {
      "args" : {
         "fields" : [
            "state",
            "type",
            "states",
            "state_log"
         ],
         "items" : [
            "desklight"
         ]
      },
      "path" : [
         "objects"
      ],
      "time" : 1428783305318.14
   }
}

Before we try to debug further: is my assumption correct that if an object has only on and off as state you should be able to change the state immediately by clicking the object in the web interface? I thought I understood that one of your latest changes to the web interface code was to implement this (instead of serving the pop-up dialog that asks you what to do with the object where you can then only click the alternate state). Maybe I just misunderstood your comment on this topic.

To me this would be a useful feature: serve the popup if an object has multiple states, and toggle the state from the interface directly in case there are only two states. What is your view on this?

@hplato
Copy link
Collaborator Author

hplato commented Apr 11, 2015

No, the substate dialog will always show up. I removed that single button that showed up when no states at all are defined.

Challenge about direct set, is that it isn’t always clear if there are multiple states, plus there is no way to see an object log. So it might be more expedient, but might create unexpected results where a user hits one button and a modal comes up so they can choose. Select another button and it changes immediately.

Anyways, that’s my thinking. Maybe a one-push change can occur if the outside icon is different, there could be other ways to do this. Right now, I’d prefer to keep features smaller since I have to do a bunch of code cleanup...

On Apr 11, 2015, at 2:19 PM, Lieven Hollevoet notifications@github.com wrote:

Hey @hplato https://github.com/hplato
for the object I'm testing with the response is:

{
"data" : {
"desklight" : {
"state" : "on",
"state_log" : [
"04/11/15 22:13:00 on set_by=",
"04/11/15 21:42:41 off set_by=",
"04/11/15 20:31:00 on set_by=",
"04/10/15 22:10:00 off set_by=",
"04/10/15 20:50:00 on set_by=",
"04/09/15 23:00:31 off set_by=",
"04/09/15 20:25:00 on set_by=",
"04/08/15 22:57:07 off set_by=",
"04/08/15 22:30:00 on set_by=",
"04/08/15 22:10:00 off set_by="
],
"states" : [
"on",
"off"
],
"type" : "xPL_Plugwise"
}
},
"meta" : {
"args" : {
"fields" : [
"state",
"type",
"states",
"state_log"
],
"items" : [
"desklight"
]
},
"path" : [
"objects"
],
"time" : 1428783305318.14
}
}
Before we try to debug further: is my assumption correct that if an object has only on and off as state you should be able to change the state immediately by clicking the object in the web interface? I thought I understood that one of your latest changes to the web interface code was to implement this (instead of serving the pop-up dialog that asks you what to do with the object where you can then only click the alternate state). Maybe I just misunderstood your comment on this topic.

To me this would be a useful feature: serve the popup if an object has multiple states, and toggle the state from the interface directly in case there are only two states. What is your view on this?


Reply to this email directly or view it on GitHub #490 (comment).

@hollie
Copy link
Owner

hollie commented Apr 11, 2015

OK, no problem. I just misunderstood your comment. Let's keep this as a possible improvement/feature for later.

@hollie
Copy link
Owner

hollie commented Apr 25, 2015

Minor comment: the hardcoded v4.0 in the new web interface code is not really required. That value will get filled in automatically from the $Version variable in the next stable. As it is now the version in the web interface will be '4.0 4.0' when we release the next stable.

@hplato
Copy link
Collaborator Author

hplato commented Apr 25, 2015

Thanks Lieven, didn’t know that. Mine just showed:

Version: develop-ref Build 626 (55a32bd)

Hence why I put in 4.0.

Is there a common method we can use for a version consistent for both stable and development? Maybe $Version is whatever the stable base is, and then a $Version_dev (or better name) that is set to the development details?

howard

On Apr 25, 2015, at 6:48 AM, Lieven Hollevoet notifications@github.com wrote:

Minor comment: the hardcoded v4.0 in the new web interface code is not really required. That value will get filled in automatically from the $Version variable in the next stable. As it is now the version in the web interface will be '4.0 4.0' when we release the next stable.


Reply to this email directly or view it on GitHub #490 (comment).

@hollie
Copy link
Owner

hollie commented Apr 26, 2015

Hey @hplato,

Mine just showed:
Version: develop-ref Build 626 (55a32bd)
Is there a common method we can use for a version consistent for both stable and development?

Actually, this method is already implemented. The version you see when running master shows you that you're running master (develop-ref) with the commit hash ( e.g. add5318 ) that tells you how recent your version of master is.

If you're running stable this version string will show the stable version number (that is fetched from the VERSION file in the root folder of stable releases).

This is documented here:
https://github.com/hollie/misterhouse/wiki/Release-process-of-a-new-stable-release

Specific section:

NOTE: The string in the VERSION file must be in the format ., no more or less, to support automated version checking in the MisterHouse interface. Note there is NO leading "v".

I will remove the hard-coded 4.0 from the code in master, OK?

@hplato
Copy link
Collaborator Author

hplato commented Apr 26, 2015

my VERSION file just says ‘unstable’.

We can remove it, however after the release, most of us will probably be on master again, so it would be great to have some sort of connection back to the root version that we’re working from. So anyone downloading stable v4 will see 4.0 in the Version string. Anyone else that just pulls master down after the release to bring to 4.0, will still see develop-ref, which really given git’s distributed branch setup, doesn’t really mean anything meaningful. (My understanding that build 626 (55a32bd) isn’t unique, and dependant on what branches have commitments. Unless the builds can be uniquely connected to releases?)

Or maybe it’s just me and I like version numbers. If so I can always edit my local copy of main.shtml :)

Also, I have 3 branches that I’d like to submit, code for razberry, a vents thermostat, and I’ve updated get_email since a few email addresses I was getting weren’t being parsed correctly. I’ll attempt to initiate push requests

howard

On Apr 26, 2015, at 1:43 AM, Lieven Hollevoet notifications@github.com wrote:

Hey @hplato https://github.com/hplato,

Mine just showed:
Version: develop-ref Build 626 (55a32bd)
Is there a common method we can use for a version consistent for both stable and development?

Actually, this method is already implemented. The version you see when running master shows you that you're running master (develop-ref) with the commit hash ( e.g. add5318 add5318 ) that tells you how recent your version of master is.

If you're running stable this version string will show the stable version number (that is fetched from the VERSION file in the root folder of stable releases).

This is documented here:
https://github.com/hollie/misterhouse/wiki/Release-process-of-a-new-stable-release https://github.com/hollie/misterhouse/wiki/Release-process-of-a-new-stable-release
Specific section:

NOTE: The string in the VERSION file must be in the format ., no more or less, to support automated version checking in the MisterHouse interface. Note there is NO leading "v".

I will remove the hard-coded 4.0 from the code in master, OK?


Reply to this email directly or view it on GitHub #490 (comment).

@hollie
Copy link
Owner

hollie commented Apr 26, 2015

Hey Howard,

Op 26-apr.-2015, om 16:33 heeft hplato notifications@github.com het volgende geschreven:

my VERSION file just says ‘unstable’.

Yes, it should as you’re running master. If the contents of the file is ‘unstable’ it reports ref-develop and the SHA of the commit so that other developers can see what version somebody is running when they report problems on the mailing list or through tickets.

We can remove it, however after the release, most of us will probably be on master again, so it would be great to have some sort of connection back to the root version that we’re working from.

That is the purpose of the SHA code. develop-ref shows that somebody is running master. The SHA code shows what version of master. There is no doubt about what version somebody is running exactly through this mechanism.

So anyone downloading stable v4 will see 4.0 in the Version string. Anyone else that just pulls master down after the release to bring to 4.0, will still see develop-ref, which really given git’s distributed branch setup, doesn’t really mean anything meaningful. (My understanding that build 626 (55a32bd) isn’t unique, and dependant on what branches have commitments.

No, this is not a correct understanding. An SHA code is a unique identifier of a specific commit in a specific repo.

Unless the builds can be uniquely connected to releases?)

To specific commits actually. E.g. if you checkout hollie/misterhouse master now you will get the short version of commit add5318.
If I merge you pull requests the SHA will change of course because master will point to a new commit then.

Or maybe it’s just me and I like version numbers. If so I can always edit my local copy of main.shtml :)

If you want version numbers I’m afraid you will need to run stable :-) Master is by definition unstable and has hence no version number.
We added this way of reporting a version in order to have a single place in the code to define the version number for stable versions. And we added the ref to the commit for master so that we can see what version of master somebody is running.

Also, I have 3 branches that I’d like to submit, code for razberry, a vents thermostat, and I’ve updated get_email since a few email addresses I was getting weren’t being parsed correctly. I’ll attempt to initiate push requests

Well received and they will be merged in.

Thanks for the code contributions you’re making. Much appreciated!

Best regards,
Lieven.

@hplato
Copy link
Collaborator Author

hplato commented Apr 27, 2015

OK, good with this.

Not to beat a dead horse, I agree that anyone using master should have a common version. I guess I’m thinking about my own case, where I don’t run on master, but rather a ‘running’ branch which is based off master, but has other branches of stuff merged in. I’ve done this to keep a clean master to allow for successful merges or any fixes or work that I’ve done. In my case, my commits will be different hence no way to map a build number to a certain version of stable.

So I’ll keep a version in my local file :) Plus I snuck in a IA7 version number in that same main.shtml so that I can keep track if/when features are added to just the web interface...

howard

On Apr 26, 2015, at 1:41 PM, Lieven Hollevoet notifications@github.com wrote:

Hey Howard,

Op 26-apr.-2015, om 16:33 heeft hplato notifications@github.com het volgende geschreven:

my VERSION file just says ‘unstable’.

Yes, it should as you’re running master. If the contents of the file is ‘unstable’ it reports ref-develop and the SHA of the commit so that other developers can see what version somebody is running when they report problems on the mailing list or through tickets.

We can remove it, however after the release, most of us will probably be on master again, so it would be great to have some sort of connection back to the root version that we’re working from.

That is the purpose of the SHA code. develop-ref shows that somebody is running master. The SHA code shows what version of master. There is no doubt about what version somebody is running exactly through this mechanism.

So anyone downloading stable v4 will see 4.0 in the Version string. Anyone else that just pulls master down after the release to bring to 4.0, will still see develop-ref, which really given git’s distributed branch setup, doesn’t really mean anything meaningful. (My understanding that build 626 (55a32bd) isn’t unique, and dependant on what branches have commitments.

No, this is not a correct understanding. An SHA code is a unique identifier of a specific commit in a specific repo.

Unless the builds can be uniquely connected to releases?)

To specific commits actually. E.g. if you checkout hollie/misterhouse master now you will get the short version of commit add5318.
If I merge you pull requests the SHA will change of course because master will point to a new commit then.

Or maybe it’s just me and I like version numbers. If so I can always edit my local copy of main.shtml :)

If you want version numbers I’m afraid you will need to run stable :-) Master is by definition unstable and has hence no version number.
We added this way of reporting a version in order to have a single place in the code to define the version number for stable versions. And we added the ref to the commit for master so that we can see what version of master somebody is running.

Also, I have 3 branches that I’d like to submit, code for razberry, a vents thermostat, and I’ve updated get_email since a few email addresses I was getting weren’t being parsed correctly. I’ll attempt to initiate push requests

Well received and they will be merged in.

Thanks for the code contributions you’re making. Much appreciated!

Best regards,
Lieven.


Reply to this email directly or view it on GitHub #490 (comment).

@hollie hollie added this to the IA7 milestone Jun 10, 2015
@hplato
Copy link
Collaborator Author

hplato commented Sep 21, 2016

I think these issues have been addressed. Integrated authentication added in IA7 v1.2

@hplato hplato closed this as completed Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants