We have moved at community.getvera.com

Author Topic: ALTUI : New Features Suggestions  (Read 84080 times)

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 872
  • Karma: +66/-8
Re: ALTUI : Suggestions
« Reply #60 on: September 26, 2015, 06:03:23 pm »
OK - after running the debug with MultiBox.getScenesSync() I think I understand what might be happening. I don't bother with the the UI to set set up my scenes - I just execute Lua code to control my devices. So all my scenes call Lua code - refer this post:

http://forum.micasaverde.com/index.php/topic,29627.msg209898.html#msg209898

The important part is I (nearly) always return false, as all the control work has (generally) been done by my Lua code, so the scene is triggered but not executed as such. See flow chart:

http://wiki.mios.com/images/8/8a/SceneFlowchart.png

I should probably return true and the time stamps would get set up. I'll do some tests and get back to you. Perhaps the last run field in the UI should say "Never" if the variable is nil.

Have attached various files re: the minimote. The only tab of great interest is the "Scenes" tab, where you associate a scene, from the pull down list of scenes, to a button. Looks like it just creates a variable containing the concatenated scene names as a comma separated list.

It would be useful for tabs that use shared.js to be shown but with a label saying "Not implemented" or similar.
« Last Edit: September 27, 2015, 05:52:03 pm by a-lurker »

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 872
  • Karma: +66/-8
Re: ALTUI : Suggestions
« Reply #61 on: September 27, 2015, 05:59:01 pm »
Quote
The important part is I (nearly) always return false, as all the control work has (generally) been done by my Lua code, so the scene is triggered but not executed as such.

OK - changed all my Lua scene code to return true, even if the scene does nothing and false to abort like you normally would. All the time stamps now work - so problem fixed.

Another query - would it be possible to have any code placed in the Lua Test code box to persist in the browser. That way, you don't have to cut and paste into the browser each time you run a test. You can then just make the appropriate code changes and re-execute.
« Last Edit: September 27, 2015, 06:04:12 pm by a-lurker »

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +210/-8
Re: ALTUI : Suggestions
« Reply #62 on: September 27, 2015, 06:54:52 pm »
Quote
The important part is I (nearly) always return false, as all the control work has (generally) been done by my Lua code, so the scene is triggered but not executed as such.

OK - changed all my Lua scene code to return true, even if the scene does nothing and false to abort like you normally would. All the time stamps now work - so problem fixed.

Another query - would it be possible to have any code placed in the Lua Test code box to persist in the browser. That way, you don't have to cut and paste into the browser each time you run a test. You can then just make the appropriate code changes and re-execute.
will be in v>=744

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +210/-8
Re: ALTUI : Suggestions
« Reply #63 on: September 29, 2015, 07:58:54 am »
Have attached various files re: the minimote. The only tab of great interest is the "Scenes" tab, where you associate a scene, from the pull down list of scenes, to a button. Looks like it just creates a variable containing the concatenated scene names as a comma separated list.

It would be useful for tabs that use shared.js to be shown but with a label saying "Not implemented" or similar.

that scene tab screen seems to be linked to the variable "SceneShortcuts" on the scene controller device. but I cannot make sense of the syntax of this varialbe. anybody knows ?
mine looks like this for a NODON remote
1=69-0,2=69-0,3=69-0,4=69-0

I have seen people saying it is
(onbtn)|(offbtn)
where (onbtn) is btnnumber=scenenumber-x but no idea what the x is for

so something like
1=69-0,2=69-0,3=69-0,4=69-0|1=70-0,2=70-0,3=70-0,4=70-0

any input appreciated

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 872
  • Karma: +66/-8
Re: ALTUI : Suggestions
« Reply #64 on: September 29, 2015, 05:46:17 pm »
I'm guessing at:

In UI5:

Code: [Select]
a=x,etc|a=y,etc
In UI7:

Code: [Select]
a= x-y,etc
a = button number
x = scene for short button tap
y = scene when button is held
etc = next button

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +210/-8
Re: ALTUI : Suggestions
« Reply #65 on: October 01, 2015, 01:51:42 am »
I'm guessing at:

In UI5:

Code: [Select]
a=x,etc|a=y,etc
In UI7:

Code: [Select]
a= x-y,etc
a = button number
x = scene for short button tap
y = scene when button is held
etc = next button

all my experiment on latest UI7 shows this is right now totally flawed on MCV side. you delete a trigger from a scene and this string and button assignment screen does not show the reflection , you add the second part after the "|" for the Off button and nothing works any more , in some instance it was also preventing me from deleting triggers completely or once I deleted one trigger and all button disappeared.

so it is a mess and different behavior in UI5 vs UI7. I think MCV has not finished implementing this right now, we will have to be patient a bit ,  or do something completely independant of MCV ( which whould not be too hard to be frank , it is just a UI goody to create triggers in multiple scene , although the problem is there are no 2 remote which behave the same in terms of button ID / LastSceneID  mapping )

My recomendation (and this is what I use on my NODON remote zWave) is to use ALTUI device watch capatility to set a watch on the remote "LastSceneID" variable of the remote and trigger scenes based on this. This way I have full access to the possible 16 scenes of my 4 button remote.  ( crazy enough LastSceneID is right but all the default scene trigger and sl_SceneActived parameter are all wrong )

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: ALTUI : Suggestions
« Reply #66 on: October 09, 2015, 06:06:03 am »
How about a "pretty" print function in Lua Test? (inspired by Rex Beckett's excellent RBLuaTest functionality)

So, for example, you could write print(pretty(luup.devices[3])) and see:
Code: [Select]
{
  category_num = 0,
  description = "ALTUI",
  device_num_parent = 0,
  device_type = "urn:schemas-upnp-org:device:altui:1",
  embedded = false,
  hidden = false,
  id = "ALTUI",
  invisible = false,
  ip = "",
  mac = "",
  pass = "",
  room_num = 0,
  subcategory_num = 0,
  user = ""}

It needs to handle bizarre tables like {a=42,7,8,9,1,2,3,nil,nil,nil,3.1415,b="foo",f=function () return 7 end}
Code: [Select]
{
  7,8,9,1,2,3,
  [10] = 3.1415,
  a = 42,
  b = "foo",
  f = function: 0x001bc8f8}

and circular structures y = {1,2,3,a=42}; y.x = y
Code: [Select]
{
  1,2,3,
  a = 42,
  x = {CIRCULAR_REF = table: 0x00454ba8}}

I can supply a short bit of Lua (30 lines) to do this if helpful.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +210/-8
Re: ALTUI : Suggestions
« Reply #67 on: October 09, 2015, 06:25:48 am »
Looks like another good idea. I'll happily integrate your code into it.


Envoy? de mon iPad en utilisant Tapatalk

Offline MAUMAIRE

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: ALTUI : Suggestions
« Reply #68 on: October 10, 2015, 10:52:17 am »
I discovered your app recently and I find sympathetic.
Can you create an option to export the full scenes description in excel format for example.
Thank you.

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +210/-8
Re: ALTUI : Suggestions
« Reply #69 on: October 16, 2015, 05:42:16 am »
I discovered your app recently and I find sympathetic.
Can you create an option to export the full scenes description in excel format for example.
Thank you.

one way for now could be going into DEBUG/ MISC / Javascript code and type
Code: [Select]
MultiBox.getScenesSync()
Full scene description is not quite simple to export in either excel or even a flat CSV file list. it is a complex data structure which 1<=>n relationships with many other informations like triggers, actions etc... so maybe you d need to refine your need a little bit more precisely. thx !

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 872
  • Karma: +66/-8
Re: ALTUI : Suggestions
« Reply #70 on: October 22, 2015, 07:03:30 pm »
Tried out the watches and Blocky - great addition. A lot of flexibility there.

I wanted to turn on fan when the electric kettle is turned on. So I put a watch on the power meter Wattage. And set up this expression (kettle is about 2200W):

(new-old)>2000

I could enter it as text but Blockly would not allow me to drop the "new" and "old" variables into the "greater than" maths block. Not sure if it's a nesting problem or data type problem.

Regardless the fan now turns on when the kettle goes on. Might now set a scene to indicate "The clothes washer has finished" out the Sonos system.


Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +210/-8
Re: ALTUI : Suggestions
« Reply #71 on: October 22, 2015, 07:13:12 pm »
It is a type problem. New and old are textual values like any device variable . Blockly forces you to compare with text, or you can use the tonumber block I have added ( I never tried but should work )


Envoy? de mon iPad en utilisant Tapatalk

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 872
  • Karma: +66/-8
Re: ALTUI : Suggestions
« Reply #72 on: October 23, 2015, 04:01:58 am »
Quote
It is a type problem.

Yes that makes sense - now have from Blockly:

((tonumber(new)) - (tonumber(old)) > 2000)

just a case of getting the hang of Blockly, etc.

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: ALTUI : Suggestions
« Reply #73 on: November 05, 2015, 06:11:39 am »
It would be nice to be able to rename rooms simply by clicking on their name on the Home / Rooms page.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +210/-8
Re: ALTUI : Suggestions
« Reply #74 on: November 06, 2015, 02:20:00 am »
It would be nice to be able to rename rooms simply by clicking on their name on the Home / Rooms page.
yep. in v 878 !