We have moved at community.getvera.com

Author Topic: Virtual Device - Flag  (Read 32518 times)

Offline denix

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1088
  • Karma: +1/-0
Re: Virtual Device - Flag
« Reply #45 on: February 03, 2010, 12:56:45 am »
Create event-based scenes based on the sunrise or sunset events.

Argh, I just replied in another thread... :) Same question - how "event-based scenes based on the sunrise or sunset" are different from "timer-based scenes based on the sunrise or sunset"?
Veras (1, 2, 3, Lite, Plus), lots of different Z-Wave modules, Luup plugins and theater/security integration.

Offline michaelk

  • Hero Member
  • *****
  • Posts: 633
  • Karma: +0/-0
Re: Virtual Device - Flag
« Reply #46 on: February 03, 2010, 06:53:44 pm »
ya know- it is kind of funny now that you mention it. They are basically the same

But mostly it's easier to make conditional events with a virtual device for sunrise or sunset.  And this particular one makes it easy- us dolts (raises hand- laughing)- only have to figure out if/then lua code rather then also figure out how to write scenes to flip a virtual device also. it's just simplier in my particular brain to code events based on sunrise and sunset as conditions with the virtual device.

And once you have the device for conditional events then it's staring you in the face to make event bases things.

Which drives me to my point- the UI in the lua 1.x code is lacking and is completely non-intuative for sunrise and sunset. In most peoples minds sunrise and sunsets are events that occur at different times each day. Calling that a timer is odd as there's not a set period of time between the events day after day. Than to comppound it it's that is "day of week based" timer- when the day of the week has nothing to do with when sunrise and sunset occur- the day of the year, ones longitude and latitude but if it's monday, tuesday, or wednesday means nothing.

I suppose they wanted to add the feature and couldn't figure out where to put it in the UI so just chucked it there so we'de have access till the new UI came out- but boy is the current setup a pig with lipstick.

Offline denix

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1088
  • Karma: +1/-0
Re: Virtual Device - Flag
« Reply #47 on: February 03, 2010, 07:38:23 pm »
Which drives me to my point- the UI in the lua 1.x code is lacking and is completely non-intuative for sunrise and sunset. In most peoples minds sunrise and sunsets are events that occur at different times each day. Calling that a timer is odd as there's not a set period of time between the events day after day. Than to comppound it it's that is "day of week based" timer- when the day of the week has nothing to do with when sunrise and sunset occur- the day of the year, ones longitude and latitude but if it's monday, tuesday, or wednesday means nothing.

I suppose they wanted to add the feature and couldn't figure out where to put it in the UI so just chucked it there so we'de have access till the new UI came out- but boy is the current setup a pig with lipstick.

LOL :) I hope new UI meets the expectations of so many people! :)
Veras (1, 2, 3, Lite, Plus), lots of different Z-Wave modules, Luup plugins and theater/security integration.

Offline michaelk

  • Hero Member
  • *****
  • Posts: 633
  • Karma: +0/-0
Re: Virtual Device - Flag
« Reply #48 on: February 03, 2010, 08:12:34 pm »
I'm downloading it now - I'll let you know what I think -    ;D

Offline michaelk

  • Hero Member
  • *****
  • Posts: 633
  • Karma: +0/-0
Re: Virtual Device - Flag
« Reply #49 on: February 21, 2010, 06:42:48 pm »
We're releasing a new UI next week (hopefully) which addresses these issues by allowing devs to create new device icons and controls in xml/json files which get populated in the UI.  This includes the ability to add your devices into the scene structure.

I had to roll back to UI2 for homebuddy so not currently on UI3. But has anyone written any virtual devices yet so you can use UI3 to fiddle with them?

Offline sjolshagen

  • Sr. Member
  • ****
  • Posts: 416
  • Karma: +5/-0
Re: Virtual Device - Flag
« Reply #50 on: November 18, 2010, 07:09:32 am »
Reviving an old thread (hope nobody minds! :))

I'm using the [DI]_StateDevice.xml files and noticed after upgrading to the latest UI4 code (trying to isolate another unrelated problem) that the lua code for my StateDevice based virtual devices fails to compile at lua startup:

Code: [Select]
LuaInterface::LoadCode: [string "function SSwitchPower1_SetTarget_run(lul_device,lul_settings)..."]:2: unexpected symbol near '�' <0x400>
I'm not spotting anything immediately wrong with the code when glancing at the .xml files in FireFox, but I'm also not what I'd consider a proficient coder.

Anybody have any suggestions for how I can fix this?
Vera3/UI5 @ v1.5.622

Offline ZMaF

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
Re: Virtual Device - Flag
« Reply #51 on: December 27, 2010, 01:53:54 pm »
I've been playing with the StateDevice virtual device, but I'm having trouble. It installs properly and shows up in the UI. When I press the On or Off buttons, the UI does not reflect the new state, but if I look at the state variables under Advanced, then the status does get changed appropriately. It seems that just the UI does not reflect the status properly.

Is this a problem others have as well? How can this be fixed? Is the virtual device not implementing poll properly.

ZMaF
Vera2, ACT (8 switches, dimmers, 3-way, outlet), GE (15 dimmers, 3-way, outlets)

Offline michaelk

  • Hero Member
  • *****
  • Posts: 633
  • Karma: +0/-0
Re: Virtual Device - Flag
« Reply #52 on: January 03, 2011, 10:37:30 pm »
I've been playing with the StateDevice virtual device, but I'm having trouble. It installs properly and shows up in the UI. When I press the On or Off buttons, the UI does not reflect the new state, but if I look at the state variables under Advanced, then the status does get changed appropriately. It seems that just the UI does not reflect the status properly.

Is this a problem others have as well? How can this be fixed? Is the virtual device not implementing poll properly.

ZMaF


did you read the whole thread- i think its in here or another similar thread.  It's been a while so I'm not certain- but i seem to recall you have to use scenes to change the states of the dummy devices- you can't use the buttons on the webpage.

Myself- i happened to have an insteon doodad so i can set up dummy x10 devices- and vera allows one to use the web page buttons to change the states.  (x-10 has been implemented somewhat in more recent versions
« Last Edit: January 03, 2011, 10:39:35 pm by michaelk »

Offline cw-kid

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1612
  • Karma: +18/-2
Re: Virtual Device - Flag
« Reply #53 on: September 22, 2012, 09:50:56 am »
If this virtual device idea is as popular as it seems ti be, it might be a good idea to ask MCV to add "native" virtual device and virtual sensor - with full functionality. This would allow to have a unified way to build and use this sort of devices. Besides making things plain simpler to develop, it would improve compatibility and interoperability between plugins and components.

Hi

Did that ever happen ?

New VeraLite user here, having problems trying to create a new Virtual Device, I used your XML files and uploaded them, created a new device but when clicking the On/Off buttons it says "Device not ready" is that normal behaviour ?

Thanks
« Last Edit: September 22, 2012, 09:55:52 am by cw-kid »