Jump to content

rwblinn

Members
  • Gesamte Inhalte

    121
  • Benutzer seit

  • Letzter Besuch

Posts erstellt von rwblinn

  1. Hi,

     

    an UV Light bricklet is used with a Master Brick 2.1 (fw 2.4.0) and the new WiFi 2.0 extension (fw 2.0.0).

     

    The value returned from Java method getUVLight() is rather high, like 80000 which results in a too high UV index when deviding by 250.

    When deviding again by 250 (80000 / 250 / 250), then UV index seems ok.

     

    Think this is a bug. Pls advice.

  2. Hi,

     

    downloaded the latest version of the TF MQTT proxy to be able to use the UV bricklet. After installation received, error message below.

     

    Please advice.

     

    $ pip install tinkerforge
    Requirement already satisfied (use --upgrade to upgrade): tinkerforge in /usr/local/lib/python2.7/dist-packages
    Cleaning up...
    
    $ sudo python brick-mqtt-proxy.py&
    [1] 10498
    
    pi@raspberrypi ~/tinkerforge/mqtt $ Traceback (most recent call last):
      File "brick-mqtt-proxy.py", line 92, in <module>
        from tinkerforge.bricklet_uv_light import BrickletUVLight
    ImportError: No module named bricklet_uv_light
    

  3. I am experiencing a similiar error:

    2016-03-25 07:11:25.198 [ERROR] [t.i.m.i.MBrickletBarometerImpl] - Tinkerforge Error: Tinkerforge timeout occurred : Did not receive response in time for function ID 1 

     

    In addition, from time to time after running openHAB for a while (rTS is the UID for the Barometer Bricklet):

    - COMMAND no tinkerforge device found for command for item uid: rTS subId: null 

    After resetting the Master Brick and openHAB, the error disappears, but comes back after openHAB runs for a while.

    Setup:

    • Raspberry Pi 3 with latest Raspian (Jessie)
    • Master Brick 2.0 with Temperature, Humidity and Barometer Bricklet
    • openHAB 1.8.1, TinkerForge Bindings org.openhab.action.tinkerforge-1.8.1.jar and org.openhab.binding.tinkerforge-1.8.1.jar
       

     

  4. By...

    Items

    Number Illuminance "Illuminance [%.0f Lux]" <none>
    String IlluminanceTimeStamp "Illuminance Timestamp [%1$tm/%1$td %1$tH:%1$tM]" <none>
    String IlluminanceRaw "IlluminanceRaw [%s]" <none> { mqtt="<[mosquitto:tinkerforge/bricklet/ambient_light/mdh/illuminance:state:default]" }
    

    Sitemap

    sitemap ambientlightmqtt label="MQTT Illuminance"
    {
    Frame
    {
    	Text item=Illuminance
    	Text item=IlluminanceTimeStamp
    	Text item=IlluminanceRaw
    }
    } 
    

    Rules = UNIX timestamp conversion needs to be improved.

    import org.openhab.core.library.types.*
    import org.openhab.core.persistence.*
    import org.openhab.model.script.actions.*
    import org.joda.time.*
    
    rule "MqttAmbientLightParse"
    when 
    Item IlluminanceRaw changed
    then
    //Convert the raw data to a string
    var String data = (IlluminanceRaw.state as StringType).toString
    
    //Parse the JSON string
    // { "illuminance":1354,"_timestamp":1456750088.109141 }
    
    //Illuminance
    var String il = transform("JSONPATH", "$.illuminance", data)
    var iln = new Double(il)
    iln = iln * 0.1
        	Illuminance.postUpdate( iln)
    
    //Timestamp
    var String ts = transform("JSONPATH", "$._timestamp", data)
            //THIS NEEDS TOBE IMPROVED
    ts = ts.replaceAll("E9", "")
    ts = ts.replaceAll("[.]", "")
    //IlluminanceTimeStamp.postUpdate(ts)
    var DateTime dt = new DateTime(Long::parseLong(ts) * 1000L)
    IlluminanceTimeStamp.postUpdate(new DateTimeType(dt.toString))
    end
    

  5. Hi,

     

    as a test tried to setup openHAB MQTT displaying AmbientLight bricklet Illuminance BUT nothing is displayed. Any idea what could be wrong?

     

    Items

    Number Illuminance "Illuminance [%.0f Lux]" <none> { }
    String IlluminanceRaw "IlluminanceRaw" [%s] <none> { mqtt="<[mosquitto:tinkerforge/bricklet/ambient_light/mdh/illuminance:state:default]" }
    

     

    Rule

    import org.openhab.core.library.types.*
    import org.openhab.core.persistence.*
    import org.openhab.model.script.actions.*
    
    rule "MqttAmbientLightParse"
      when 
        Item IlluminanceRaw changed
      then
    var String json = (IlluminanceRaw.state as StringType).toString
    logInfo("FILE", json)
    //{"illuminance":1354,"_timestamp":1456750088.109141}
    var String il = transform("JSONPATH", "$.illuminance", json)
    logInfo("FILE", "IL="+il)
    var String ts = transform("JSONPATH", "$._timestamp", json)
    logInfo("FILE", "TS="+ts)
        	sendCommand(Illuminance,  il)
      end 
    

     

    sitemap

    sitemap ambientlightmqtt label="MQTT Illuminance"
    {
    Frame
    {
    	Text item=Illuminance
    	Text item=IlluminanceRaw
    }
    } 

     

  6. Hi,

     

    tried to install on the RED Brick via Brick Viewer > RED Brick > Programs.

    After creating, receiving following error:

    Traceback (most recent call last):

      File "brick-mqtt-proxy.py", line 1003, in <module>

        proxy.connect()

      File "brick-mqtt-proxy.py", line 888, in connect

        self.client.connect(self.broker_host, self.broker_port)

      File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 612, in connect

        return self.reconnect()

      File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 734, in reconnect

        sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))

      File "/usr/lib/python2.7/socket.py", line 571, in create_connection

        raise err

    socket.error: [Errno 97] Address family not supported by protocol

     

    The red brick configuration file (tfrba) is attached.

     

    Any help appreciated.

    red-brick-export-20160229-110050.tfrba

  7. Hi,

     

    connected a LED to A0 of the IO16 bricklet. Using the Brick Viewer and setting the Port Direction to Output, the LED can be turned on and off via changing the value Low to High vv.

     

    Tried to setup the same by using openHAB, but the LED is not reacting.

    Any hints what is worng in below openHAB Testconfiguration having Port A0 as output outa0?

     

    #openhab.cfg

    tinkerforge:hosts=127.0.0.1

    tinkerforge:io16.uid=gkM

    tinkerforge:io16.type=bricklet_io16

    tinkerforge:io16.debouncePeriod=100

    tinkerforge:io16outa0.uid=gkM

    tinkerforge:io16outa0.subid=outa0

    tinkerforge:io16outa0.type=io_actuator

    tinkerforge:io16outa0.defaultState=true

     

    #items

    Number TF_AmbientLight "Luminance [%.0f lx]" { tinkerforge="uid=mdh" }

    Switch outa0 "LED A0" { tinkerforge="uid=gkM, subid=outa0" }

     

    #rules

    import org.openhab.core.library.types.*

     

    rule "LED Switch"

    when

    Item outa0 changed

    then

    if (outa0.state == true)

    sendcommand(outa0, false)

    else

    sendcommand(outa0, true)

    end

     

    NOTE: Instead of true false also tried ON OFF.

     

    #sitemap

    sitemap tf_weather_station label="Weather Station"

    {

    Frame

    {

    Text item=TF_AmbientLight

    Switch item=outa0

    }

    }

     

  8. One more related question is how to write a custom char. The standard table does not contain arrow up. Question is how to translate the custom arrow up from bytes to the hex value to be displayed as asked previous.

    * ``character[0] = 0b00000000`` (decimal value 0)

    * ``character[1] = 0b00000100`` (decimal value 4)

    * ``character[2] = 0b00001010`` (decimal value 10)

    * ``character[3] = 0b00011011`` (decimal value 27)

    * ``character[4] = 0b00000100`` (decimal value 4)

    * ``character[5] = 0b00000100`` (decimal value 4)

    * ``character[6] = 0b00001110`` (decimal value 14)

    * ``character[7] = 0b00000000`` (decimal value 0)

           

    Appreciate your help

×
×
  • Neu erstellen...