Hello Joe,

thanks for your interest in pyowfs ;)

the .get() and .put() methods can only access attributes of a sensor
object (the leaves in the tree). To access a specific Sensor by id you
have to use the .find() method of the connection. Obviously you should
also check if the sensor actually could be found ... 

in my example i started a owserver with fake sensors in another
terminal:

$ owserver --debug -p 4711 --fake=DS2409,DS18S20,DS1921

to access a specific sensor i use the following:

>>> from pyowfs import Connection
>>> c = Connection("localhost:4711")
>>> for s in c.find () : 
...  print s
... 
<Sensor /1F.67C6697351FF/ - DS2409>
<Sensor /10.4AEC29CDBAAB/ - DS18S20>
<Sensor /21.F2FBE3467CC2/ - DS1921>
>>> for s in c.find (id="67C6697351FF") : 
...  print s
... 
<Sensor /1F.67C6697351FF/ - DS2409>
>>> s
<Sensor /1F.67C6697351FF/ - DS2409>
>>> s = c.find (id="67C6697351FF") [0]
>>> s
<Sensor /1F.67C6697351FF/ - DS2409>
>>> s = c.find (id="4AEC29CDBAAB") [0]
>>> s.get ("temperature")
'     14.1603'
>>> s.get ("temperature")
'     60.6969'
>>> 

The best place to post such questions is the owfs-developers list - i
posted this mail also there. see

https://lists.sourceforge.net/lists/listinfo/owfs-developers

for details on how to access the achives and/or to subscribe

all the best,
marcus.

On Don, 2013-04-18 at 04:55 +0200, [email protected] wrote:
> Joseph F. Portell (Joe) sent a message using the contact form at  
> http://priesch.co.at/contact.
> 
> Marcus how can I directly assign a sensor with a specific ID (eg  
> 28.450EDC020000) to a variable (type sensor) without having to iterate  
> through all the sensors of a given type and parsing each item in the list for 
>  
> the sensor's ID? I tried to do things like s = root.get("/28.450EDC020000")  
> but failed.
> 
> Also what is the best forum to post these questions to?
> 
> Thanks Joe P.
> 



------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to