Sending sensor value from HomeAssistant to emoncms

I have a Switchbot outdoor thermometer (and OpenWeatherMap integration) in Home Assistant. What’s the simplest way to pass the temperature value from one of those over to my emonHP/Emoncms, please?

I dont know.

You can use the emoncms integration to do this (configure in YAML), the mqttstatestream integration, an automation to post the state to MQTT, or use the Node-RED add-on and post to MQTT that way.

Just depends what else you have used/done before which is the simplest to you.

All it needs is for the MQTT base topic to be emon.

Thank you. I found the integration for pushing values from HA… Emoncms History - Home Assistant (home-assistant.io)

2 Likes

How do I find/select a “dedicated, not used before” inputnode, please?

On the Emoncms Inputs page, if I click each of the “log” icons it displays a graph and the URL has an integer. e.g. /graph/11
They appear to currently range from 10 to 19.
The two “kWh” ones I have added are assigned 21 and 22.

Is it important to select the next available integer or could I opt to start imported inputs from a higher range? e.g. 201, 202, etc.

EDIT: Just spotted the API help… Emoncms - input api

The node parameter can be an unquoted string e.g: emontx or a number e.g: 10.

Home Assistant seems to insist on an integer. I have tried a string with single and double quotes.

Initially opted for an integer which worked fine, but thought I would amend it to make the grouping label in Emoncms more obvious.

The integration needs some updates, but that is a bit tricky.

It was written before node IDs could be text so it expects an integer.

2 Likes

Just to add to this thread, is there a way to export the feed to two different systems via the integration?, I have a local heat pump monitor and an account on emoncms.org and ideally would love to send the data to both if possible.

That might be the Sync pages? http://LOCAL-IP/sync/view/feeds

I believe mine is pre-configured to upload to an emoncms instance that I don’t yet have access to, due to my installer ordering the bundle and supplying his account credentials, but I don’t see where in my local instance of emoncms the configuration to send to that instance exists.

Just to note, the HA integration has had significant updates since this post, so this post is no longer valid as an answer to the question.

I have removed the ‘solution’ tag.

My YAML config for the Emoncms History integration appears to match what shows on the HA website. Are there any changes I need to be aware of? Or a better alternative to using that integration?

emoncms_history:
   api_key: *API-KEY*
   url: http://192.168.XX.XXX/emoncms
   inputnode: 301
   scan_interval: 30
   whitelist:
   - sensor.temp_sensors_house
   - sensor.meterswitchbot_outdoor_temperature
   - sensor.ashp_zone_zone1_circuit_0_desired_temperature
   - binary_sensor.airsourceheatpump_dhw

I think there was a little under the hood on the History one. I was actually thinking more of the incoming integration that got a full UI makeover.