• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
config device #1 "living", missing protocol
#1
Hello,
I'm starting with pilight.
I've run pilight-receive and I received my neighboor temperature device as follow :


Code:
{
        "message": {
                "id": 227,
                "temperature": 2.61,
                "humidity": 93.00,
                "battery": 1,
                "channel": 1
        },
        "origin": "receiver",
        "protocol": "tfa",
        "uuid": "0000-b8-27-eb-c15c94",
        "repeats": 4
}

So I would like to add this as a new device.

In the conf.json I've added :


Code:
"devices": {
  "living": {
  "name": "Living",
  "weather": {
       "name": "Weather",
    "protocol": ["tfa"],
    "id": [{
    "id": 227,
    "channel": 1
  }],
  "temperature": 189,
  "humidity": 410,
  "battery": 1
  }
}
}


But I have the following error (in /var/log/pilight.err) when I run pilight service:

[Nov 08 00:18:18:225149] pilight-daemon: ERROR: config device #1 "living", missing protocol

What's wrong ?
Thanks in advance.
 
Reply
#2
First, please edit your post according to the forum rules, like using code tags for readability.

Second, see the wiki for the correct syntax of your devices. Your current config looks definitely wrong.
 
Reply
#3
(11-08-2016, 01:44 PM)Niek Wrote: First, please edit your post according to the forum rules, like using code tags for readability.

Second, see the wiki for the correct syntax of your devices. Your current config looks definitely wrong.
Ok sorry for that I'm new here.
Thanks for your response anyway.
I've read the wiki for tfa and copied/paste the config in the conf.json.
Should I insert it in "devices" or as a new json entry ?
 
Reply
#4
The string "device" was a bug in the WIKI, I have updated it.
 
Reply
#5
Yes every device must be entered in the "devices" section as described here

It seems that you tried to enter a device called "living", without specifying a protocol and its options. You also entered two lines with "name" that aren't valid protocol options at all.
 
Reply
#6
Thanks a lot for your help, I finally got it work and I can see my device values in the GUI
Now I'm trying to send curl request to pilight-daemon 
Here is my settings config :

Code:
"settings": {
                "log-level": 6,
                "pid-file": "/var/run/pilight.pid",
                "log-file": "/var/log/pilight.log",
                "webserver-enable": 1,
                "webserver-root": "/usr/local/share/pilight/",
                "webserver-http-port": 5001,
                "webserver-cache": 1,
                "port": 5000
        }


But when I execute :


Code:
curl -s -H "Content-Type: application/json" -X POST -d '{"action": "identify"}'  http://127.0.0.1:5000

I got an HTML response saying that "The pilight webgui is located at 127.0.0.1:5001"
Sure I'm doing something wrong but again I don't know where.
The pilight logs says :

Code:
[Nov 08 23:01:57:498819] pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 58620
Seems that port is changing.

Doing that :

Code:
curl --local-port 5000  -H "Content-Type: application/json" -X POST -d '{"action": "identify"}' http://127.0.0.1

It says
Code:
Address already in use

My final goal is to be able to use domoticz to make periodical request to pilight-daemon to get the temperature.

EDIT: Ok I saw a similar thread (https://forum.pilight.org/Thread-pilight...-html-pagethat explains why it doesn't work.

I used 

Code:
echo {\"action\": \"identify\"} | nc 127.0.0.1 5000

and it finally worked
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Compile with Optimization fails / timedate missing fourty2 6 410 04-29-2019, 12:27 PM
Last Post: fourty2
  Protocol Program PID AdHoc-Client Bigmama 12 875 01-26-2019, 07:36 PM
Last Post: Bigmama
  Config migration from pilight 7 .0 to 8.1.3 "Rules" Nonaamee 4 834 11-17-2018, 08:35 PM
Last Post: Nonaamee
Exclamation pilight detect wrong protocol quigg_gt9000 is not quigg_gt1000 PCT 1 857 08-12-2018, 11:13 AM
Last Post: Niek
  need some help with program protocol charlesjacob4695 1 447 05-15-2018, 05:58 PM
Last Post: curlymo
  problem with alecto_wx500 protocol (pilight V7) TheWheel 18 5,453 04-12-2018, 06:38 PM
Last Post: NevelS
  deleyCON remote plug socket (arctec_screen_old protocol) itsMe 6 1,184 04-01-2018, 08:35 PM
Last Post: itsMe
  Problem with Protocol gpio_switch engel035 15 3,022 03-19-2018, 06:46 PM
Last Post: curlymo
  arctech_contact protocol missing open/close signals Niek 2 638 12-23-2017, 07:16 PM
Last Post: Niek
  Extend generic protocol mickey.lm 6 1,126 11-20-2017, 10:51 PM
Last Post: mickey.lm

Forum Jump:


Browsing: 1 Guest(s)