Smart Switch Plugin

[quote=“teonebello, post:20, topic:172134”]I would like if you could insert the is_night function.

This would be great to avoid to switch on lights during day.

Thanks
Matteo[/quote]
@Matteo,

You can create scenes the are scheduled for sunrise and sunset. In “sunrise” set the “Auto Timeout” to “None”, and in the “Sunset” scene, set “Auto Timeout” to whatever you like. That would accomplish what you are asking for, the light will only be controlled by the motion sensor at night.

You can actually use any sunrise/sunset offset, or any other scene to do this. That’s more flexible than just “is_night.”

Hi,

I’ve tried the plugin : I’ve got “no implementation” message when I click on a button of the Smart Switch.
The switch is a Fibaro FGD211

After installation, the luup files are empty (can’t view content)

My firmware is the 1.5.459

[quote=“cokeman, post:17, topic:172134”]Hi

I would love to see this work with the “Virtual switch”, so this can turn on/off the Virtual Switch.

I have a setup, with a TV and home entertainment system/xbox/etc. so using the combination switch and a TV plugin, I would like to only turn the xbox/entertaintment system, when there are movement AND the TV is on.

/Cokeman[/quote]

Cokeman, this plugin should already work to control a virtual switch. Just add the virtual switch device Id to the list of Smart Switches, and it should create a smart switch device to control the virtual switch.

[quote=“vosmont, post:23, topic:172134”]After installation, the luup files are empty (can’t view content)

My firmware is the 1.5.459[/quote]

Vosmont,

For some reason, it looks like the latest version is being pushed out with empty files, even though the files exist in the MCV repository. I’ll put in a help ticket with MCV and see what they have to say about it, and post an update if / when I hear anything.

Hugh

[quote=“tom3dline, post:19, topic:172134”]is it possible to use smartswich without motion sensor
when a light switch turn on and the smartswitch detect and set as threshold 50% dimming and auto time out for 30 min?

I test worked and not work. can we put as option for future release? Thanks[/quote]

@tom3dline,

Do you mean you want to be able to use another switch as the input to the smart switch, instead of a motion sensor?

Hugh

the smart switch files in “cmh-ludl” folder are without “.lzo” extension.

perhaps the issue come from that.

[quote=“vosmont, post:27, topic:172134”]the smart switch files in “cmh-ludl” folder are without “.lzo” extension.

perhaps the issue come from that.[/quote]

Yeah, they’re actually supposed to be that way. The files for this plug-in are in an uncompressed format because there are some compatibility issues with the compressed file (.lzo). format. However, it looks like there may be something broken with the distribution of the current version.

A couple of things to try:

  1. If you haven’t already created a bunch of “Smart Switch” devices, try uninstalling / reinstalling the plug-in.
  2. If that doesn’t fix things, try using the following link to install the plug-in manually. (You’ll probably have to login with your MiOS username / password, and then manually access the link again before you can access the page). Click on the install button for “0.4” which is the latest release.

https://apps.mios.com/test-plugin.php?id=2528&show=versions

Let me know if either of these two ideas help.

Hugh

I’ve tried some sort of things : nothing has worked :frowning:

  • Reinstall 0.4
  • Install 0.3
  • Get file from winscp and reimport via LUUP files (put “.lzo” on files)
  • Create manually the device from “D_SmartSwitch1.xml” (with files .lzo)

[quote=“vosmont, post:29, topic:172134”]I’ve tried some sort of things : nothing has worked :frowning:

  • Reinstall 0.4
  • Install 0.3
  • Get file from winscp and reimport via LUUP files (put “.lzo” on files)
  • Create manually the device from “D_SmartSwitch1.xml” (with files .lzo)[/quote]

Did you use the link that I referenced in the previous post to install 0.4? Or did you just use the normal “plug-in” installer from the Vera portal?

Hugh

I have used your link.

@vosmont,

I found the issue. The zero length file thing sent me down the wrong path, but as it turns out one of the files got uploaded incorrectly in version 0.4 of the plug-in. Try the link I gave above again, and you’ll be able to install version 0.5 which should fix the issue.

Sorry for the inconvenience!

Hugh

It seems to work with the version 0.5 :slight_smile:

The plugin still display version 0.4 in the ui

[quote=“vosmont, post:33, topic:172134”]It seems to work with the version 0.5 :slight_smile:

The plugin still display version 0.4 in the ui[/quote]

Glad it’s fixed. Yes, unfortunately, I forgot to increment the version shown in the GUI so it will stay at 0.4 for now. :frowning:

Hugh

Hi hugheaves,

it’s a great plugin :slight_smile:

here are some questions :

  • Light is turned back off when no motion is detected : ie, turned off after the “automatic timeout” which is after the event “no motion” ? (after internal timeout in the motion device)

  • Is it possible to ignore automatic light turn on ?
    Ability to set a luup code (like in a scene) to decide if the automatic lighting will be done (use is_night or between two hours).

  • If a script sets the light to 30% during night on “light on” event, will the plugin use “manual timeout”? (even if the light has been turn on after motion has been detected).

  • When I turn on the ligth manualy, the level is at 100%. Does it mean that the on and off levels are just for automatic control ?

  • Is it possible that the SmartSwitchController exposes its “state” and “Timeout” variables on a sdata request ?
    It’s to display on an external interface the current status of the light and the time which remains before this light turns off.

  • Is it possible to control the switch using other device than motion sensor ?
    I’ve got a BLYSS motion sensor, which is detected by the RFXtrx plugin as a light.

Vincent

[quote=“vosmont, post:35, topic:172134”]Hi hugheaves,

it’s a great plugin :)[/quote]

Thanks!

[quote=“vosmont, post:35, topic:172134”]here are some questions :

  • Light is turned back off when no motion is detected : ie, turned off after the “automatic timeout” which is after the event “no motion” ? (after internal timeout in the motion device)[/quote]

That is correct. The automatic timeout is measured from when the motion sensor last changed to “not triggered / no motion” status.

[quote=“vosmont, post:35, topic:172134”]- Is it possible to ignore automatic light turn on ?
Ability to set a luup code (like in a scene) to decide if the automatic lighting will be done (use is_night or between two hours).[/quote]

Yes, if you are using the scene editor, just click the “None” button in the automatic timeout section. This will actually prevent the light from turning on automatically. The equivalent Luup code would be:

luup.call_action(“urn:hugheaves-com:serviceId:SmartSwitchController1”, “SetAutoTimeout”, { [“NewTimeout”] = 30 }, SMART_SWITCH_DEVICE_ID)

(substitute the device Id for the smart switch device for SMART_SWITCH_DEVICE_ID)

Yes, any change to the switch state that was not initiated by the smart switch device (i.e. not an automatic change) is considered to be a manual change to the switch.

Correct, the on and off levels are the levels that are used for automatic control only.

[quote=“vosmont, post:35, topic:172134”]- Is it possible that the SmartSwitchController exposes its “state” and “Timeout” variables on a sdata request ?
It’s to display on an external interface the current status of the light and the time which remains before this light turns off.[/quote]

Unfortunately, MCV provides no way for an end user to specify what data is returned in sdata. (It’s completely up to them). However, you could request the user_data or use the variableget functions to retrieve the state information. See: http://wiki.micasaverde.com/index.php/Luup_Requests for information on using API’s.

The variables available in the smart switch service are defined here:

http://git.hugheaves.com/gitweb/?p=mios_smart-switch.git;a=blob_plain;f=src/S_SmartSwitchController1.xml;hb=refs/heads/master

[quote=“vosmont, post:35, topic:172134”]- Is it possible to control the switch using other device than motion sensor ?
I’ve got a BLYSS motion sensor, which is detected by the RFXtrx plugin as a light.[/quote]

Not right now, but it’s on my “to do” list, and will be in the next release. The next release should be out in a couple of weeks.

Hugh

Hugh,

You should be able to specify the scode value in the xml file for your state variables. This will then show up in lu_sdata.

  • Garrett

Garrett,

Is there any documentation on scodes? I saw them show up in a recent firmware release in some of the JSON files, but couldn’t find anything on the wiki or elsewhere.

Thanks,
Hugh

[quote=“garrettwp, post:37, topic:172134”]Hugh,

You should be able to specify the scode value in the xml file for your state variables. This will then show up in lu_sdata.

  • Garrett[/quote]

Hi,

the “S_SmartSwitchController1.xml” file doesn’t follow the service template.

Bellow, you will find an example which works.
I just had to suppress the original file with winscp, because the upload creates a “S_SmartSwitchController1.xml.lzo” file, which seems to be masked by the original file.

[pre]

<?xml version="1.0"?> 1 0 Mode no string mode Timeout no string timeout SetOnLevel level in

</actionList>
[/pre]

Vincent

[quote=“vosmont, post:39, topic:172134”]Hi,

the “S_SmartSwitchController1.xml” file doesn’t follow the service template.

Bellow, you will find an example which works.
I just had to suppress the original file with winscp, because the upload creates a “S_SmartSwitchController1.xml.lzo” file, which seems to be masked by the original file.

[pre]

<?xml version="1.0"?> 1 0 Mode no string mode Timeout no string timeout SetOnLevel level in

</actionList>
[/pre]

Vincent[/quote]

As what to what Vincent added, you add the value to the service variables that you want the data to be exposed to lu_sdata. You do not have to expose all of the service variables. Only what is needed.

  • Garrett