Adapters Plugin [archive]

Open source plugin that allows you to create devices which translate/transform values from other devices (Fahrenheit to Celsius for instance).
User avatar
Korey
Posts: 888
Joined: Wed Jun 04, 2008 11:47 am
Location: Henderson, NV
Contact:

Re: Adapters Plugin

Post by Korey »

howartp wrote:Matt/Jay, i'm intending publishing a new Nissan Leaf plugin (also Dusty's).

Dusty has touched his github account twice in the last 18 months, so obviously isn't active anywhere at present.

Can I takeover his plugin(s) - Nissan Leaf and Adapters certainly, to post up this fixed version? Not sure if he has others?

Peter

Any news on this?

I use the Adaptor plugin for a bunch of conversion, but I find it will stop updating every so often and will require a reload of the plugin to make it function again.

Thanks!
--
Korey
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Adapters Plugin

Post by matt (support) »

I found another/different email address we had for dustysparkle and just sent him another message. I'll let you know when/if I hear back from him.
Image
bsp9493
Posts: 153
Joined: Thu Nov 30, 2017 12:09 pm
Location: Kelowna, BC

Re: Adapters Plugin

Post by bsp9493 »

Hi...

I have been seeing the following in my logs recently...

Is this being caused by the Adapters Plug in, or is my device that's feeding it causing the problem? This is the only error message that I am receiving and when I check my source device, everything appears to be ok.

Thanx in advance.

dave

Code: Select all

   Adapters Error                  Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 130, in deviceUpdated
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/sensor_adapter.py", line 39, in go
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/pyrescaler/pyrescaler.py", line 103, in format
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/pyrescaler/pyrescaler.py", line 106, in convert
ValueError: could not convert string to float: ----.-

   Adapters Error                  Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 130, in deviceUpdated
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/sensor_adapter.py", line 39, in go
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/pyrescaler/pyrescaler.py", line 103, in format
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/Adapters.indigoPlugin/Contents/Server Plugin/pyrescaler/pyrescaler.py", line 106, in convert
ValueError: could not convert string to float: ----.-
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Adapters Plugin

Post by DaveL17 »

For some reason, the plugin is expecting a float value (decimal number) but is getting a string (text) instead. If this was working without error at one point, then either the plugin code has changed or the source data has changed types. If you're using a custom formula adapter, you may be able to solve the problem by changing 'x' in the formula to 'float(x)', but that solution is untested.
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
bsp9493
Posts: 153
Joined: Thu Nov 30, 2017 12:09 pm
Location: Kelowna, BC

Re: Adapters Plugin

Post by bsp9493 »

Thanx Dave...

I have 2 custom and 1 standard Predefined scale (temperature, F to C).

I have changed the custom ones to "float(x)" as you suggested, will see what happens.

Strange, it's intermittent and nothing has changed with the devices that I am using with them that I am aware of.

Will keep an eye out.

d
bsp9493
Posts: 153
Joined: Thu Nov 30, 2017 12:09 pm
Location: Kelowna, BC

Re: Adapters Plugin

Post by bsp9493 »

If it helps... I turned on debug after I made those changes... this is what popped up in the a few mins after the change.

Code: Select all

Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 41.2 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 41.9 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 17.8 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 17.8 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 41.2 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 41.9 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 41.2 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 41.9 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 41.2 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 41.9 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
   Adapters Debug                  resulting format with precision applied: {0:.1f} {1}
   Adapters Debug                  formatted result: 18.1 °C
   Adapters Debug                  ws1401ip variables['outdoorTemp'] °F -> °C: 18.1 °C
   Adapters Debug                  ws1401ip variables['solarRadiation'] {0:.1f} units: 47.5 units
   Adapters Debug                  ws1401ip variables['UV'] {0:.1f} units: 47.5 units
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Adapters Plugin

Post by DaveL17 »

Looks like it may be working then, yes?
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
ckeyes888
Posts: 2438
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Adapters Plugin

Post by ckeyes888 »

Just need to remove the decimal from my Davis temp device. 72.1 - 72
Maybe the plugin can do that?

Thanks,

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

Re: Adapters Plugin

Post by DaveL17 »

Yes. That's precisely what it was meant to do. :)
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
ckeyes888
Posts: 2438
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Adapters Plugin

Post by ckeyes888 »

Thanks Dave. Maybe a tip on how to do that?
Seeing a lot of formulas I don’t understand.

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

Re: Adapters Plugin

Post by DaveL17 »

Sure! No need to use a custom formula.
  1. Create a new Adapters device.
  2. Select Predefined Scale Adapter.
  3. Select the source sensor device.
  4. Select Scale Type: Temperature
  5. Native Scale: Fahrenheit (or choice)
  6. Desired Scale: Fahrenheit (or choice)
  7. Precision: 1 (zero decimal places)
That's it. Then use the Adapters device instead of the source device for displaying on control pages and so forth. If you want to do something more creative later (that requires a formula) I'm happy to help with that, too.
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
ckeyes888
Posts: 2438
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Adapters Plugin

Post by ckeyes888 »

Perfect...thanks a bunch!

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

Re: Adapters Plugin

Post by DaveL17 »

No problem!
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
ckeyes888
Posts: 2438
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Adapters Plugin - Issue Removing Decimal

Post by ckeyes888 »

Tried the settings you mentioned but am still getting the decimal.
Missed something? Still returns 43.1

Thanks,

Carl
Attachments
8BA2E7DC-03A7-4391-89AD-15E7360D419E.png
8BA2E7DC-03A7-4391-89AD-15E7360D419E.png (73.29 KiB) Viewed 8425 times
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Adapters Plugin - Issue Removing Decimal

Post by FlyingDiver »

ckeyes888 wrote:Tried the settings you mentioned but am still getting the decimal.
Missed something? Still returns 43.1l
Set "Precision" to 0.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Locked

Return to “Adapters”