openHAB 2.0 binding
-
Small update:
-
I've fixed the problem with the representation of the light status (@kolaf ).
-
I've experimented a little with the configuration files. Additionally to the thing discovery or manual creation via the Paper UI you're able to declare the gateway and corresponding things/items in configuration files. It is very similar to the declaration done in OpenHAB 1.X, without the need to handle the messages in the rules files. I've documented that in the Readme.md you find while following the Link to the Github repository in the first post of this thread.
-
I've started a discussion in the google group for OpenHAB2. OpenHAB2 is not able to read out the value of a thing within the binding. This would be very useful, for example for the pulse sensors (power/water) that are able to request the last pulse count. (Corresponding thread in the google group: https://groups.google.com/forum/#!topic/openhab2/QbmaSwC59l0)
The current snapshot of the mysensors binding is available for download here:
Download@TimO Great work, I will try to test it tonight.
It appears from the discussion that official support for getting the values in the binding seems unlikely.
I guess you could argue that as long as the thing and openhab are not rebooted at the same time, the count should be consistent from the thing. But perhaps he is right, maybe it is better to just keep the total count inside openhab and create a rule to calculate the total power consumed based on our knowledge of number of pulses per kwh, for instance?
On the other hand, was about something like a lock which needs to know its last state if it was not written to EEPROM, is this also beyond the scope of what the binding should be able to do?
-
-
I just wanted to say thanks for your work on this. OpenHAB2 has been slow to a release but I think a mySensors-openHAB2 combination could really be a solution that many people need. Ease of entry, big user base, handles many sensors and applications.
My kids go back to school in a couple weeks and I hope to help with testing. Thanks.
-
I followed your directions and installed on a Windows 7 machine with a serial gateway. Everything came up fine. I configured the serial gateway (added the port). Then I waited but my humidity sensor was not detected. I restarted my arduino with the humidity sensor and immediately two new devices appeared (Humidity plus temperature).
Really nice! Thanks.
-
I followed your directions and installed on a Windows 7 machine with a serial gateway. Everything came up fine. I configured the serial gateway (added the port). Then I waited but my humidity sensor was not detected. I restarted my arduino with the humidity sensor and immediately two new devices appeared (Humidity plus temperature).
Really nice! Thanks.
-
oh let me update the code then. :blush:
Did some fixes since my last commit
Cheers
UPDATE
Guys, folks here at MySensor were gracefull enough to upgrade the MockMySensors to lib 1.5 and I didn't realise that. So making a dumb mistake I've tried to update the development branch from my local copy.
I don't think the pull request went through which is good and I think you should be fine with the master version.Cheers
-
I am new to MySensors and for that matter home automation in general, but I have setup OpenHab 2.0 on Windows 7 with a serial gateway device. I built a humidity and temp sensor and after a bit of trial and error (30 mins) the sensors were detected within OpenHab. Sensors are updating every 30 seconds without any issues even though the gateway is in the loft and the sensor is in the downstairs living room. I am very impressed at how easy your auto detection has made the initial setup. I have initially bought Vera Edge but my serial gateway has the wrong chipset to work with it so thought I would give this a try. I am tempted to sell the Vera now after having quick success thanks to your help, just need to keep an eye on the OpenHab 2.0 development and hope it's ready to use sometime soon.
-
@Atomfire I'm glad it worked for you too!! :-)
I've added a few additional sensors:
- S_DOOR
- S_MOTION
- S_SMOKE
- S_DIMMER
- S_COVER (V_STOP not implemented in OH2, can't use it yet)
- S_WIND
- S_RAIN
- S_UV
- S_WEIGHT
- S_DISTANCE
- S_LIGHT_LEVEL
Downloadlink is in the first post and I've modified the instructions.
Please delete the content of the userdata directory if you already tested with an older version of the binding. OH2 may get confused (throws exceptions) otherwise.
-
after installing openhab2 this way how do I keep it updated?
-
For those interested in OpenHAB - they have a new forum here:
http://community.openhab.org/I think/hope it will be easier to use that the google groups.
-
Firstly great work on the binding... it makes openhab2 a bit more attractive.
Not entirely sure how to debug this further as I'm very new to openhab but after setting all my sensors up (even via discovery which is cool) after I restart the openhab2 service the MYS things never get initialized and stay in the UNINITIALIZED state.
Running on RP2 and start_debug.sh I see the incoming MYS messages but OH2 is not updating the thing, for example
2015-08-15 04:04:57 [DEBUG] [b.m.p.ip.MySensorsIpConnection:68 ] - 4;0;1;0;0;29.0
2015-08-15 04:05:08 [DEBUG] [b.m.p.ip.MySensorsIpConnection:68 ] - 1;0;1;0;0;30.0However if I go in to the thing via the paperui, edit/save it. The thing is then initialized and I can see in the console OH2 updating the thing when a message is received.
2015-08-15 04:08:53 [DEBUG] [b.m.p.ip.MySensorsIpConnection:68 ] - 1;0;1;0;0;30.0
2015-08-15 04:08:53 [INFO ] [runtime.busevents :27 ] - mysensors_temperature_08797005_Temperature_1_0_temp state updated to 30.0I deleted the userdata directory before updating to the latest version 3 days ago.
No idea if this is a OH2 issue or a binding issue though.
-
@Qu3Uk: Thank you for the report. I am able to reproduce this. I suppose it is an error in my binding because some parts are started correctly. I will look into it.
-
How do I add this button from the paper UI ? I can´t understand what to enter in the child id, node id fields.
/** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * DESCRIPTION * * Simple binary switch example * Connect button or door/window reed switch between * digitial I/O pin 3 (BUTTON_PIN below) and GND. * http://www.mysensors.org/build/binary */ #include <MySensor.h> #include <SPI.h> #include <Bounce2.h> #define CHILD_ID 3 #define BUTTON_PIN 3 // Arduino Digital I/O pin for button/reed switch MySensor gw; Bounce debouncer = Bounce(); int oldValue=-1; // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(CHILD_ID,V_TRIPPED); void setup() { gw.begin(); // Setup the button pinMode(BUTTON_PIN,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN,HIGH); // After setting up the button, setup debouncer debouncer.attach(BUTTON_PIN); debouncer.interval(5); // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. gw.present(CHILD_ID, S_DOOR); } // Check if digital input has changed and send in new value void loop() { debouncer.update(); // Get the update value int value = debouncer.read(); if (value != oldValue) { // Send in the new value gw.send(msg.set(value==HIGH ? 1 : 0)); oldValue = value; } } -
@Cliff-Karlsson : Start the discovery process in the paper ui and after that restart your sensor. The sensor will represent itself while starting up and should appear in the paper ui.
-
Well if I add a door sensor and just enter some random node id/child Id it shows up as online. I never managed to add any sensor automatically even if I start the search process and resetting any sensors.
But the problem is that I can't get any reaction from the switch. I have tried connecting a button to pin 3 and also tried just connecting a cable from pin 3 to gnd. But no reaction whatever I do.