Author Topic: Creating an artificial variable  (Read 370 times)

Offline kwieto

  • Hero Member
  • *****
  • Posts: 613
  • Karma: +27/-15
Creating an artificial variable
« on: June 11, 2018, 05:55:26 am »
Can I create an "artificial" variable under a device and use it for storing a data there?
I know that I can create a variable under Advanced > New Service tab of specific device, but what kind of "service" should I put there?

My goal is to use such variable to store data delivered from a scene which monitors amount of available memory (see this thread: http://forum.micasaverde.com/index.php/topic,85510.0.html )
This way I should be able to make this variable be monitored by datamine and have track of how it changes over time.

Online akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6204
  • Karma: +276/-70
  • "Less is more"
Re: Creating an artificial variable
« Reply #1 on: June 11, 2018, 07:01:16 am »
It's usual to follow convention and use something like:

Code: [Select]
urn:kwieto-com:serviceId:whateveryourlike1

If you have a real URL for yourself or your app, then so much the better.

The trailing '1' digit is to allow multiple serviceIds for the same service schema.  Speaking of which you may care to (but need not) make a proper service file for this, defining variables (and possible actions.)

You should NOT use urn:micasaverde-com and certainly not urn:upnp-org.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline kwieto

  • Hero Member
  • *****
  • Posts: 613
  • Karma: +27/-15
Re: Creating an artificial variable
« Reply #2 on: June 11, 2018, 09:01:31 am »
I thought about putting it into the system monitor, using beginning declared for variables used there: "urn:cd-jackson-com:serviceId:?"

Online akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6204
  • Karma: +276/-70
  • "Less is more"
Re: Creating an artificial variable
« Reply #3 on: June 11, 2018, 10:35:21 am »
Yes, if you're using an existing device, then there's some logic to this, but it does not squarely assign the blame to the right person if something should go wrong!
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline kwieto

  • Hero Member
  • *****
  • Posts: 613
  • Karma: +27/-15
Re: Creating an artificial variable
« Reply #4 on: June 11, 2018, 01:37:07 pm »
It's hard to blame creator of the plugin for modification which I did to it :)
But it is probably dead-end: I can save data there, the problem is that DataMine seems to not follow that (it ignores any changes on this variable).

I found Multistring plugin which may better cooperate with Datamine, I just hoped that I can avoid installing additional plugins

Offline kwieto

  • Hero Member
  • *****
  • Posts: 613
  • Karma: +27/-15
Re: Creating an artificial variable
« Reply #5 on: June 11, 2018, 04:30:13 pm »
OK, my fault, I did spelling error in variable set command.
Everything works and I have readings in Datamine