Adapters Plugin [archive]

Open source plugin that allows you to create devices which translate/transform values from other devices (Fahrenheit to Celsius for instance).
Mattias

Re: Adapters Plugin

Post by Mattias »

here's some data from one multisensor (humidity, luminance, temperature)
Attachments
multisensor_123.txt
(10.89 KiB) Downloaded 356 times
Mattias

Re: Adapters Plugin

Post by Mattias »

Yesterday I moved the z-stick to a different usb-port, and now it seems that the Adapters plug in works correct. So, no remaining issues with the plug in. The problem was because of malfunctioning z-stick/usb-port and not the plug in.
//Mattias
smackie
Posts: 9
Joined: Thu May 08, 2014 3:14 pm

Re: Adapters Plugin

Post by smackie »

Really glad I discovered this plugin - it's a total gem! Especially if you use DaveL17s WUnderstation and have to convert your usual C sensors to F. I was using custom python scripts on a schedule but this cleans everything up.

Thanks!

I noticed that someone asked for dew point a while back. I do this calculation for my WUnderstation feed and looked at integrating it into Adapters. It's not a brilliant fit as it requires two values, the temperature and humidity. However, it might be possible to make this work if we expanded the custom formula model a little. Right now, it takes a formula using "x" as the variable, derived from the linked sensor. This is fine.

However, we could also add optional "y" and "z" variables that are fed from Indigo variable values. This would allow calculations that are rooted on a sensor value but depend on other variables (which could also be sensor values saved to variables). Two more variables should cover pretty much all circumstances. I'm not sure there's much point in integrating a standard dew point calculation into adapters but it'd be trivial to write instructions for the calculation using a multiple variable function.

Any thoughts? I'd have a crack at this if I get a chance in the near future...

Cheers

Scott...
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Adapters Plugin

Post by DaveL17 »

Feasibility of Feature Request Request:

Hi dustysparkle: you may not have seen this thread, but we've been talking about you. :D I wanted to request the feasibility of a feature request (hence my redundant note above). Would it be possible without too much heartache to make the adapters plugin location aware? We're trying to apply a locale-based format specifier, but it doesn't appear to work. Alternatively, would it be possible to have a "locale adapter" perhaps?

http://forums.indigodomo.com/viewtopic. ... 49&t=17796

Cheers,
Dave
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
jmdraper
Posts: 103
Joined: Thu Sep 11, 2014 3:49 pm
Location: Surrey, UK

Re: Adapters Plugin

Post by jmdraper »

Hi

This plugin looks like exactly what I need but I just can't get it working properly for my use case. I am trying to take the 'time left in minutes' state of an Indigo Timer device and add 1 to it for use on a control page (so that if the timer has, say 30s left on it then the control page will show '1 minute' instead of '0 minutes').

I installed the plugin, created a new Adapters device and chose Custom Linear Scale adapter, then selected my timer device timeLeftMinutes state from the sensor state drop-down list. In the list, it correctly shows the number of minutes left at the end of this entry, which gave me hope this would work . Then I changed offset to 1.0 and left the multiplier as 1.0 and left the formatting field as default. But the value of the adapters device just stays at 0 regardless of the timeLeftMinutes state of the timer it's based on.

Am I doing something wrong or is there a bug?

Thanks,
Jon
jmdraper
Posts: 103
Joined: Thu Sep 11, 2014 3:49 pm
Location: Surrey, UK

Re: Adapters Plugin

Post by jmdraper »

OK I got my use case working now, though I still don't understand why my first attempt didn't work. I got it working by using a Custom formula adapter (numeric result) with the formula of x+1.

Thanks for the incredibly useful plugin. And if anyone can explain what I was doing wrong with the linear adapter I would be most grateful!

Cheers,
Jon
dustysparkle
Posts: 54
Joined: Mon Dec 14, 2015 6:30 pm

Re: Adapters Plugin

Post by dustysparkle »

Hi Jon,

I'm not sure what must caused the problem with the linear conversion. If I had to take a guess, it would be something involving conversion between numeric values and string values somewhere.

In any case, I'm glad you got it working with the forumula--that's definitely the most flexible way to use the plugin. If I had it to do all over again, I'd just write that one and leave the linear transformation out. :-)
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Adapters Plugin

Post by DaveL17 »

Hi dustysparkle - just a note that the plugin menu item "About Adapters v1.0.2" points to http://temp-converter.indigo.drjason.com which appears to be a dead URL.

Cheers,
Dave
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
dustysparkle
Posts: 54
Joined: Mon Dec 14, 2015 6:30 pm

Re: Adapters Plugin

Post by dustysparkle »

Ah, thanks, Dave. I'll change that in the next version to point to this topic. :)
noel1983
Posts: 446
Joined: Fri Oct 17, 2014 1:35 pm

Re: Adapters Plugin

Post by noel1983 »

Hi,
This looks to be an awesome plugin. Probably me being dense but I can't get it to work.

Looking to have it show 'Unlocked' if x == on else 'Locked' if x == off

This is for a relay controlling a door latch.

Logs show:

Traceback (most recent call last):
File "plugin.py", line 127, in deviceUpdated
File "/Library/Application Support/Perceptive Automation/Indigo 7/IndigoPluginHost.app/Contents/PlugIns/plugin_base.py", line 1179, in deviceUpdated
File "plugin.py", line 110, in deviceStartComm
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/sensor_adapter.py", line 30, in __init__
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/sensor_adapter.py", line 39, in go
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/pyrescaler/pyrescaler.py", line 103, in format
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/pyrescaler/pyrescaler.py", line 106, in convert
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/simpleeval.py", line 334, in simple_eval
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/simpleeval.py", line 226, in eval
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/simpleeval.py", line 265, in _eval
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/simpleeval.py", line 263, in _eval
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/simpleeval.py", line 294, in _eval
NameNotDefined: 'on' is not defined for expression ''Unlocked' if x == on else 'Locked''

Guidance much appreciated
Thanks
Noel
noel1983
Posts: 446
Joined: Fri Oct 17, 2014 1:35 pm

Re: Adapters Plugin

Post by noel1983 »

Solved! Just copied the syntax from the example and now works

'Unlocked' if x == 1 else 'Locked' if x == 0 else 'stuck'

What's particularly impressive is the little graphic in indigo shows the green padlock or yellow open padlock. Very cool!
qcvictor
Posts: 80
Joined: Thu Apr 23, 2015 6:35 pm
Location: Quebec, Canada

Re: Adapters Plugin

Post by qcvictor »

Hi Dustysparkle
As enhancement, unit pressure will be great. bar=>psi
Just for get a nice small icon ;-)
User avatar
mgolden50
Posts: 278
Joined: Mon Jan 29, 2007 7:55 pm
Location: Chandler, AZ
Contact:

Re: Adapters Plugin

Post by mgolden50 »

Hi DustySparkle,

I guess I'm a dummy. I'm attempting to use your plugin but having trouble that I can't figure out. When I set the plugin forPredefined scales it works fine.
Put when I select Custom Linear Scale Adapter so I can offset the reported temperature from an Aeon MultiSensor 6 by -6.8 degrees I get the following errors:

Adapters Error Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
File "plugin.py", line 127, in deviceUpdated
File "/Library/Application Support/Perceptive Automation/Indigo 7.3/IndigoPluginHost.app/Contents/Resources/PlugIns/plugin_base.py", line 1179, in deviceUpdated
File "plugin.py", line 110, in deviceStartComm
File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/sensor_adapter.py", line 25, in __init__
File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/sensor_adapter.py", line 76, in __init__
KeyError: key formula not found in dict

Could you provide me with an example for how to set the parameters for a negative temperature offset using this Adapter. that would eliminate these errors. I would much appreciate it.

Thx

Mike
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Adapters Plugin

Post by howartp »

I’m not sure Dusty is around any more; if he doesn’t reply, one of us will have a look.


Sent from my iPhone using Tapatalk Pro
User avatar
mgolden50
Posts: 278
Joined: Mon Jan 29, 2007 7:55 pm
Location: Chandler, AZ
Contact:

Re: Adapters Plugin

Post by mgolden50 »

Thanks
Locked

Return to “Adapters”