I came across this post while looking for some information, and I realize this post is quite old, but I wanted to resurrect it for a couple reasons:
It looks like OP made a few posts and then never came back since 2018, so maybe they gave up (I know I have been there, more than once). I have come across a lot of posts like this while looking things up and I always find it quite sad that they never so much as received a single reply.
There are almost 600 views, so clearly I am not the only one looking for this information.
Therefore, @FredRoot, if you read this, just curious if you ever got it sorted.
And for anyone else reading, OpenHAB has changed a bit in the meantime, but I am pretty familiar with it, and so I could post a working example should anyone need it. Although this is really more of an OpenHAB question, and therefore perhaps more appropriate for their forums.
@itbeyond I'm glad to hear you finally found the cause!
The current jar is published via the download link on the wiki page: https://github.com/tobof/openhab2-addons/wiki/Installation
And via eclipse marketplace. There is currently no active development, I only try to ensure the binding is running fine with the most current release of Openhab2.
@Ericb2745
Well, in that case, it seems you are missing the receiving part of the code. This is directly from the example for the actuator and it works for me... It goes at the end of the code after the void loop.
// process incoming message
void receive(const MyMessage &message) {
if (message.type == V_LIGHT) {
if (message.sensor < noRelays) { // check if message is valid for relays..... previous line [[[ if (message.sensor <=noRelays){ ]]]
Relays[message.sensor].relayState = message.getBool();
digitalWrite(Relays[message.sensor].relayPin, Relays[message.sensor].relayState ? RELAY_ON : RELAY_OFF); // and set relays accordingly
saveState( message.sensor, Relays[message.sensor].relayState ); // save sensor state in EEPROM (location == sensor number)
Serial.print("Incoming change for sensor:");
Serial.print(message.sensor);
Serial.print(", New status: ");
Serial.print(message.getBool());
if(message.getBool() == 0)
Serial.println(" = OFF");
else(Serial.println(" = ON"));
}
}
}
@Eric-Buhring great to hear that you managed to get it working. I have used solution like this (arduino+eth. shield+rf24) for some time.
Now I have switched to esp8266+rf24(version with antenna) as a gateway, it is a cool (and smaller) solution
This has been solved!
Hi @stoffej!
Can you please try to assist me on a very similar topic?
I've built the EnergyMeterPulseSensor.ino pulse count sensor from the 2.0 library but I'm unable to initialize the items and I'm quite certain that this is why I'm not getting any values into Openhab. The Arduino is waiting for a request to be acknowledged which I guess is not happening.
I have enabled persistence for the pulse counter items and I've also tried to initialize the items by manually sending a value through the openhab console (telnet localhost 5555). After updating the values manually I can see the new value in the sitemap-GUI but the actual counting does not start.
After restarting Openhab the following is shown in the log:
... - New Item "myPCVar (Type=NumberItem, state=Uninitialized) based on configuration "50;1;V_VAR1"
A funny thing is that I actually got it working while working on the pulse counter on an experimental setup without actually trying to initialize the items. I don't know what I did at that time or if it started working just by chance.
Do you have any ideas of what steps to try? Thanks!
Ah forget what I wrote. Its working now. I guess it was a poor radio module which seems to be the reason in a lot of cases.
Hi @adds666
I did in between the switch from 2.5.12 to 3.4.4 a change from pure textual configuration in 2.5.12 to a UI configuration in 3.4.4. This requires some homework. Can't remember beside the exchanged mysensors binding files anything else to upgrade to 4.0.4 from 3.4.4 and finally to current 4.1.1. Keep in mind, I use a OpenHAB manual installation on a non-Debian Linux system, not openHABian. This may have an influence, but I don't expect any hiccups.
kerberos