genielabs / HomeGenie

HomeGenie, the programmable automation intelligence

Home Page:https://homegenie.it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[QUESTION]Baffled by Dimming

Barry-IA opened this issue · comments

Hi Folks!

Hopefully I’m in the right area: suggested by my recent post in HomeGenie.Club; also I had found reference to a http://www.homegenie.it/forum but that seems to be non-existant to an Apache server and I couldn’t find a forum/group at the next step.

Anyway, having problem with getting X10 switches to dim. Using a Raspberry Pi 3B (to replace AHP on a virtual Windows XP) via CM15A; version v1.3-stable.19. Did find the ‘code snippet’ the level value wants a whole number and not the decimal value suggested:

// level is a decimal value between 0 and 1 (eg. 0.5 = 50%)
level = 30;

Took a while to find that but not a big deal. My problem is I can’t get the lights to act correctly. If I do the code for the ‘set level’ first and the ‘turn on/off range’ second the lights go on and off at the correct times but they’re at 100%, no automatic dim. If I do ‘turn on/off range’ then ‘set level’ they dim properly but at the off time go to 100% (full on) and stay on (!).

Tried both ‘Dimmer’ and ‘Switch’ options. (‘Switch’ doesn’t have the dimmer slider in the GUI but can add the code snippet and dims, provided ‘correct’ sequence’.)

This is “on/off range” snipper first, with “levels” snippet second, just so you folks can see what I’m using:
// Turn on, if previous minute was not in schedule (start occurrence range)
if (!$$.onPrevious())
$$.boundModules.on();
// Turn off, if next minute won't be in schedule (end occurrence range)
if ($$.onPrevious() && !$$.onNext())
$$.boundModules.off();

// level is a decimal value between 0 and 1 (eg. 0.5 = 50%)
level = 60;
// set the level
$$.boundModules.level = level;

Thanks!
Barry

Best thing to do is check the HG documentation. Here’s a specific link to the X10 API commands but you’ll find most things you need there. https://genielabs.github.io/HomeGenie/api/mig/mig_api_x10.html

That forum you referred to is long gone but here’s a link to the archived version that may be of use
to you http://old.homegenie.club:8080/www.homegenie.it/forum/index.html.

You also have a number of YouTube video demos of HG. Just search there and you’ll find them.

Thanks mralapete! Did find the mig_api/x10 page a day or two ago -- got to work with Firefox, looks like to keep experimenting to fit in my HomeGenie scripting.

The archived page (old.homegenie.club) 'spins' for a bit then gives "...exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG". Have tried prior, too. Looks like I'll have to investigate that issue too!

Thanks for the leads!
Barry

Try a different browser. The archive is working fine here. You will only be able to search it through Google though. Preface your search parameters with old homegenie to make things easier.

Hi, @Barry-IA!

The archived page (old.homegenie.club) 'spins' for a bit then gives "...exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG"

The archive is published only through http protocol, so, please, check the url, it should starts with http, not https.
Btw, the link provided by @mralapete should work.

Try a different browser. The archive is working fine here. You will only be able to search it through Google though. Preface your search parameters with old homegenie to make things easier.

Hi mralapete!

Used Chromium to access old.homegenie.club – that worked! FWIW I could enter a term in the Search Field but then got a 404 – guessing because Read Only. Manual search it is! Didn’t find what I was looking for but did find some information of interest so copied to a file here for later reference. For whatever reason I couldn’t access posts between pages 15 and 24 – not expecting you to do the correction but if the person who did the original data snag might read this and be able to fix.

Thanks!
Barry

Hi, @Barry-IA!

The archived page (old.homegenie.club) 'spins' for a bit then gives "...exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG"

The archive is published only through http protocol, so, please, check the url, it should starts with http, not https.
Btw, the link provided by @mralapete should work.
Fairly certain I made sure no ‘security s’ in the http part; probably a quirk in Firefox. As I mentioned to mralapete using Chromium did allow me to access most of the site.

Barry

That would be @Bounz He also administers the HomeGenie.Club forum. You’ll have to check with him on the archived forum page.

I assume you issued the ON command to turn on the light first and then set the level. Have you tried just issuing the level command without using the On command. I haven’t used dimming modules for a while but if I remember rightly there was soft start modules in play that may be affecting how your dimmers are performing to the two commands. Try using the X10 API commands in a browser bar first and see what results they yield.

Correction: I have been doing my tests with a PLW01 -- wall switch with a button. The other switch (Decora style) is a WS467; haven't done any current testing on it. This information is from a scheduler report when I had the system on AHP under Windows XP, so assuming (oops! ) the system knows its parts. (I do not have a WS12A.)

Barry

Yes it’s going to take a little experimenting with your X10 modules to find the correct sequence of commands in HG that will operate them. Most of the original development work with X10 in HG was carried out using Euro X10 equipment so if you’re using US equipment it may account for some discrepancies in how your equipment is reacting with HG X10.

Personally my X10 equipment is all Euro centric so I can’t help with like for like comparisons. You’ll eventually get there though.

Hi Folks! Dawned on me: what's the difference in HomeGenie-speak between a 'switch' and a 'dimmer'?? To me a 'switch' is on the wall and on/off though could also dim. A 'dimmer' would dim but also switch. Thinking maybe I have a module assigned wrong and that's why not dimming in the Scheduler (though does when manually controlled through the Dashboard). I looked HomeGenieHelp.doc -- mentioned both but nothing more.
Thanks!
Barry

Without stating the obvious you’ve more commands available to you using a Lamp Module v an Appliance Module. As you say on/off SHOULD be the same for both but with the variation on Lamp Modules over the years the question is, which one do I have. This Wiki gives a gentle explanation of what I’m talking about here. Again do bear in mind the US v Euro modules scenario. http://kbase.x10.com/wiki/SoftStart

What X10 controller do you use. I’m using a CM19E, the Euro 433mhz version of the CM19A. I found it more efficient and reliable for my purposes.

If you’re not already familiar with this man visit this page. He’s forgotten more than anyone knows about all things X10. His products and publications are an absolute must for the X10 user. If he can’t solve an X10 problem nobody can. I’ll be surprised if you have any X10 issues after reading his material. https://jvde.us/

Have a look at the CM15 USB libdotnet code for a better insight to what’s happening https://github.com/genielabs/x10-lib-dotnet/blob/master/XTenLib/Drivers/CM15.cs

You’ll see in the CM15 XtenLib exactly how the dimming is formulated.

Unfortunately US X10 modules are not the same as their Euro counterparts so testing of US units relied solely on input from other US users so I can’t comment on this.

It sounds like you’re nearly there so hopefully you’ll crack it soon. If you were up to compiling HG yourself you could make your own changes to the the CM15 driver if necessary and include that in your own compilation.

There was one or two other bugs reported relating to CM15 but I’m not sure if they were ever attended to.

You probably have enough reference material at this stage to complete your testing anyway so hopefully your X10setup will be fully up and running very soon.

No problem. Don’t forget that link I posted re JVDE (Jeff Volp). He’s basically “last man standing” as far all things X10 is concerned. His equipment is top quality too.

Hi Folks!

I think I finally have things sorted out – as far as dimming is concerned. HomeGenie is now dimming my X10 devices. A sort-of summary and how-to follows. ...And this is for U.S.-based X10 devices; according to mralapete the European version may be different.

There are three versions of dimming. #1 is the original version which when turned on is at 100% and then dims (I call this ‘ramps down’). #2 is termed ‘Softstart’ and when turned on starts at 0% and then brightens (‘ramps up’). Third option doesn’t dim at all (such as the Socket Rocket LM15A/RLM20/PSM04). Only mentioned because one is going to have extremely poor results trying to dim something that wasn’t designed to dim.

So assuming the device is designed to dim, figure out which way it ramps. Turn on via HomeGenie ON command; then OFF. If old/original (#1) the (incandescent) bulb will turn on and off immediately. If newer Softstart (#2) will take about a second to fully turn on and about a second to fully turn off. The HomeGenie command sets are ‘opposite’ each other for the two types.

Device Type #1 – Old/Original style (turns on full then dims: 100% → 60% – ramps down)

Use code snippet ‘On/Off Range’  and add the line with ‘level’:
// Turn on, if previous minute was not in schedule (start occurrence range)
if (!$$.onPrevious()) 
  $$.boundModules.on();
  $$.boundModules.level = 60;
// Turn off, if next minute won't be in schedule (end occurrence range)
if ($$.onPrevious() && !$$.onNext()) 
  $$.boundModules.off();

One has to turn on the device fully, then tell it to dim.

Device Type #2 – Softstart (when turns on starts at dim then brightens)

Code snippet “Set Level”:
// level is a decimal value between 0 and 1 (eg. 0.5 = 50%)
level = 40;
// set the level
$$.boundModules.level = level;
(My device wanted the whole number, so ‘40’ vs. ‘0.4’.  Pop-up will still say ‘0.4’.)


Then code snippet “on/off range”:
// Turn on, if previous minute was not in schedule (start occurrence range)
if (!$$.onPrevious()) 
  $$.boundModules.on();
// Turn off, if next minute won't be in schedule (end occurrence range)
if ($$.onPrevious() && !$$.onNext()) 
  $$.boundModules.off();

Or can combine the two; will start with the dim command (don’t need the on command):

// Turn on, if previous minute was not in schedule (start occurrence range)
if (!$$.onPrevious()) 
  $$.boundModules.level = 40;
// Turn off, if next minute won't be in schedule (end occurrence range)
if ($$.onPrevious() && !$$.onNext()) 
  $$.boundModules.off();

While experimenting stay in the dimming upper-range: my test device up here in the Computer Room didn‘t like dim values below about 40%, though could have been because I was using a 45W bulb. In the ‘real world’ downstairs

Hopefully this will help someone else, plus should something happen to my notes here at the house they’re now on the Internet where stuff never disappears

FWIW I also found overnight events (start one day, end the next) using @SolarTimes.Sunset > @SolarTimes.Sunrise turned on fine but didn’t shut off. May be something to do with using a Raspberry Pi 3, may have been something else. Here only one light set for dusk-to-dawn so fixed with separate on and off command sets.

Barry

Just two things from your notes. Try replacing the word controller with the word device. Your referring to an X10 device being controlled and not a controller being controlled. It will help to avoid any confusion for anyone reading this at a later date.

Secondly, there’s a pre written script in scheduler called Outdoor.On under the Lights heading. It definitely works as it should and it looks pretty close to what you are trying to do with a bit of editing. I’m using a RPI3 so that wouldn’t explain why it is not executing correctly at your end. Otherwise it sounds like all is good with you now.