This looks promising to at least get everything taking in the same place.
https://github.com/stjohnjohnson/smartthings-mqtt-bridge/blob/master/README.md
Posts made by gigaguy
-
RE: ST connectivty via WebIOPi/REST?
-
ST connectivty via WebIOPi/REST?
Look like ST can read from WebIOPi running in rpi. https://community.smartthings.com/t/release-raspberry-pi-relay-controller-webiopi/36362
Im wondering if it would be possible to somehow make MQTT available via WebIOPi, then to ST.
Maybe this? https://github.com/chrismerck/mqtt2rest
Has anyone tried anything like this?
-
RE: Energy monitor from existing CT's
@ewgor, like I said, I couldnt get mine built. Not sure what i did wrong. I got values, but they were the same whether current was going through or not. So i kind of gave up on it for a while. I too need some help getting it built.
-
RE: Energy monitor from existing CT's
@ewgor I never got this working. Issue was with my board, ct, etc, not openhab. I dont see any reason openhab would have any issues with it.
-
RE: Sound Sensor
@epierre thanks. I do have 4 pins, and im using the analog one. I noticed the increasing value you mentioned. I tried to get raw and got a value, but when taking into the mic, the value doesn't appear to change. Does yours?
-
RE: [Tutorial] openHAB with serial gateway
How to I add I_BATTERY_LEVEL to the openhab rules? Being internal I wasnt sure if hashmap would do it.
Something like this? Where Item is NodeX_Batt
// Internal Command if(msgType == 3){ if(subType == I_BATTERY_LEVEL){ postUpdate("Node" + nodeId + "_Batt, msg) println("Node" + nodeId + "_Batt:" + msg) }}
-
RE: Sound Sensor
Did anyone get this working? I have the 1st mic in epierre's picture above. I am getting values from it. I am currently using the analog pin, based on the posts here. The values dont seem accurate. They dont change with sound level. I am just trying to get a noise % level.
-
RE: Connect mysensors node to existing alarm system.
I tapped into a newer alarm systems door sensors by measuring the voltage via the analog pins. My alarm still works, but I can also see open/closed via mysensors/openhab.
-
Queued send commands?
I use openhab and serial gw (ethernet component on its way). What is the best way to ensure a command gets sent if the node has a gw.wait or gw.sleep? I can see openhab sending the command, but if the node is sleeping it obviously doesnt get it.
Could I just enable ack? would that force the gw to retry until it gets ack?
Or should I just keep sending until I get the ack?
TIA
-
RE: How would I interface with Protection 1 alarm sensors?
I was able to use a voltage measurement sketch in the arduino, and just connect up the arduino to the door sensor/zone(s) and ground. it was something like 6v when closed and way higher (maybe 50v+) when open. Then just send that to the controller/gateway. Hope that helps.
-
RE: gw.sleep issues
@barduino Yeah the Temp bounces around since I removed the sleep, it is far less variable with the sleep. I am going to try with the gw.wait, i think this is the one that still processes while it waits. If not, I will try millis.
-
RE: MQ2 Sensor w/AirQuality Sketch
@robosensor What is on pin 13? In the Setup() warmup part?
btw, I am getting a value of 1 or 2, after warmup. -
MQ2 Sensor w/AirQuality Sketch
I bought a gas sensor MQ2 from ebay. trying to figure out how to connect it, and use the Air Quality Sketch.
http://www.ebay.com/itm/371194045196?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
Ive got the analog connection on A0, not sure if i need to connect the digital pin too or not.
I am getting a reading of 0ppm for all the measurements in the sketch.
Any ideas? TIA.
-
RE: gw.sleep issues
Still nothing, as far as errors. It seems the nodes set up as relay are the ones that stop reporting. Should there be sensors on a relay node? maybe that is my issue?
-
RE: IR Blaster (progress)
If I am understanding this thread correctly. This would be capable of repeating the IR signal, correct? So, if I put one of these in every room. I can use my universal remote or something similar to change the channel on a tv in another room?
-
RE: Windows GUI/Controller for MySensors
I have a some questions. Couldnt find answer anywhere.
If I am using an arduino connected to the serial port on a Raspberry pi (w/openhab) How do I assign fw, reboot, etc?
Do I need to disconnect the GW and use windows temporarily to reboot, update fw? or can I have 2 GW's?
I updated my nano with the MYS bootloader, and after I power it on, it never shows up in MYSController.
-
RE: Energy monitor from existing CT's
@ServiceXp Thanks. Thats what I was trying to find out.
-
RE: Energy monitor from existing CT's
Thanks @ServiceXp That does help some.
I guess i dont understand how to connect the ct to the arduino. I see your setup (burden resistor, etc). But since these are already installed, and connected via 110v into the wiser device. I dont want to also add the 5v from the arduino.I do have access to the CT wires coming into the device. Would I just connect at that point (while leaving them connected to wiser) and then just wire it up to arduino as if it weren't connected to anything else?
I do have some more CT's coming in the mail, and will just setup a 2nd set of CT's if I cant get it working this way. Just seems like a waste to double them up.
Measuring the ct wires via voltmeter. The only reading I got was from the 200ohm setting. The reading was 4.1. Not sure this helps. Maybe I am reading/using it wrong.
Not sure if this made any sense.
-
RE: Energy monitor from existing CT's
I was wondering if I could just tap into the CT directly, via arduino/mysensors.
I am doing something similar with my alarm system. leaving it intact and functional, but piggybacking off the door sensors at the panel. (uses voltage levels)
-
RE: gw.sleep issues
ok, ill leave it plugged into computer and let you know about the log.
Update: The arduino seems to be acting like there is no change in temp, and therefore, nothing to send. I am going to try removing the "temp != lastTemp" and see what happens. no errors or fails though, since it doesnt have anything to send.
-
RE: gw.sleep issues
The log on the GW or the arduino? The GW, doesnt say anything, since nothing is received. I waited about 40 hours before hitting reset, which then sent a message once or twice, then never again until next reset.
-
Energy monitor from existing CT's
Just bought a new home, and it has the Wiser energy monitor installed. I am already getting the data the "official" way since it's free for the first year. But I was wondering if I can somehow use the arduino to piggyback on the ct's going into the device using the arduino.
Here is the install guide.
http://static.schneider-electric.us/docs/Advanced Products/Efficient Homes/0200DB1302.pdfThis is the panel portion of the device. This has the CT's connected to it.
http://www.homedepot.com/p/Wiser-Jetlun-JIM-Wireless-Panel-Meter-WISERJLPM200/204176793#product_descriptionAny pointers or examples I can reference?
TIA
-
gw.sleep issues
Got about 5 of my nodes up and running, most are just temp/hum. They all work great, as long as the (gw.sleep) is removed (happens on all the nodes). In the code below, its almost directly from the example code, but with the gw.sleep uncommented it reports once, and then went two days without another report (until i hit reset). Then the same happened again. I guarantee the room temp changed in that time. It's not just one node, it's any that sleep. Just want to know if I am doing something wrong, or how I can troubleshoot. I dont want to keep spamming the GW with the data from the nodes, for no reason.
I also noticed, and this kind of makes sense, that any node set to listen for incoming messages, cant have the sleep. It causes it to miss the message.
TIA.
#include <MySensor.h> #include <SPI.h> #include <DHT.h> #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 #define HUMIDITY_SENSOR_DIGITAL_PIN 2 MySensor gw; DHT dht; float lastTemp; float lastHum; boolean metric = false; MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds) void setup() { // Spin up MySensors gw.begin(NULL,22); dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); // Let the controller know about our children gw.present(CHILD_ID_HUM, S_HUM); gw.present(CHILD_ID_TEMP, S_TEMP); metric = gw.getConfig().isMetric; metric=false; // Sensor is on wall power, so peg battery level at 100% gw.sendBatteryLevel(100); } void loop() { gw.process(); updateHumTemp(); //gw.sleep(SLEEP_TIME); //sleep a bit } void updateHumTemp(){ delay(dht.getMinimumSamplingPeriod()); float temperature = dht.getTemperature(); if (isnan(temperature)) { Serial.println("Failed reading temperature from DHT"); } else if (temperature != lastTemp) { lastTemp = temperature; if (!metric) { temperature = dht.toFahrenheit(temperature); } gw.send(msgTemp.set(temperature, 1)); Serial.print("T: "); Serial.println(temperature); } float humidity = dht.getHumidity(); if (isnan(humidity)) { Serial.println("Failed reading humidity from DHT"); } else if (humidity != lastHum) { lastHum = humidity; gw.send(msgHum.set(humidity, 1)); Serial.print("H: "); Serial.println(humidity); } }```
-
RE: set Metric on gw?
@Tango2 I had been doing this a different way until I noticed the GW should be able to do it. BTW, It is only working on one node, not sure why :(.
Anyway, my alternate solution allows be to send "settings: to the nodes. For example, change the loop time or measurement unit.
This is not the complete code, just the relevant parts (hopefully).
void setup() { gw.begin(incomingMessage, nodeID); } void loop() { gw.process(); } void incomingMessage(const MyMessage &message) { if (message.type == 97) { Serial.print("Recvd Time"); Serial.println(time); timeReceived=true; } if (message.type == 98) { int reqsleep = atoi( message.data ); SLEEP_TIME = reqsleep*1000; Serial.print( "Changing sleep to: " ); Serial.println( String(reqsleep) ); } if (message.type == 99) { int requnit = atoi( message.data ); Serial.print( "Changing units to: " ); if(requnit == M){ metric = true; Serial.println( "metric" ); } else { metric = false; Serial.println( "imprerial" ); } } }
Using this code, I can send things from openhab, or any serial command I suppose.
My openhab rules
Send Units:sendCommand(Arduino, "101;99;1;0;99;M\n")
Send Time:
var Number time1 time1 = now().getMillis() / 1000 sendCommand(Arduino, "101;97;1;0;97;" + time1 + "\n")
-
RE: set Metric on gw?
Ok, it just started working !!!! I created a separate rul for it. So either it doesnt like being mixed in with the other stuff or it doesnt like the == I_CONFIG
This rule below is working
rule "Arduino config" when Item Arduino received update then var String lineBuffer = Arduino.state.toString.split("\n") for (String line : lineBuffer) { var String[] message = line.split(";") var Integer nodeId = new Integer(message.get(0)) var Integer childId = new Integer(message.get(1)) var Integer msgType = new Integer(message.get(2)) var Integer ack = new Integer(message.get(3)) var Integer subType = new Integer(message.get(4)) var String msg = message.get(5) // Internal Command if(msgType == 3){ if(subType == 6){ var String unit unit = "I" //unit = "M" sendCommand(Arduino, nodeId + ";255;3;0;6;" + unit + "\n") println("Updated Sensor Units to " + unit +) } } } end
-
RE: set Metric on gw?
Guess I should have posted this code initially. I already have that rule in place, and still no luck. (I couldnt get "gw.requestTime(receiveTime)" to work either)
This is in the setup portion in arduino sketch
metric = gw.getConfig().isMetric;
Only posted relevant portions of the code. The rule itself works (for V_TEMP, etc), just none of the "internal commands I_*" do.
var int I_CONFIG = 6 //receiving msg from mysensors gateway rule "Arduino sends to Openhab" when Item Arduino received update then var String lineBuffer = Arduino.state.toString.split("\n") for (String line : lineBuffer) { var String[] message = line.split(";") var Integer nodeId = new Integer(message.get(0)) var Integer childId = new Integer(message.get(1)) var Integer msgType = new Integer(message.get(2)) var Integer ack = new Integer(message.get(3)) var Integer subType = new Integer(message.get(4)) var String msg = message.get(5) // Internal Command if(msgType == 3){ if(subType == I_CONFIG){ var String unit unit = "I" //unit = "M" sendCommand(Arduino, nodeId + ";255;3;0;6;" + unit + "\n") println("Updated Sensor Units to " + unit +) } } } end
This is what openhab is getting when the arduino is reset.
101;255;3;0;11;Humidity 0;0;3;0;9;read: 101-101-0 s=255,c=3,t=12,pt=0,l=3:1.0 101;255;3;0;12;1.0 0;0;3;0;9;read: 101-101-0 s=0,c=0,t=7,pt=0,l=5:1.4.1 101;0;0;0;7;1.4.1 0;0;3;0;9;read: 101-101-0 s=1,c=0,t=6,pt=0,l=5:1.4.1 101;1;0;0;6;1.4.1 0;0;3;0;9;read: 101-101-0 s=2,c=0,t=4,pt=0,l=5:1.4.1 101;2;0;0;4;1.4.1 0;0;3;0;9;read: 101-101-0 s=3,c=2,t=3,pt=0,l=0: 101;3;2;0;3; 0;0;3;0;9;read: 101-101-0 s=1,c=1,t=0,pt=7,l=5:26.0 101;1;1;0;0;26.0 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=1,pt=7,l=5:34.0 101;0;1;0;1;34.0
Shouldnt there be something like
101;255;3;0;6;?
-
RE: Sending serial commands to sensors
Did you figure this out? I am trying to do the same thing.
-
set Metric on gw?
Sorry, I am brand new to MySensors. I see in all the examples there is a gw.getConfig().isMetric
I know this is a new feature. Trying to figure out how to set this, before I update all my nodes with the metric part just commented out.
Can I push this setting out from openhab (via SerialGateway)?
TIA.