more G-Labs products

Author Topic: C# feature not showing up correctly  (Read 3695 times)

February 21, 2014, 05:51:19 AM
Read 3695 times

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I have a modified version of the Smart Light code that is not quite complete but I'm having a problem with how HG shows the options in the module setup.  What should be displayed is a list of 4 text inputs for various options and one check box to enable the module when used with a light or dimmer.  When it's used with a siren, it should have 2 text inputs and a check box.  However, the light/dimmer seems to be missing the check box.  I have tried tweaking the code to see if I could determine why it doesn't show up, but I don't see an issue with the code.  Either I'm missing something or HG is interpreting my code differently than expected for some unknown reason.  The one thing I can say is that all options show up correctly in the Configure->Automation list under Details.

I'm also seeing a similar issue with the updated sunrise/sunset code in that a couple check boxes are missing.

I've attached both codes with the hopes that a different system will produce the same results or someone will see what I've done wrong.

February 21, 2014, 09:34:41 AM
Reply #1

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hello,

The new features will not appear as a checkbox but as a value and you have to set this value to 0 or 1.

Cheers.
Dani

February 21, 2014, 04:57:10 PM
Reply #2

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
When I look at the features available "Ben's Smart Lights" for a light module I see the text options but do not see the "enable smart lights" check box.  It is enabled since the code runs, but I don't have the option to enable/disable it.  As a result, if I try to add the feature to a new light/dimmer, I won't be able to as the enable will be hidden.

As for the "Sunrise Sunset Lights Control - ADVANCED", I can see 10 of the 12 check boxes.  The two that seem to be missing are SunriseOFF and SunsetON.  Those are 2 of the more important options, so getting them back is kinda important!

February 21, 2014, 07:36:42 PM
Reply #3

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi bkenobi,

For me the checkbox in "Ben's Smart Lights" works as you can see in screen copy..
And In  "Sunrise Sunset Lights Control - ADVANCED" you have to give differents name of variable from standard "Sunrise Sunset Lights Control" to your variables.

Cheers
Dani

February 21, 2014, 11:26:56 PM
Reply #4

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Interesting.  When I look at this with a X10 module, I get everything except the enable check box line.  I'll post a picture this evening.

Perhaps the reason I'm having an issue is that I did not rename the features from what Gene originally named them in his code.  I'll try renaming all variables so that there are no potential conflicts.  I suspect that some of the built-in modules are now enabled again since it does that during each update.  Giving unique names would be a good idea either way.

February 22, 2014, 05:18:05 AM
Reply #5

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
This is what the smart lights and sunrise/sunset codes look like when configuring.  I'll try giving everything unique names next.

February 22, 2014, 09:24:09 AM
Reply #6

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I was not able to get things working correctly no matter how I changed my code.  When I changed the feature name, the old values remained and new ones were added so the list became nearly twice as long for everything.  I tried purging the values out of the modules.xml file, but it became to complicated.  After wasting time, I just decided to delete all xml files and copy them back from the stock config zip file.  At that point, everything was working again.

This brings up a feature request (I'll add it to the other subforum too).  It would be nice if there was a built in way to delete all settings for a module.  If a module is removed from the group, it will retain the values (which may be fine).  If the house code is disabled, that seems to remove values, but has to be done for all modules in that house code.

February 23, 2014, 07:18:43 PM
Reply #7

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi guys,

I need your help for testing new HG r339 which is available from:

https://sourceforge.net/projects/homegenie/files/testing/

Basically HG has now got a Scheduler.
Sunrise/Sunet program has been deprecated because now there is another way to achieve that using features from "Scheduled ON/OFF" program.

See attacched pictures.

In the scheduler can be added a schedule by using standard cron expressions.
Anyway there is also a simple page for generating them: http://www.generateit.net/cron-job/ .

Optionally can be specified a program to execute, but this is not always needed.

A cron expression can contain comma separated values which stand for "OR" operator. Using a semicolon will stand for "AND".
For example, in the picture we see:

@Sunrise,00 23 * * *;@Weekdays

this means every week day "at sunrise" OR at 23.00 .
If the light is turned on after 23, it will be turned off anyway after sunrise.

See the "Scheduled ON/OFF" and "Weather Underground" source code for an example about using the SchedulerHelper in a program.

The weather underground program will take care of updating "Sunrise" and "Sunset" values in the system scheduler.

Cheers,
g.

February 23, 2014, 08:51:55 PM
Reply #8

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I just finished downloading the last RPi image and was about to install it.  I assume this can be installed on that image?  If not, when will the full RPi version be released so I can give this a try.

February 23, 2014, 09:58:39 PM
Reply #9

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
yes it can be installed over it.

g.

February 24, 2014, 07:20:24 AM
Reply #10

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I just tried r336 for the first time this evening.  The previous version was located in /home/pi/HomeGenie.  r336 moves the program directory to /usr/local/bin/homegenie.  r336 seems to run correctly, but when I tried to install r339 test, things stopped working.  I moved the homegenie directory to a backup location and extracted r339 to /usr/local/bin.  When I rebooted, the web server did not start.  I do not see the homegenie process in top either.  I tried renaming HomeGenie to homegenie, but that didn't help.  I will try just dumping the files into the working r336 directory structure, but I don't know why that would work.  Any suggestions?

February 24, 2014, 12:21:06 PM
Reply #11

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
From r336 the sd card image is based on the debian package.
So to upgrade simply do a "sudo gdebi homegenie-1.0...deb".

g.

February 25, 2014, 06:02:40 AM
Reply #12

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I just tried to download the latest version via the gdebi approach and failed.

Code: [Select]
pi@raspberrypi /usr/local/bin $ sudo gdebi homegenie-beta_1.00.340_all.deb
gdebi error, file not found: homegenie-beta_1.00.340_all.deb

I looked at what you have in the documentation and everything looks ok.  I have not used gdebi before, so I may be missing something obvious.

February 25, 2014, 06:44:04 AM
Reply #13

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Like I said, I'm not a gdebi user.  I just realized that it needed to have a path to the file.  I downloaded to my /home/pi directory and pointed gdebi there and it worked.  Perhaps I could give it a http address to the sourceforge location, but I didn't try.

February 25, 2014, 08:29:55 PM
Reply #14

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
A cron expression can contain comma separated values which stand for "OR" operator. Using a semicolon will stand for "AND".
For example, in the picture we see:

@Sunrise,00 23 * * *;@Weekdays

this means every week day "at sunrise" OR at 23.00 .
If the light is turned on after 23, it will be turned off anyway after sunrise.

Crontab can use a comma in it's expression to indicate multiple entries (e.g., 1,6,12 in month would mean January, June, December).  Would using commas in a crontab field mess up the OR logic you have included here?  For instance:

Turn off lights at sunrise, 11pm, 3am on weekdays
@Sunrise,00 3,23 * * *;@Weekdays

I'm also curious if there is a way to do something like:
Turn off lights at sunrise and 11pm on weekdays, but sunrise and 3am on weekends.