Pilight binding does not connect to pilight-daemon

839 views
Skip to first unread message

Sebastian Waitz

unread,
Dec 26, 2014, 3:05:41 PM12/26/14
to ope...@googlegroups.com
Hello group,
I'm trying to connect the pilight OH binding (1.6.1) to my pilight-daemon (5.0). Pilight standalone is working properly and I can also telnet into the local IP:port of the pilight server. Pilight is running on the same host as OH.
Unfortunatly pilight binding always sais, that it cant connect. Here are some logs from openhab

20:21:24.978 DEBUG o.o.b.p.i.PilightActivator[:33]- pilight binding has been started.
20:21:26.988 INFO  o.o.b.p.i.PilightGenericBindingProvider[:79]- pilight:elro item 'steckd_elro_1a_new' bound to device 'elro1b' in location 'generic'
20:22:22.689 ERROR o.o.b.p.i.PilightConnection[:142]- No content to map to Object due to end of input
java.io.EOFException: No content to map to Object due to end of input
        at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2766)
        at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2709)
        at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1900)
        at org.openhab.binding.pilight.internal.PilightConnection.connect(PilightConnection.java:132)
        at org.openhab.binding.pilight.internal.PilightBinding.updated(PilightBinding.java:228)
        at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183)
20:22:22.713 ERROR o.o.b.p.i.PilightBinding[:233]- Cannot connect to pilight server at 192.168.23.11:5000

Since the Jackson Json Processor spits the error I can only imagine a config issue or a software bug.
This is my item config:

Switch steckd_elro_1a_new   "Markör Lampen (neu)"           (gEG_Lichter)     {pilight="elro#generic:elro1b"}

When pressing the button in OH frontend nothing happens. Even on DEBUG level. Anyone an idea what the might be? 
Thanks much for your help!


Jeroen Idserda

unread,
Dec 27, 2014, 4:25:11 AM12/27/14
to ope...@googlegroups.com
Hi Sebastian,

That's an error I haven't seen before.. What platform and Java version are you running openHAB on? And just to be sure, you're using pilight 5.0 and not the nightly builds, correct? The API has changed quite a bit in the latest snapshot versions. 

Regards,
Jeroen.

Sebastian Waitz

unread,
Dec 27, 2014, 6:23:58 AM12/27/14
to ope...@googlegroups.com
Hey Jeroen,
thanks for your reply. I'm running OH on the rPi with:

pi@raspbian ~ $ uname -a; cat /etc/issue; java -version
Linux raspbian 3.12.28+ #709 PREEMPT Mon Sep 8 15:28:00 BST 2014 armv6l GNU/Linux
Raspbian GNU/Linux 7 \n \l
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)

And yes, I can confirm to be using the default 5.0 version which the pilight repo offers.
Let me know if you have an idea to troubleshoot this issue.
Thanks


--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/K6W4x_KKA7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Jeroen Idserda

unread,
Dec 27, 2014, 7:02:26 AM12/27/14
to ope...@googlegroups.com
Hi Sebastian,

Thanks, this may be some kind of time out issue where openHAB is not getting a reply from pilight fast enough. I'll try running openHAB on the Pi too and see if I can reproduce the error. 

Regards,
Jeroen.

Sebastian Waitz

unread,
Dec 27, 2014, 7:09:55 AM12/27/14
to ope...@googlegroups.com
Thanks much.
With pilight and OH running on the Pi, I constantly have a load of roughly 1 (peaking to 2) which is quite high and also might impact timiming issues.

top - 13:09:02 up 21:11,  2 users,  load average: 1,89, 2,00, 1,41
Tasks:  91 total,   1 running,  90 sleeping,   0 stopped,   0 zombie
...
  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
 6060 root      20   0  107m 8996  776 S  30,2  1,8 379:14.19 pilight-daemon
 6302 pi        20   0  273m 131m  10m S  13,3 27,1  95:32.27 java


Let me know if I can be of any help tracking this down.


Jeroen Idserda

unread,
Dec 27, 2014, 10:20:14 AM12/27/14
to
Ah I assume you're using pilight without a band pass filter? With that filter CPU usage will go down to < 5%. The binding should just work however. I made a small change, new version of the binding can be downloaded here: https://buildhive.cloudbees.com/job/openhab/job/openhab/1915/org.openhab.binding$org.openhab.binding.pilight/ . Let me know if this helps.

Jeroen.

Sebastian Waitz

unread,
Dec 27, 2014, 11:05:50 AM12/27/14
to ope...@googlegroups.com
Hey,
that was a swift turnaround. Great!
Unfortunatly, the behavior hasn't changed. I've installed  the JAR you provided via the link. Even after restarting OH, the error remains the same:

16:58:32.547 ERROR o.o.b.p.i.PilightConnection[:145]- No content to map to Object due to end of input
java.io.EOFException: No content to map to Object due to end of input
        at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2766)
        at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2709)
        at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1877)
        at org.openhab.binding.pilight.internal.PilightConnection.connect(PilightConnection.java:135)
        at org.openhab.binding.pilight.internal.PilightBinding.updated(PilightBinding.java:228)
        at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183)
16:58:32.555 ERROR o.o.b.p.i.PilightBinding[:233]- Cannot connect to pilight server at 192.168.23.11:5000

PS: I also contacted the pilight DEV for some hardware
Thanks


2014-12-27 16:20 GMT+01:00 Jeroen Idserda <jeroen....@gmail.com>:
Ah I assume you're using pilight without a band pass filter? With that filter CPU usage will go down down to < 5%. The binding should just work however. I made a small change, new version of the binding can be downloaded here: https://buildhive.cloudbees.com/job/openhab/job/openhab/1915/org.openhab.binding$org.openhab.binding.pilight/ . Let me know if this helps.

Jeroen.

Jeroen Idserda

unread,
Dec 27, 2014, 12:31:22 PM12/27/14
to ope...@googlegroups.com

I have the filter installed, so I can't trigger this error. Even with some artificial load on the Pi the binding still connects to pilight. 
 
The band pass filter is quite simple, you can order an ATTiny45/ATTiny85 from eBay and program it with the pilight firmware tool yourself.

Jeroen.

Sebastian Waitz

unread,
Dec 27, 2014, 5:02:13 PM12/27/14
to ope...@googlegroups.com
Hey,
after installation of the new binding the error is gone, but still nothing happens.
On shifting to DEBUG mode, I receive 120 lines per second! in openab.log
22:58:25.645 DEBUG o.o.b.p.i.PilightConnection[:140]- pilight response after client identification: null
Thus disabled DEBUG mode again.
Thanks Seb



--

Jeroen Idserda

unread,
Dec 28, 2014, 5:22:07 AM12/28/14
to
Hi Sebastian,

So, I bypassed the band pass filter on my rPi (load from pilight increased to 30%), but the binding still connected fine. 

Could it be possible that you're connecting the openHAB binding to the webserver port of pilight? There are two port settings in pilight settings.json: 

"webserver-port": 5001,
"port": 5000

The openHAB binding should connect to the 'port' setting, which is configured by the pilight:elro.port property in your openhab.cfg. When I tried connecting to the webserver port I got the same error you're getting. 

Regards,
Jeroen.

Sebastian Waitz

unread,
Dec 28, 2014, 11:13:58 AM12/28/14
to ope...@googlegroups.com
OMG, this could be it. I'm running the default settings.json provided with the apt-get install.
Seems like some hardcoded values were missing. Also the "port" config. I was totally unaware that there are 2 ports used.
I've tried testing it, but my pilight is having performance problems right now:

[ Dec 28 17:10:29:60161] pilight-daemon: ERROR: ----- Thread Profiling -----
[ Dec 28 17:10:29:62093] pilight-daemon: ERROR: - thread lirc: 0.009144%
[ Dec 28 17:10:29:63873] pilight-daemon: ERROR: - thread socket: 0.000000%
[ Dec 28 17:10:29:66774] pilight-daemon: ERROR: - thread ssdp: 0.005265%
[ Dec 28 17:10:29:68404] pilight-daemon: ERROR: - thread sender: 0.000000%
[ Dec 28 17:10:29:70102] pilight-daemon: ERROR: - thread broadcaster: 0.012469%
[ Dec 28 17:10:29:71693] pilight-daemon: ERROR: - thread 433gpio: 60.004261%
[ Dec 28 17:10:29:73453] pilight-daemon: ERROR: - thread receive parser: 0.040689%
[ Dec 28 17:10:29:75659] pilight-daemon: ERROR: - thread webserver worker #0: 0.015232%
[ Dec 28 17:10:29:79410] pilight-daemon: ERROR: - thread webserver client: 0.000000%
[ Dec 28 17:10:29:81803] pilight-daemon: ERROR: - thread webserver broadcast: 0.000000%
[ Dec 28 17:10:29:85468] pilight-daemon: ERROR: - thread firmware upgrader: 0.007400%
[ Dec 28 17:10:29:87184] pilight-daemon: ERROR: ----- Thread Profiling -----
[ Dec 28 17:10:29:91849] pilight-daemon: ERROR: cpu usage still too high 60.217236%, stopping

I have to sort this first, but most likely your your point with the port was it already.
Thanks much so far. I'll let you know about the outcome.


2014-12-28 11:22 GMT+01:00 Jeroen Idserda <jeroen....@gmail.com>:
Hi Seb,

So, I bypassed the band pass filter on my rPi (load from pilight increased to 30%), but the binding still connected fine. 

Could it be possible that you're connecting the openHAB binding to the webserver port of pilight? There are two port settings in pilight settings.json: 

"webserver-port": 5001,
"port": 5000

The openHAB binding should connect to the 'port' setting, which is configured by the pilight:elro.port property in your openhab.cfg. When I tried connecting to the webserver port I got the same error you're getting. 

Regards,
Jeroen.

Sebastian Waitz

unread,
Jan 25, 2015, 7:41:55 AM1/25/15
to ope...@googlegroups.com
Hey Jeroen,
that was it. I mixed up the ports as I was unaware of the availability of 5001.
After fixing that and also adding the bandpass filter, everything works like charm now! Thanks much for your plugin!

I would have a small feature request: I've added a DHT11 temp/hum sensor to my Pi, and it can be read be Pilight easily.
Would it be possible to enhance your binding to also support number readings? Something like:

Number     Pi_Temperature_Sensor "DHT11 Temp."                   <temperature> (Temperature_Sensors) {pilight="elro#generic:temperature"}
Number     Pi_Humidity_Sensor        "DHT11 Hum."                   <temperature> (Temperature_Sensors) {pilight="elro#generic:temperature"}

The corresponding pilight config.json looks like:

        "temperature": {
            "name": "Temperatur",
            "protocol": [ "dht11" ],
            "id": [{
                "gpio": 7
            }],
            "device-decimals": 0,
            "temperature": 20,
            "humidity": 20,
            "poll-interval": 10
        }

Only thing I recognized is, that this will display temperature and humidity in Pilight in the same object. Ideally this needs to be split in OH to have dedicated number values for temp & humidity at hand.
Let me know, if I can be of any help to get this accomplished.
Thanks much
Sebastian

Jeroen Idserda

unread,
Jan 25, 2015, 7:48:09 AM1/25/15
to ope...@googlegroups.com
Hi Sebastian,

Glad you got it working! Number and String items are already supported in the latest nightly build of the binding. See the Wiki on my git repo on how to use these.

Regards,
Jeroen.

Sebastian Waitz

unread,
Jan 26, 2015, 3:46:47 PM1/26/15
to ope...@googlegroups.com
Hey,
thanks for the swift reply. I wasnt aware of the nightly build. Great progress.
I'm using the latest automated cloudbees build (https://openhab.ci.cloudbees.com/job/openHAB/) and the binding loads. However I do not see any values appearing in OH, but in Pilight everything seems to work fine.
I've switched to debug mode, but dont see an obvious error.
From the logs:
21:30:33.050 INFO  o.o.m.c.i.ModelRepositoryImpl[:97]- Refreshing model 'temperatur.items'
21:30:33.090 INFO  o.o.b.p.i.PilightGenericBindingProvider[:109]- pilight:elro item eg_Pi_Temperature_Sensor bound to device temperature in location generic, property temperature
21:30:33.097 INFO  o.o.b.p.i.PilightGenericBindingProvider[:109]- pilight:elro item eg_Pi_Humidity_Sensor bound to device temperature in location generic, property humidity
21:33:10.981 ERROR o.o.b.p.i.PilightListener[:100]- Error in pilight listener thread
java.io.IOException: Connection to pilight lost
        at org.openhab.binding.pilight.internal.PilightListener.run(PilightListener.java:90)
21:33:20.986 DEBUG o.o.b.p.i.PilightListener[:196]- pilight reconnecting
21:33:20.992 DEBUG o.o.b.p.i.PilightConnection[:140]- pilight response after client identification: {"message":"accept client"}
21:33:20.996 INFO  o.o.b.p.i.PilightListener[:198]- Established connection to pilight server at 192.168.23.11:5000

My config.json
        "generic": {
                "temperature": {
                        "name": "Temperatur",
                        "protocol": [ "dht11" ],
                        "id": [{
                                "gpio": 7
                        }],
                        "device-decimals": 0,
                        "temperature": 21,
                        "humidity": 34,
                        "poll-interval": 10
                }
       }

My OH item config:
Number eg_Pi_Temperature_Sensor "Pi Temperatur [%.1f °C]"   <temperature> (Temperature_Sensors) {pilight="elro#generic:temperature,property=temperature"}
Number eg_Pi_Humidity_Sensor "Pi Luftfeuchte [%.0f %%]"   <wind> (Humidity_Sensors) {pilight="elro#generic:temperature,property=humidity"}

Any idea how to analyze further?
Thanks much.
Seb


--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/K6W4x_KKA7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.

Jeroen Idserda

unread,
Jan 26, 2015, 4:23:28 PM1/26/15
to ope...@googlegroups.com
Hi Sebastian,

Your configuration looks good.. Are you sure you're not using an older or multiple versions of the binding? This debug message is not part of the latest build:

21:33:20.992 DEBUG o.o.b.p.i.PilightConnection[:140]- pilight response after client identification: {"message":"accept client"}

There is one error but that's probably because you restarted pilight, it reconnects after this just fine:

21:33:10.981 ERROR o.o.b.p.i.PilightListener[:100]- Error in pilight listener thread
java.io.IOException: Connection to pilight lost

Do the switches from pilight still work in openHAB? 

Regards,
Jeroen.

Sebastian Waitz

unread,
Jan 28, 2015, 3:10:22 PM1/28/15
to ope...@googlegroups.com
Hey Jeroen,
I've removed the 1.6.1 binding and replaced it with the one from cloudbees. Not sure if thats really the latest and greatest. But I can confim that its the only one I have active.
Indeed, I've tried restarting Pilight, as I wanted to see if that shows any additional output in debug mode. 
Now that you ask about the other switches, it seems that they stopped working as well. After restarting OH the switches do work again. And also the temp and humidity is populating now. Wired.
Once thing I noticed is the "device-decimal" setting that moves the colon. At first Pilight was reading 2,1 degrees but it was 21 degrees. I had to manually change the device-decimals from 1 to 0, that the numbers were correctly shown. Now in OH I have the same 2,1 degree shown. Seems like Pilight uses that parameter only for displaying and still helds the other value in memory.
Is this something you can address?
The DHT11 docu of pilight can be found here: http://wiki.pilight.org/doku.php/dht11
Seems like the commonly used DHT22 also has that device-decimal option available. http://wiki.pilight.org/doku.php/dht22
Thanks much.

Jeroen Idserda

unread,
Jan 30, 2015, 11:34:05 AM1/30/15
to ope...@googlegroups.com
Hi Sebastian,

The binding does use that property, but it was only moving the decimal point to the left :-). I've made a fix, there's a new build at this pull request.

Regards,
Jeroen. 

On Wednesday, January 28, 2015 at 9:10:22 PM UTC+1, Sebastian Waitz wrote:
Hey Jeroen,

Sebastian Waitz

unread,
Feb 1, 2015, 4:28:50 PM2/1/15
to ope...@googlegroups.com
Hey Jeroen,
But even after restarting Openhab nothing changes. Do I have to change something? Or did I grab the wrong binding?
Thanks much


--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/K6W4x_KKA7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.

Jeroen Idserda

unread,
Feb 2, 2015, 3:05:11 AM2/2/15
to ope...@googlegroups.com
Hey Sebastian,

That's strange.. You do have the correct build of the binding. Could you stop pilight and see what the configuration for the sensor looks like in config.json? What are the values for temperature and device-decimals?

Regards,
Jeroen.

On Sunday, February 1, 2015 at 10:28:50 PM UTC+1, Sebastian Waitz wrote:
Hey Jeroen,

Sebastian Waitz

unread,
Feb 2, 2015, 4:38:26 AM2/2/15
to ope...@googlegroups.com
Hey,
after stopping pilight the corresponding config.json looks like this:

"temperature": {
"name": "Temperatur",
"protocol": [ "dht11" ],
"id": [{
"gpio": 7
}],
"device-decimals": 0,
"temperature": 21,
"humidity": 34,
"poll-interval": 10
               }

These are also the values shown in Pilight web (21,0°C & 34,0%). While OH web sais 2,1°C and 3%.
Thanks for your support.
 


--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/K6W4x_KKA7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.

Jeroen Idserda

unread,
Feb 2, 2015, 4:45:03 AM2/2/15
to ope...@googlegroups.com
There's a new build at the pull request with a minor tweak, could you try it?

Jeroen.

Sebastian Waitz

unread,
Feb 2, 2015, 6:08:45 AM2/2/15
to ope...@googlegroups.com
Yeah,
that build works like charm. OH and Pilight now do have exactly the same values.
Thanks much for your swift support.


Sebastian Waitz

unread,
Feb 19, 2015, 8:56:58 AM2/19/15
to ope...@googlegroups.com
Hey Jeroen,
the pilight binding now works awsome. I just added a few zwave motion sensors to turn on/off lights controlled by pilight.
I just stumbeld upon a small thing. When I turn on a light and then restart openhab, the correct status is gone. Means, the switch in OH is off again while the light is still on.
I dont have this behavior with other bindings (e.g. Homematic). So is this something to be implemented in the binding? Like a polling interval ? Or when the binding starts, to query pilight for the actual status of a devive?
Any idea how to get the correct status after restarting OH or the binding?
Thanks much.
Seb


Jeroen Idserda

unread,
Feb 19, 2015, 9:07:47 AM2/19/15
to
Hi Seb,

This should be fixed in the latest nightly snapshot build of the binding.

Regards,
Jeroen.

Sebastian Waitz

unread,
Feb 19, 2015, 9:34:19 AM2/19/15
to ope...@googlegroups.com
OMG. Thats already the second time you fix issues before I can raise a ticket for them :-)
Awsome!
Will test the nightly and let you know.
Thanks much.


2015-02-19 15:07 GMT+01:00 Jeroen Idserda <jeroen....@gmail.com>:
Hi Seb,

This should be fixed in the latest nightly snapshot build of the bindings.

Regards,
Jeroen.

Sebastian Waitz

unread,
Feb 19, 2015, 5:00:12 PM2/19/15
to ope...@googlegroups.com
Hey,
I've tested the nightly and can confirm that it works fine now.
Thanks a ton.
Seb


2015-02-19 15:07 GMT+01:00 Jeroen Idserda <jeroen....@gmail.com>:
Hi Seb,

This should be fixed in the latest nightly snapshot build of the bindings.

Regards,
Jeroen.
Reply all
Reply to author
Forward
0 new messages