Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. BartE
    3. Topics
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by BartE

    • BartE

      Extra command message type for local data requests
      Feature Requests • • BartE  

      4
      0
      Votes
      4
      Posts
      1888
      Views

      BartE

      OK i did make a prototype implementation using the V_CUSTOM message type. This works for Vera only. I had to change only one file: L_Arduino.lua The function starting on line 244 has te be extened with this if statement: -- Handle Local Request variables if (varType == "CUSTOM") then local bit = require("bit") local varReqIndex = bit.band(tonumber(value), 0xFF); local varVeraId = bit.rshift(tonumber(value), 8); local varReqType = tVarLookupNumType[varReqIndex] local varReq = tVarTypes[varReqType] if (varReq[2] ~= nil) then log("Local request '" .. varReq[3] .. "' from Device ID: ".. varVeraId .. " sensor type '" .. varReqType .. "'") local localValue = luup.variable_get(varReq[2], varReq[3], varVeraId) if (localValue ~= nil) then -- Send variable value to actuator sendRequestResponse(nodeId .. ";" .. childId, varReqType, localValue) end end else The complete function will then look like this: local function setVariable(incomingData, childId, nodeId) if (childId ~= nil) then -- Set variable on child sensor. local index = tonumber(incomingData[5]); local varType = tVarLookupNumType[index] local var = tVarTypes[varType] local value = incomingData[6] local timestamp = os.time() -- Handle Local Request variables if (varType == "CUSTOM") then local bit = require("bit") local varReqIndex = bit.band(tonumber(value), 0xFF); local varVeraId = bit.rshift(tonumber(value), 8); local varReqType = tVarLookupNumType[varReqIndex] local varReq = tVarTypes[varReqType] if (varReq[2] ~= nil) then log("Local request '" .. varReq[3] .. "' from Device ID: ".. varVeraId .. " sensor type '" .. varReqType .. "'") local localValue = luup.variable_get(varReq[2], varReq[3], varVeraId) if (localValue ~= nil) then -- Send variable value to actuator sendRequestResponse(nodeId .. ";" .. childId, varReqType, localValue) end end elseif (var[2] ~= nil) then log("Setting variable '".. var[3] .. "' to value '".. value.. "'") setVariableIfChanged(var[2], var[3], value, childId) -- Handle special variables battery level and tripped which also -- should update other variables to os.time() if (varType == "TRIPPED" and value == "1") then local variable = tVeraTypes["LAST_TRIP"] setVariableIfChanged(variable[2], variable[3], timestamp, childId) else local variable = tVeraTypes["LAST_UPDATE"] setVariableIfChanged(variable[2], variable[3], timestamp, childId) end end -- Always update LAST_UPDATE for node if (nodeId ~= nil) then local nodeDevice = childIdLookupTable[nodeId .. ";" .. NODE_CHILD_ID] setLastUpdate(nodeDevice) end end end Now the Vera HA-contoller response on V_CUSTOM messages. Use the feature in a MySensors node: void requestValue(byte type, unsigned int id) { MyMessage msgRequest(1, V_CUSTOM); unsigned long msgData; msgData = type + ((unsigned long)id * 0x100); send(msgRequest.set(msgData)); } void loop() { // Request the status from Vera Device 4 requestValue(V_STATUS, 4); // Request the dimn level from Vera Device 20 requestValue(V_LEVEL, 20); // etc.. } Make sure you can handle the incoming messages void receive(const MyMessage &message) { if (message.type==V_STATUS) { Serial.print(" New value: "); Serial.println(message.getBool()); } if (message.type==V_LEVEL) { Serial.print(" New value: "); Serial.println(message.getByte()); } if (message.type==V_TEMP) { Serial.print(" New value: "); Serial.println(message.getFloat()); } } If you need the same value type from different Device a different sensor id can be used, the requestValue will then look like this: void requestValue(byte type, unsigned int id, byte sensorid) { MyMessage msgRequest(sensorid, V_CUSTOM); unsigned long msgData; msgData = type + ((unsigned long)id * 0x100); send(msgRequest.set(msgData)); } In the receive function "message.sensor" can be used to determine for which device a request was made
    • BartE

      Smart home switch touch screen hack?
      General Discussion • • BartE  

      3
      0
      Votes
      3
      Posts
      1405
      Views

      tbowmo

      They do look nice, but it seems that they have a standardized icon / layout, that can't be changed. I would like to have the possibility to display arbitrary information on my dashboard / scene controller, so I'm creating a webpage mimicking a "weatherstation type display", and plan on using a cheap wall mounted tablet for the interface. this will also make any updates to functionality on the scene controller easy, as it's just a website that needs updating. preliminary proof of concept is at https://juletraesfoden.dk/t2/app. Backend is a mix of domoticz / node-red / python webservices..
    • BartE

      Looking for LED 7-segment cover plate
      General Discussion • • BartE  

      7
      0
      Votes
      7
      Posts
      4088
      Views

      BartE

      @mfalkvidd said: Very cool, I love the big red button. Where did you find it? I did found it i my box with electronic parts i once got a number of these switches of a friend of mine. BTW the clock radio has a led strip connected emulating a Wakeup light, shows the out door temperature on request, since it is MYS connected the alarm can be triggered via my HA controller and the most important feature it switches on my coffee machine upon wake up time. I will post a detailed description in the comming days,
    • BartE

      Controlling a 1st gen. LivingColors lamp
      My Project • • BartE  

      6
      2
      Votes
      6
      Posts
      5955
      Views

      rvendrame

      @BartE I purchased this module: https://www.aliexpress.com/item/Wireless-Module-CC2500-2-4G-Low-power-Consistency-Stability-Small-Size/32702148262.html?spm=a2g0s.9042311.0.0.L1Dfwj This is the pinout... ... and I'm in doubt how to wire GDO2, GDO0, RFSC above. RFCL - SCK (pin 13)? GDO2 - leave open? GDO0 - CE (pin 9)? RFCS - CS(pin 10)? Would you mind to clarify? Thanks!
    • BartE

      [SOLVED] msg.getBool() issue related to string length
      Bug Reports • • BartE  

      4
      0
      Votes
      4
      Posts
      1693
      Views

      BartE

      @Yveaux and @hek bingo! That line in v 1.5.4 does solve the issue. Thx a lot for the support. read: 0-0-9 s=1,c=1,t=2,pt=0,l=1,sg=0:0 send: 9-9-0-0 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0 Message: 2 Payload: getBool: 0 getString: 0 getInt: 0 getByte: 0 OFF: Switch colors off
    • BartE

      Single button operated Led Strip Dimmer
      My Project • • BartE  

      11
      6
      Votes
      11
      Posts
      16956
      Views

      JahFyahh

      @BartE (dutch site.. Even better) thanks for the link. I am looking for the safest way, seeing the this will not be in a quick access location. I want to put it away and only return for update/upgrades. But I will also look into an opto-coupler. Thanks for the tip.
    • BartE

      Running ATmega328P on internal 8MHz clock
      Hardware • • BartE  

      14
      7
      Votes
      14
      Posts
      24360
      Views

      bjacobse

      @eeichinger Yes an old thread, but still useful. well if you plan to run on a low voltage, you must disable BOD, else per default the 328 will switch off at 2,7V. And then you need to run 1 at MHz
    • BartE

      RFID Garage door opener
      My Project • • BartE  

      47
      10
      Votes
      47
      Posts
      37429
      Views

      gohan

      Are you looking for an rfid system or just a radio remote control?
    • BartE

      IR Record and Playback module
      My Project • • BartE  

      12
      9
      Votes
      12
      Posts
      9201
      Views

      BartE

      This sketch has been updated to MySensors 2.0 and added example library https://www.mysensors.org/build/ir
    • BartE

      The MySensor 1.5 code is not compiling for my Arduino Mega 2560 board
      Bug Reports • • BartE  

      1
      0
      Votes
      1
      Posts
      1391
      Views

      No one has replied

    • BartE

      My MySensors RGBW plug in has an init problem
      Vera • • BartE  

      11
      3
      Votes
      11
      Posts
      5949
      Views

      akbooer

      @BartE said: So the problem is NOT controlling the device, but having the RGBController to startup correctly as child. OK, here's my confusion: you can't have the Arduino plugin AND the RGBW Controller plugin both controlling the RGBW device. By definition, it is a child of the Arduino plugin and all functionality for that child device has to be provided by the parent. Are there, perhaps, some actions defined in the services or implementation file which are not, in fact, implemented by your additional code in the Arduino plugin?
    • BartE

      Wind sensor plug in files for Vera (UI5)
      Vera • • BartE  

      16
      0
      Votes
      16
      Posts
      5278
      Views

      abrmartin

      @BartE , I'm trying to set up an analog anemometer in my veralite system using the RGBW controller from fibaro. The problem I have is: which plugging should be used to let RGBW controller read the input from the anemometer and display the wind speed value in Km/h? I'm not a programmer and all my configurations applied to my veralite was using internet. I have spent lot of weeks looking for a solution but until this moment no progress achieved. Any support from your side will be very very appreciated. Thanks a lot.
    • BartE

      Arm / by-pass message not broadcast-ed to MySensor module
      Vera • • BartE  

      4
      0
      Votes
      4
      Posts
      1738
      Views

      hek

      Both merged! Thanks.
    • BartE

      Combined MySensor Gateway with 433Mhz transmitter (HomeEasy/Klik-Aan-Klik-uit)
      My Project • • BartE  

      26
      5
      Votes
      26
      Posts
      29588
      Views

      mvader

      @afeno said: @mvader said: I have the etekcity ZAP 433 remote & outlets. I just bought a 433 mhz transceiver off ebay and hooked it up to my raspberry pi2 and sniffed the codes. Did you manage to turn on/off the etekcity outlets from the gateway? I would like to do the same on my side... But I don't know too much about radio protocols. Thanks! Yes, i have my gateway in the basement. and then i built a mysensors 433mhz repeater (arduino + NRF radio + 433 transmitter / mysensors) this one is USB powered, stays on full time, it is on the 1st floor.. I control about 7 of the etek city outlets with it. I have to say though, most of my outlets are on the 2nd floor (which is why i put the transmitter on the 1st floor and not in the basement) even with an 433 external antenna, they fail to respond 10-15% of the time, with my z wave devices, they never fail to turn on/off no matter where they are, and with my sensors devices, i can always see/talk no matter where they are.. based on that, if i had to do it again, i would either zwave those or mysensor those devices (which i will probably move to down the road). during the holidays, i controlled another 5-7 etek outlets on the 1st floor, to control holiday lights, tree lights.. etc. all of those were on the 1st floor and generally worked fine.