# Update to node-red-nodes-emoncms node

**URL:** <https://community.openenergymonitor.org/t/update-to-node-red-nodes-emoncms-node/6097>\
**Category:** Emoncms\
**Tags:** nodered\
**Created:** [1 January 2018 19:37 UTC](https://community.openenergymonitor.org/t/update-to-node-red-nodes-emoncms-node/6097 "2018-01-01T19:37:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [1 January 2018 19:37 UTC](https://community.openenergymonitor.org/t/update-to-node-red-nodes-emoncms-node/6097/1 "2018-01-01T19:37:33Z")

</div>

Continuing the discussion from [MQTT JSON Input with timetamp](https://community.openenergymonitor.org/t/mqtt-json-input-with-timetamp/6082):

As the MQTT input currently does not support a time element, I decided to try the Emoncms Node-red node. I discovered it had not been updated to match the new input API so I have had a start at improving it. ~~You can find the 2 relevant files here~~. Simply overwrite the files in your modules folder and restart Node-red service. You will need to select a ‘data type’ in the node before using it.

My test environment is a little limited so if anyone wants to try this out for me feel free.

The key difference is that you need to select a data type of either legacy (which should behave as before), JSON, fulljson or CSV.

I have also made it such that you can (optionally) supply an ISO date and it will convert that to seconds.

There is now a status output from the push node so you can see if the server reports success. As I discovered this does not mean that data has been accepted, just that the server is OK!

If this node doesn’t work, please let me have an example URI you are trying to submit and I’ll check and see what is happening.

I am confident the full (or validated) JSON input works (as I am using it). I suspect the json one will not, but it is the same construct as before. However, I need this tested.

HTH

[Edit]  
I have [created a fork](https://github.com/borpin/node-red-nodes/tree/borpin-updates/io/emoncms) and opened a PR. If you want to test the updated node, please do. Just overwrite the js and html files in the node folder and restart node-red.

Feedback welcome on the [PR](https://github.com/node-red/node-red-nodes/pull/392).

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [7 January 2018 18:58 UTC](https://community.openenergymonitor.org/t/update-to-node-red-nodes-emoncms-node/6097/2 "2018-01-07T18:58:30Z")

</div>

The changes I proposed have been merged and the node updated.

> **[node-red-node-emoncms](https://www.npmjs.com/package/node-red-node-emoncms)**
>
> A Node-RED node to fetch/post data to/from emoncms

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [25 January 2021 21:32 UTC](https://community.openenergymonitor.org/t/update-to-node-red-nodes-emoncms-node/6097/3 "2021-01-25T21:32:53Z")

</div>

I have just created a PR to modify the `emoncms-in` node to return all the Feed data.

> <https://github.com/node-red/node-red-nodes/pull/743>
>
> \<!--
> \## Before you hit that Submit button....
> 
> Please read our \[contribution …guidelines\](https://github.com/node-red/node-red-nodes/blob/master/CONTRIBUTING.md)
> before submitting a pull-request.
> 
> \## Types of changes
> 
> What types of changes does your code introduce?
> Put an \`x\` in the boxes that apply
> \--\>
> 
> \- \[\] Bugfix (non-breaking change which fixes an issue)
> \- \[X\] New feature (non-breaking change which adds functionality)
> 
> \<!--
> If you want to raise a pull-request with a new feature, or a refactoring
> of existing code, it \*\*may well get rejected\*\* if it hasn't been discussed on
> the \[forum\](https://discourse.nodered.org) or
> \[slack team\](https://nodered.org/slack) first.
> 
> \--\>
> 
> \## Proposed changes
> 
> 
> The \`emoncms in\` node simply returned the last feed value. This change retains that but also makes the richer set of feed data available on a separate part of the message. Feature request https://community.openenergymonitor.org/t/emonpi-not-communicating-with-emoncms/16641/6
> 
> Instead of the topic being returned blank, the Feed name is returned as the topic.
> 
> This is a non-breaking change.
> 
> No other refactoring has been attempted.
> 
> I do not know what \`grunt\` is. No unit test required.
> 
> \## Checklist
> 
> 
> \- \[X\] I have read the \[contribution guidelines\](https://github.com/node-red/node-red-nodes/blob/master/CONTRIBUTING.md)
> \- \[X\] For non-bugfix PRs, I have discussed this change on the forum/slack team.
> \- \[\] I have run \`grunt\` to verify the unit tests pass
> \- \[\] I have added suitable unit tests to cover the new/changed functionality

As it returns it in a different part of the message, it is a non-breaking change.

Can’t believe it is 3 years since I did the first lots of mods!

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [8 February 2021 17:06 UTC](https://community.openenergymonitor.org/t/update-to-node-red-nodes-emoncms-node/6097/4 "2021-02-08T17:06:38Z")

</div>

The update has been merged and published - v0.3.0. It is a non-breaking change.

- The Topic is now the name of the Feed
- All the data for the Feed is returned as a `feed_data` element of the JSON

The message returned from the Feed is in the format:

```auto
{
	"_msgid": "7c6f5707.ca0ac8",
	"payload": 1941426,
	"topic": "Pulse-Wh",
	"rc": 200,
	"feed_data": {
		"id": "77",
		"userid": "1",
		"name": "Pulse-Wh",
		"datatype": "1",
		"tag": "3",
		"public": "0",
		"size": "",
		"engine": "5",
		"processList": "",
		"unit": "Wh",
		"time": 1612803769,
		"value": 1941426
	}
}

```
