This page last changed on Mar 31, 2013 by iloveautomation.

I have been trying (for a while) to create a switch for my X10 lights. Since X10 does not provide status feedback I was wondering if I could use the in-memory Virtual command? If yes, how do I define it?
I tried putting in ON for Command and DUMMY for address and vice versa but so far have had no luck. Also I could not find any documentation related to it which is understandable.

It would be great if I could get some help on it.
The X10 ON/OFF commands work a little bit erratic meaning, when I try to turn on K2 light, K3 or K9 command is passed on. Of course now my first task is to get the sensor/switch work. My setup is Win 7 64bit with Serial CM11A.


Off.png (image/png)
On.png (image/png)
Sensor.png (image/png)
Status.png (image/png)
Switch.png (image/png)

Address will basically just be the name of your variable here.
You can use commands ON, OFF and STATUS.
ON will set variable to true, OFF to false and STATUS will read its value back.

So to create a switch, create the 3 commands above, create a switch sensor using the STATUS command, then create a switch object using the ON & OFF commands and the sensor.

Posted by ebariaux at Apr 03, 2013 12:38

Eric - Thanks for explaining the functioning of virtual command. My next question is can I trigger the virtual ON command when I hit the X10 ON command? Can I use Rules to do that function?
So basically when I turn on a light using X10 (with X10 ON command) the ON virtual command also runs and sets the value to ON. This way the dummy sensor will provide feedback as ON.
Hope I was able to explain my idea.

Posted by iloveautomation at Apr 03, 2013 16:37

See here for an explanation of a similar problem and solution.

Posted by ebariaux at Apr 08, 2013 20:03

Dears,

I tried the above In Memory Virtual Commands, but so far I was not succesfull.
Do I need to enable the "In Memory Virtual Commands" or something?
I created a Dummy Device with commands ON/OFF/STATUS, linked them to the same Dummy address and made a UI Switch.
But so far I was not able to toggle the switch in the UI.

Please help!

Thanks,
Dieter

Posted by dclaeys at May 07, 2013 15:07

Try to get it working step by step.
Create the 3 commands and the sensor.
Create 2 buttons for on/off and a label linked to the sensor.
Does pressing the on/off buttons update the label accordingly ?

Posted by ebariaux at May 08, 2013 09:11

I tried this yesterday.
just the 3 commands + the sensor + the switch.
The label doesn't update accoringly.

Posted by dclaeys at May 08, 2013 09:15

Can you post some screen shots of the commands from the designer website? I have been using it extensively and works well for me.
Make sure you are running the latest version of Openremote.

Posted by iloveautomation at May 08, 2013 20:23

Hello,
So far I made below commands:





Then I used the switch in my UI.
but it doesn't toggle...

Posted by dclaeys at May 12, 2013 08:28

Try changing the Names to something like "LightOn", "LightOff" and "LightStatus" and do the same for sensor and switch. Try it and provide response.

Posted by iloveautomation at May 12, 2013 12:17

Hello Ravi,
I tried it today.
It also doesnt work...

Posted by dclaeys at May 13, 2013 12:02

This is weird. I have it working with almost exactly the same configuration. The only difference is that I called it Switch1, and as address I use knop. But those differences should not matter.
I did use PRO designer 1.07 and controller 1.07.

Posted by pz1 at May 13, 2013 12:22

I did test it, re-creating the elements exactly as in your screenshots and it does work for me on iOS console.

Which designer, controller and console (and version) are you using ?

Posted by ebariaux at May 13, 2013 12:42

I am working with the Demo version of Designer.
Could this be the reason?

Posted by dclaeys at May 13, 2013 12:42

Hello Eric,

I use https://composer.openremote.org/demo/ as designer
As controller I use the version 2.1.0 (latest version)
As console I use iPAD running iOS 6.1.3

Posted by dclaeys at May 13, 2013 12:46

Hello to all openremote community

I have exactly the same issue, with the same configuration (Version OpenRemote 2.1 Alpha SNAPSHOT 2013-07-18). The issue appears both on ipad and webconsole, so i think that is not related to the ios app.
Checking xml-parser log files i can see this lines:

DEBUG 2013-08-23 08:48:44,271 (XML): A switch sensor (Name = 'testsensor', ID = 231) has an incomplete <state> element mapping, the value attribute is missing in <state name = on/>.
DEBUG 2013-08-23 08:48:44,287 (XML): A switch sensor (Name = 'testsensor', ID = 231) has an incomplete <state> element mapping, the value attribute is missing in <state name = off/>.
DEBUG 2013-08-23 09:13:07,569 (XML): A switch sensor (Name = 'vDoorSensor', ID = 230) has an incomplete <state> element mapping, the value attribute is missing in <state name = on/>.
DEBUG 2013-08-23 09:13:07,569 (XML): A switch sensor (Name = 'vDoorSensor', ID = 230) has an incomplete <state> element mapping, the value attribute is missing in <state name = off/>.

So i have changed the on/off commands from "teston" to on, and "testoff" to off, and changed the sensor type from switch to custom, mapping the corresponding values. The same with vDoorSensor. Once i have made this changes, the error does not appear again.

Checking again, i saw that the issue persists, but now in the dev.log another issue appears:

2013-08-23 09:44:52,520 WARN [HTTP-Thread-7]: Unknown virtual protocol property '<property name = "name" value = "on"/>'.
2013-08-23 09:44:54,205 WARN [HTTP-Thread-7]: Unknown virtual protocol property '<property name = "name" value = "off"/>'.
2013-08-23 09:44:55,250 WARN [HTTP-Thread-7]: Unknown virtual protocol property '<property name = "name" value = "off"/>'.

This is the controller.xml, i don´t find any "property name = name", so i don´t know what else do :

  <components>
    <switch id="195">
      <on>
        <include type="command" ref="221" />
      </on>
      <off>
        <include type="command" ref="222" />
      </off>
      <include type="sensor" ref="231" />
    </switch>
    <button id="191">
      <include type="command" ref="222" />
    </button>
    <button id="189">
      <include type="command" ref="221" />
    </button>
    <label id="193">
      <include type="sensor" ref="230" />
    </label>
  </components>
  <sensors>
    <sensor id="230" name="test" type="custom">
      <include type="command" ref="223" />
      <state name="off" value="off" />
      <state name="on" value="on" />
    </sensor>
    <sensor id="231" name="SensorDoor" type="custom">
      <include type="command" ref="223" />
      <state name="off" value="off" />
      <state name="on" value="on" />
    </sensor>
  </sensors>
  <commands>
    <command id="221" protocol="virtual">
      <property name="address" value="yepa" />
      <property name="command" value="on" />
      <property name="name" value="on" />
    </command>
    <command id="222" protocol="virtual">
      <property name="address" value="yepa" />
      <property name="command" value="off" />
      <property name="name" value="off" />
    </command>
    <command id="223" protocol="virtual">
      <property name="address" value="yepa" />
      <property name="command" value="status" />
      <property name="name" value="status" />
    </command>

Any help would be appreciated.

Posted by kolsan at Aug 23, 2013 08:53

Hello Again

Somebody could provide me a controller.xml file with virtual commands in order to test in my environment?
I appreciate too information about the working environment, OS, OpenRemote version,java version...

Thanks in advanced and regards

Posted by kolsan at Aug 25, 2013 10:51

Hmm, nothing in the above that immediately jumps out as causing an issue. It is strange that it's not working for you.

Posted by juha at Aug 26, 2013 17:15

Thanks Juha for your answer

Is a java related issue, i was using jdk 1.7. With latest 1.6 jdk version is working fine...

Regards!

Posted by kolsan at Aug 27, 2013 10:51
Document generated by Confluence on Jun 05, 2016 09:41