Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Emonpi not communicating with emoncms

Tags: #<Tag:0x00007fe7a47e7c80> #<Tag:0x00007fe7a47e7ac8>

Hi,

I have copied the rw api key from emoncms.org (https://emoncms.org/input/api) to my emonhub (http://192.168.1.7/config). This has saved correctly.

I believe I should then be able to log into emoncms.org and see my inputs and feeds automatically, but they don’t appear.

I have the following in the emonpi log:

2021-01-24 09:51:41,073 INFO emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1611469940.193608,5,245,0,245,230,0,0,0,0,0,0,0],[1611469944.5306401,5,244,0,244,230,0,0,0,0,0,0,0],[1611481025.426438,5,246,0,246,230,0,0,0,0,0,0,0],[1611481030.4650733,5,243,0,243,230,0,0,0,0,0,0,0],[1611481035.5095458,5,242,0,242,230,0,0,0,0,0,0,0],[1611481040.4494622,5,242,0,242,230,0,0,0,0,0,0,0],[1611481045.4983194,5,243,0,243,230,0,0,0,0,0,0,0],[1611481050.4365609,5,243,0,243,230,0,0,0,0,0,0,0],[1611481055.4743564,5,246,0,246,230,0,0,0,0,0,0,0],[1611481060.5150332,5,241,0,241,230,0,0,0,0,0,0,0],[1611481065.453034,5,242,0,242,230,0,0,0,0,0,0,0],[1611481070.4899323,5,243,0,243,230,0,0,0,0,0,0,0],[1611481075.442283,5,241,0,241,230,0,0,0,0,0,0,0],[1611481080.4811487,5,244,0,244,230,0,0,0,0,0,0,0],[1611481085.5195827,5,240,0,240,230,0,0,0,0,0,0,0],[1611481090.4626942,5,241,0,241,230,0,0,0,0,0,0,0],[1611481095.4994106,5,240,0,240,230,0,0,0,0,0,0,0],[1611481100.435317,5,240,0,240,230,0,0,0,0,0,0,0],[1611481105.4754152,5,241,0,241,230,0,0,0,0,0,0,0],[1611481110.5133724,5,244,0,244,230,0,0,0,0,0,0,0],[1611481115.4600916,5,239,0,239,230,0,0,0,0,0,0,0],[1611481120.4924057,5,239,0,239,230,0,0,0,0,0,0,0],[1611481125.53552,5,239,0,239,230,0,0,0,0,0,0,0],[1611481130.479508,5,240,0,240,230,0,0,0,0,0,0,0],[1611481135.5187094,5,240,0,240,230,0,0,0,0,0,0,0],[1611481140.4577444,5,244,0,244,230,0,0,0,0,0,0,0],[1611481145.4941077,5,241,0,241,230,0,0,0,0,0,0,0],[1611481150.5582979,5,241,0,241,230,0,0,0,0,0,0,0],[1611481155.5034275,5,241,0,241,230,0,0,0,0,0,0,0],[1611481160.5429406,5,240,0,240,230,0,0,0,0,0,0,0],[1611481165.4935505,5,244,0,244,230,0,0,0,0,0,0,0],[1611481170.5422957,5,239,0,239,230,0,0,0,0,0,0,0],[1611481175.4818861,5,242,0,242,230,0,0,0,0,0,0,0],[1611481180.5293443,5,243,0,243,230,0,0,0,0,0,0,0],[1611481185.4779205,5,246,0,246,230,0,0,0,0,0,0,0],[1611481190.527688,5,257,0,257,230,0,0,0,0,0,0,0],[1611481195.4780173,5,260,0,260,230,0,0,0,0,0,0,0],[1611481200.5144114,5,256,0,256,230,0,0,0,0,0,0,0],[1611481205.5689607,5,253,0,253,230,0,0,0,0,0,0,0],[1611481210.5333776,5,290,0,290,230,0,0,0,0,0,0,0],[1611481215.470536,5,286,0,286,230,0,0,0,0,0,0,0],[1611481220.5119617,5,285,0,285,230,0,0,0,0,0,0,0],[1611481225.551496,5,287,0,287,230,0,0,0,0,0,0,0],[1611481230.4937248,5,275,0,275,230,0,0,0,0,0,0,0],[1611481235.5296667,5,270,0,270,230,0,0,0,0,0,0,0],[1611481240.4785907,5,271,0,271,230,0,0,0,0,0,0,0],[1611481245.516129,5,272,0,272,230,0,0,0,0,0,0,0],[1611481250.5577815,5,273,0,273,230,0,0,0,0,0,0,0],[1611481255.5056918,5,272,0,272,230,0,0,0,0,0,0,0],[1611481260.5422823,5,273,0,273,230,0,0,0,0,0,0,0],[1611481265.5781765,5,270,0,270,230,0,0,0,0,0,0,0],[1611481270.5166454,5,272,0,272,230,0,0,0,0,0,0,0],[1611481275.551481,5,270,0,270,230,0,0,0,0,0,0,0],[1611481280.4941127,5,277,0,277,230,0,0,0,0,0,0,0],[1611481285.5300038,5,271,0,271,230,0,0,0,0,0,0,0],[1611481290.5683022,5,271,0,271,230,0,0,0,0,0,0,0],[1611481295.5146601,5,273,0,273,230,0,0,0,0,0,0,0],[1611481300.5582864,5,275,0,275,230,0,0,0,0,0,0,0],[1611481305.5025768,5,274,0,274,230,0,0,0,0,0,0,0],[1611481310.5414195,5,279,0,279,230,0,0,0,0,0,0,0],[1611481315.518056,5,277,0,277,230,0,0,0,0,0,0,0],[1611481320.562785,5,275,0,275,230,0,0,0,0,0,0,0],[1611481325.5140188,5,278,0,278,230,0,0,0,0,0,0,0],[1611481330.564375,5,276,0,276,230,0,0,0,0,0,0,0],[1611481335.503318,5,274,0,274,230,0,0,0,0,0,0,0],[1611481340.549722,5,280,0,280,230,0,0,0,0,0,0,0],[1611481345.5084846,5,274,0,274,230,0,0,0,0,0,0,0],[1611481350.557275,5,274,0,274,230,0,0,0,0,0,0,0],[1611481355.4950838,5,277,0,277,230,0,0,0,0,0,0,0],[1611481360.5364158,5,278,0,278,230,0,0,0,0,0,0,0],[1611481365.4931164,5,280,0,280,230,0,0,0,0,0,0,0],[1611481370.5321105,5,278,0,278,230,0,0,0,0,0,0,0],[1611481375.573994,5,281,0,281,230,0,0,0,0,0,0,0],[1611481380.5170245,5,279,0,279,230,0,0,0,0,0,0,0],[1611481385.559954,5,279,0,279,230,0,0,0,0,0,0,0],[1611481390.4972305,5,287,0,287,230,0,0,0,0,0,0,0],[1611481395.5262306,5,287,0,287,230,0,0,0,0,0,0,0],[1611481400.5656807,5,285,0,285,230,0,0,0,0,0,0,0],[1611481405.5077674,5,274,0,274,230,0,0,0,0,0,0,0],[1611481410.5572972,5,276,0,276,230,0,0,0,0,0,0,0],[1611481415.500992,5,275,0,275,230,0,0,0,0,0,0,0],[1611481420.541241,5,276,0,276,230,0,0,0,0,0,0,0],[1611481425.5839922,5,280,0,280,230,0,0,0,0,0,0,0],[1611481430.5136232,5,277,0,277,230,0,0,0,0,0,0,0],[1611481435.5509863,5,278,0,278,230,0,0,0,0,0,0,0],[1611481440.507305,5,281,0,281,230,0,0,0,0,0,0,0],[1611481445.5444572,5,275,0,275,230,0,0,0,0,0,0,0],[1611481450.5891588,5,277,0,277,230,0,0,0,0,0,0,0],[1611481455.568696,5,279,0,279,230,0,0,0,0,0,0,0],[1611481460.616359,5,278,0,278,230,0,0,0,0,0,0,0],[1611481465.5628731,5,277,0,277,230,0,0,0,0,0,0,0],[1611481470.56279,5,273,0,273,230,0,0,0,0,0,0,0],[1611481475.5946426,5,275,0,275,230,0,0,0,0,0,0,0],[1611481480.536372,5,275,0,275,230,0,0,0,0,0,0,0],[1611481485.5748827,5,279,0,279,230,0,0,0,0,0,0,0],[1611481490.6109097,5,276,0,276,230,0,0,0,0,0,0,0],[1611481495.5540268,5,273,0,273,230,0,0,0,0,0,0,0],[1611481500.589101,5,276,0,276,230,0,0,0,0,0,0,0],[1611481505.535307,5,275,0,275,230,0,0,0,0,0,0,0],[1611481510.5878801,5,274,0,274,230,0,0,0,0,0,0,0]]&sentat=1611481901
2021-01-24 09:51:41,269 WARNING emoncmsorg send failure: wanted ‘ok’ but got ‘’
2021-01-24 09:51:45,658 DEBUG RFM2Pi 179 NEW FRAME : OK 5 21 1 0 0 21 1 216 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (-0)
2021-01-24 09:51:45,660 DEBUG RFM2Pi 179 Timestamp : 1611481905.658138
2021-01-24 09:51:45,661 DEBUG RFM2Pi 179 From Node : 5
2021-01-24 09:51:45,662 DEBUG RFM2Pi 179 Values : [277, 0, 277, 230, 0, 0, 0, 0, 0, 0, 0]
2021-01-24 09:51:45,662 DEBUG RFM2Pi 179 Sent to channel(start)’ : ToEmonCMS
2021-01-24 09:51:45,663 DEBUG RFM2Pi 179 Sent to channel(end)’ : ToEmonCMS

I do seem to be getting data from emonpi, but under ‘5’, not ‘emonpi’

To be clear, emoncms.org is different to your local emoncms and will have a different API key.

Thanks Brian. Its working using the API key from emoncms.org, which I then add to the config in emonhub. I’m getting payload data from emoncms into mysql. The problem I now have is I would like to have some sort of tag for that line item, but can only pull the payload through and nothing else

I’m not sure what you are doing or what you are asking.

i’m trying to ask if its possible to get more than just the payload data (feed value) from emoncms when using the node-red-emoncms. It appears to just give you the kWh value (from use_kWh feed), but I would also like the name of the feed for example so that I can use this as a reference in my SQL table for that particular location.

Thanks for taking the time to try and help me. I hope this makes more sense

Currently no. The nod-red node just returns the value of the Feed. It could return more.

Thanks Brian. I’ll see if i can get a combination of MQTT and node-red-emoncms feeds into the db.

Not sure what your skill level is, but how is your javascript?

The API call http://IPADDRESS/feed/aget.json?id=77 gives more data

{
	"id": "77",
	"userid": "1",
	"name": "Pulse-Wh",
	"datatype": "1",
	"tag": "3",
	"public": "0",
	"size": "",
	"engine": "5",
	"processList": "",
	"unit": "Wh",
	"time": 1611569777,
	"value": 438690
}

The Node could be modified (or a new node added) to get all data fields and return the other bits as well.

Thanks Brian. I’ll see if I can figure this out. My skill level is pretty close to zero, but i generally get there with a bit of trial and error (and a very generous community of people posting their experiences).

If I get a chance I’ll have a look at it.

My approach would be to offer an option within the node to return all data fields, by default just return the data (so backward compatible).

Just then need to change the url and parse the data field else return the whole JSON.

Thanks Brian. I’m trying the following to pull through from emoncms (obviously missing something quite fundamental though)

http request node with url https://emoncms.org/feed/aget.json?id=429752. This works on my browser, but not in node-red. It says “{“success”:false,“message”:“406 Not Acceptable. Route not found”}”. Is this because i haven’t entered an api key in the URL?.

I’m thinking if i can get this information then i can use the JSON node to get the detail i want to send to MySQL

I added my API key https://emoncms.org/feed/aget.json?id=429752&APIKEY=apikey from emoncms.org, but got the same error

I have added the feature to the node and submitted a PR for it to be included.

try this - put the API key here.

image

That worked! I now get all api feed data from emoncms. Next step is to separate out parts I need.

Thank you very much for your help with this Brian. I really appreciate you taking the time to look into this.

1 Like

I’ve managed to get name and value from the api into my server database.

Thanks again @borpin for your help

The emoncms node has been updated to return all data from the Feed.