Home Assistant - Emoncms History

Hi folks,

I’m pushing a little data from HASS to OEM using the Emoncms History integration.

I can’t see in the documentation how you would push data to two different hosts.
I’m trying to push to my local emonHP Pi, as well as to the emoncms.org host.

Has anyone been able to do this please?
Example yaml below for a single connection, wondering if anyone has similar for 2x.

Thanks in advance!

# Example configuration.yaml entry
emoncms_history:
  api_key: YOUR_EMONCMS_WRITE_API_KEY
  url: https://emoncms.org
  inputnode: 19
  whitelist:
    - sensor.owm_temperature
    - sensor.owm_wind_speed
1 Like

Someone will hopefully correct me if I am wrong, but I think you would/could import to your local using the Home Assistant Emoncms History integration and then configure that local Emoncms to publish the input/feed to the cloud hosted instance.

Download or upload emoncms feed data between local and remote emoncms server’s (github.com)

@LeiChat - Thats a cracking idea - didn’t think of it at all, thank you!! :beer:

How did you get on? I suspect I have given bogus advice.

I added a couple of feeds in the local sync last night but looking at the cloud instance, they haven’t updated since I last clicked the “Upload” button.

Not so well sadly … I made the changes and saw my data flow to emoncms from my local host. I celebrated, and then realised a day later that it seemed to be a one time thing. I’m able to press the button and see the data push to the remote host again, my I’ve not found a permanent solution as yet … :crossed_fingers:t2:

1 Like

Hi. I think we need to amend the emonHub configuration to include the additional feeds.

emonHub Configuration File — OpenEnergyMonitor 0.0.1 documentation

The Sync tab in the web interface is a one time fire and forget.

To setup a periodic sync you’ll need to setup a cron tab (on the ssh interface) .

Use putty to connect to emonhp.local (or the ip address of your instance)
default username is pi and default password is on the paperwork that came with the unit.

then type

crontab -e

at the bottom of the file add the below line

*/5 * * * * php /opt/emoncms/modules/sync/sync_upload.php

This will upload the data to emoncms every 5 minutes.

Let me know if this helps :slight_smile:

@KnightPhoenix - works an absolute treat - thank you so much!
Have a lovely festive period and a happy new year! :christmas_tree::partying_face:

2 Likes

@KnightPhoenix I had it working for a while but think I’ve done something to bugger it up.

heatpump_targetT is synchronising OK but heatpump_dhw is missing data.

Cloud:

Local:

Cloud Feed with the ‘missing date’ checked

Last few days, I have been using the ‘Import data’ feature at the bottom of the Feeds to populate the missing data for the heatpump_dhw feed.

The light blue DHW graph shading doesn’t show in my local heatpump app, perhaps it’s running an older version than is on the cloud.

I do not seem to be missing data locally, it’s coming over from Home Assistant.

First thing to do is to go and check the schedule on the Cron job. This needs to be completed from ssh.

You can also check for any errors in the emoncms logs from the web interface.

Thank you. I tried a Full Update from the Admin > Update menu and that seems to have sorted everything. I can see the Space/DHW split in the app and the heatpump_dhw feed is synchronising in time with the others.

1 Like

Maybe I was wrong about that fixing the upload. There was no data for heatpump_dhw from 10am yesterday when I checked this morning. I’ve checked the crontab and that looks fine for the every five minutes schedule. The other three feeds (house_temperature, outdoor_temperature and heatpump_targetT) are still uploading fine.

Is it the emonHub.log I’m looking for issues in?
emonhub.log.txt (204.2 KB)

I’m able to grab the CSV data for heatpump_dhw from my local instance and use the “Import data” feature on emoncms.org to catch things up, but as you can see in the attached screenshot below, it’s not receiving/processing the heatpump_dhw since I did the manual upload at around 08:45.

EDIT: Just had a thought… the other three all have a ‘unit’ specified for the feed. But on my local instance and emoncms I do not have a unit specified for heatpump_dhw. Wasn’t sure what to select as it’s a boolean 1/0 value. Should I try “Other” ?

A post was split to a new topic: Sync Issues

Thanks for splitting it. Apologies to jamespreedy for any notifications.

1 Like

A quick related note to say that there is a new version of the sync module now available that does away with the crontab entry replacing it with a dedicated service that runs in the background alongside a more efficient upload process, release post available here: Emoncms Sync module v3.x.x

1 Like