openHAB 2.0 binding
-
Hi @TimO.
I am using several bindings in my OH2 setup.
As I am using MyS and OH2 in a productive and sensible environement I could try out how the other bindings behaved. As soon as I detect the error I had to rollback my setup. So I can't really tell is there is a bug with the latest snapshot of OH2 or if it is something more specific of MyS binding.I am currently using OH2 Beta 3 with no issues.
@gonzalonal : I've found the reason for this beaviour and fixed the bug.
@andreacioni contributed a PR to the code that includes a channel for the last update of a thing. If you want to know at which time there was a message from a node you may subscribe to the "lastupdate" channel.
Example:
DateTime lastUpdate01 "Last Update" { channel="mysensors:baro:gateway:baro01:lastupdate" }Thanks @andreacioni !
-
@gonzalonal : I've found the reason for this beaviour and fixed the bug.
@andreacioni contributed a PR to the code that includes a channel for the last update of a thing. If you want to know at which time there was a message from a node you may subscribe to the "lastupdate" channel.
Example:
DateTime lastUpdate01 "Last Update" { channel="mysensors:baro:gateway:baro01:lastupdate" }Thanks @andreacioni !
Hi @TimO .
I have tried the binding and the issue is fixed as you have said.
I have been looking at the logs, and found the following regarding last update feature:15:52:11.580 [DEBUG] [g.mysensors.protocol.MySensorsReader] - 1;253;1;0;2;1 15:52:11.583 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.581-0300 15:52:11.585 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.584-0300 15:52:11.590 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.588-0300 15:52:11.594 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.592-0300 15:52:11.598 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.597-0300 15:52:11.602 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.601-0300 15:52:11.606 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.604-0300 15:52:11.609 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.608-0300 15:52:11.613 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.611-0300 15:52:11.618 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.616-0300 15:52:11.624 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.622-0300 15:52:11.628 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.626-0300Is this the expected behavior? It seems to me that we should have only one "Setting last.." for value updated.
Maybe is my setup. Can someone check this.
Thanks! -
Hi @TimO .
I have tried the binding and the issue is fixed as you have said.
I have been looking at the logs, and found the following regarding last update feature:15:52:11.580 [DEBUG] [g.mysensors.protocol.MySensorsReader] - 1;253;1;0;2;1 15:52:11.583 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.581-0300 15:52:11.585 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.584-0300 15:52:11.590 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.588-0300 15:52:11.594 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.592-0300 15:52:11.598 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.597-0300 15:52:11.602 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.601-0300 15:52:11.606 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.604-0300 15:52:11.609 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.608-0300 15:52:11.613 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.611-0300 15:52:11.618 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.616-0300 15:52:11.624 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.622-0300 15:52:11.628 [DEBUG] [g.mysensors.handler.MySensorsHandler] - Setting last update for node 1 to 2016-08-08T15:52:11.626-0300Is this the expected behavior? It seems to me that we should have only one "Setting last.." for value updated.
Maybe is my setup. Can someone check this.
Thanks!Hi @gonzalonal
The implementation of the binding create a thing for every channel of a single node. So the solution result is what you can see in the log. We can do a little bit more to prevent a single message to fire every 'lastupdate' channel of every thing that have the same node ID. But I think it is not a good idea.
-
Hi @gonzalonal
The implementation of the binding create a thing for every channel of a single node. So the solution result is what you can see in the log. We can do a little bit more to prevent a single message to fire every 'lastupdate' channel of every thing that have the same node ID. But I think it is not a good idea.
Got it!
Thanks for your quick reply @andreacioni -
Hi guys,
I've tried to add my ethernet gateway to openhab2 through but I just cant get the Online-status on, it. Do I have to do anything else than just adding it into the things file?
-
Hi guys,
I've tried to add my ethernet gateway to openhab2 through but I just cant get the Online-status on, it. Do I have to do anything else than just adding it into the things file?
Hi @Gustafsson,
Have you read the readme? Readme . Probably you have not configured things? See the readme on how to do that :)
-
Hi @Gustafsson,
Have you read the readme? Readme . Probably you have not configured things? See the readme on how to do that :)
@andreacioni That's exactly what I did.
Things
Bridge mysensors:bridge-eth:gateway [ ipAddress="192.168.254.228", tcpPort=5003, sendDelay=200 ] door frontDoor [ nodeId="102", childId="4" ] }Items
Text frontDoor "Door" { channel="mysensors:door:gateway:frontDoor:tripped" }Sitemap
sitemap MySitemap label="Main Menu" { Frame { Text item=frontDoor } }This is how everything looks like now. I get the door item green in habmin but still the red cross on the gateway. The door item dosn't show me if it's open or closed.
-
@andreacioni That's exactly what I did.
Things
Bridge mysensors:bridge-eth:gateway [ ipAddress="192.168.254.228", tcpPort=5003, sendDelay=200 ] door frontDoor [ nodeId="102", childId="4" ] }Items
Text frontDoor "Door" { channel="mysensors:door:gateway:frontDoor:tripped" }Sitemap
sitemap MySitemap label="Main Menu" { Frame { Text item=frontDoor } }This is how everything looks like now. I get the door item green in habmin but still the red cross on the gateway. The door item dosn't show me if it's open or closed.
You are missing the opening brackets
Bridge mysensors:bridge-eth:gateway [ ipAddress="192.168.254.228", tcpPort=5003, sendDelay=200 ] {
door frontDoor [ nodeId="102", childId="4" ]
} -
You are missing the opening brackets
Bridge mysensors:bridge-eth:gateway [ ipAddress="192.168.254.228", tcpPort=5003, sendDelay=200 ] {
door frontDoor [ nodeId="102", childId="4" ]
}@gonzalonal sorry, I missed it when I pasted in my code here, so there is in fact a { in my code. Any other ideas?
-
I have a problem with adding one of my nodes.
My temp en hum nodes are working perfectly, but i try to add a Light Level node. The sensor is sending the amount of Lux and not the percentage:18:14:59.572 [DEBUG] [g.mysensors.protocol.MySensorsReader] - 0;255;3;0;9;TSP:MSG:READ 1-1-0 s=0,c=1,t=23,pt=3,l=2,sg=0:3 18:14:59.572 [DEBUG] [g.mysensors.protocol.MySensorsReader] - 1;0;1;0;23;3 18:14:59.574 [ERROR] [g.mysensors.protocol.MySensorsReader] - (java.lang.IllegalStateException: Could not update state, because callback is missing) on reading from serial port, message: class org.openhab.binding.mysensors.protocol.serial.MySensorsSerialReaderIt is using CHILD_ID_LIGHT inside the skechts. Is this light level node supported?
-
I have a problem with adding one of my nodes.
My temp en hum nodes are working perfectly, but i try to add a Light Level node. The sensor is sending the amount of Lux and not the percentage:18:14:59.572 [DEBUG] [g.mysensors.protocol.MySensorsReader] - 0;255;3;0;9;TSP:MSG:READ 1-1-0 s=0,c=1,t=23,pt=3,l=2,sg=0:3 18:14:59.572 [DEBUG] [g.mysensors.protocol.MySensorsReader] - 1;0;1;0;23;3 18:14:59.574 [ERROR] [g.mysensors.protocol.MySensorsReader] - (java.lang.IllegalStateException: Could not update state, because callback is missing) on reading from serial port, message: class org.openhab.binding.mysensors.protocol.serial.MySensorsSerialReaderIt is using CHILD_ID_LIGHT inside the skechts. Is this light level node supported?
@FutureCow said:
18:14:59.572 [DEBUG] [g.mysensors.protocol.MySensorsReader] - 1;0;1;0;23;3According to this: https://www.mysensors.org/download/serial_api_20
V_LIGHT_LEVEL 23 Uncalibrated light level. 0-100%. Use V_LEVEL for light level in lux. S_LIGHT_LEVEL V_LEVEL 37 Used for sending level-value S_DUST, S_AIR_QUALITY, S_SOUND (dB), S_VIBRATION (hz), S_LIGHT_LEVEL (lux)Your node should send "1;0;1;0;37;3 if I'm not mistaken.
The light level message is supported by the binding.
-
Small update to the progress:
-
Expert mode: I've added a special thing that will allow rule based parsing and sending of MySensors messages. If the binding is limiting your creativity you are now free to go. ;-) You are now able to combine/adapt rules like in this Thread with the easy process of thing/item/sensor configuration. I've added a description to the Wiki. This may solve some problems mentioned above with sensors requesting information like pulse count.
-
Last week the OH2 core team has released beta4 of OH2. I've tested the binding against the current beta and it is working fine.
-
I've created a PR against the official openhab2-addons repository. I'm now awaiting feedback and hope to introduce the MySensors binding as part of OH2.
-
-
Great news to hear @TimO .
I will be testing the binding in a couple of hours. It's really usefull the new RAW messenger things.
Thanks! -
Hi all, i am new in mysensors, but i have problem with install this plugin to OpenHab2.0 i tried versions 2.0 and 2.0b4 but i couldn't see this plugin in OpenHab2, i tried with RPi B, RPi3 with Raspian Jessie, and with Windows 10. But all with the same result.
I placed org.openhab.binding.mysensors-2.0.0.SNAPSHOT.jar into addons directory, but i can't se it in OpenHab.
Can anyone help me?
-
Hi all, i am new in mysensors, but i have problem with install this plugin to OpenHab2.0 i tried versions 2.0 and 2.0b4 but i couldn't see this plugin in OpenHab2, i tried with RPi B, RPi3 with Raspian Jessie, and with Windows 10. But all with the same result.
I placed org.openhab.binding.mysensors-2.0.0.SNAPSHOT.jar into addons directory, but i can't se it in OpenHab.
Can anyone help me?
-
@xlibor Did you follow the instructions on the wiki and installed serial transport first? Is there a log file entry? How did you install OH2? Debian Package or Zip File?
-
@xlibor Did you follow the instructions on the wiki and installed serial transport first? Is there a log file entry? How did you install OH2? Debian Package or Zip File?
@TimO Yes, i follow instruction on wiki and install serial transport sucesfully. I tried both types, first zip file and next package, but both with the same result :-(
In log file is nothing about mysensors or any error.
Now i downloaded again from github and now all works without any problem. But i don't know where was problem.
-
Hey All. Newbie alert here. I love the work you all do on here and this project is so exciting. I'm hooked after 2 weeks of 'fettling' and building sensors.
I've hit a brick wall though. after struggling with openhab1 I decided to make the leap straight to openhab2. Although in early days of testing it seems immediately abit more user friendly.
What I've done so far...
RaspberryPi3 is acting as controller with openhab2 installed and running fine. bindings to TV and Nest thermostat all working lovely.Clone arduino Uno's with capacitors added for radio with NRF24 radio cards
Created GatewayW5100 gateway using the mysensors library sketch for it and set static IP to 192.168.0.11 (Openhab2 is set to 192.168.0.10) and my router gives DHCP from 192.168.0.20 up
created a temp and humidity sensor node and a node with a relay to turn a lamp on (both from mysensors library). Tested radio on all before moving ahead.
Installed the mysensors binding on OH2
Added a ethernet gateway
disabled startup connection check as it kept failing to initialise and showed as offline
Tried auto discovery of nodes... NOTHING
Tried setting node ID manually on the arduinos.. Still NOTHING, even if i add a thing manually to OH2.
I'm hoping i'm doing something stupid and its an easy fix.. Any pointers for a newbie??
D.
-
Hey All. Newbie alert here. I love the work you all do on here and this project is so exciting. I'm hooked after 2 weeks of 'fettling' and building sensors.
I've hit a brick wall though. after struggling with openhab1 I decided to make the leap straight to openhab2. Although in early days of testing it seems immediately abit more user friendly.
What I've done so far...
RaspberryPi3 is acting as controller with openhab2 installed and running fine. bindings to TV and Nest thermostat all working lovely.Clone arduino Uno's with capacitors added for radio with NRF24 radio cards
Created GatewayW5100 gateway using the mysensors library sketch for it and set static IP to 192.168.0.11 (Openhab2 is set to 192.168.0.10) and my router gives DHCP from 192.168.0.20 up
created a temp and humidity sensor node and a node with a relay to turn a lamp on (both from mysensors library). Tested radio on all before moving ahead.
Installed the mysensors binding on OH2
Added a ethernet gateway
disabled startup connection check as it kept failing to initialise and showed as offline
Tried auto discovery of nodes... NOTHING
Tried setting node ID manually on the arduinos.. Still NOTHING, even if i add a thing manually to OH2.
I'm hoping i'm doing something stupid and its an easy fix.. Any pointers for a newbie??
D.
Have you tried to reach your gateway with telnet?
telnet 192.168.2.11 5003Does it respond? Do you see the messages from the node arriving?
Have you enabled debug output of the binding like described in the wiki? What does the log say?