Emoncms
The emoncms
sensor integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] creates sensors for the feeds available in your local or cloud based version of Emoncms
To enable this integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more], add the following lines to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file. It will list all feeds as a sensor.
After changing the configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file, restart Home Assistant to apply the changes. The integration is now shown on the integrations page under Settings > Devices & services. Its entities are listed on the integration card itself and on the Entities tab.
# Example configuration.yaml entry using cloud based Emoncms
sensor:
- platform: emoncms
api_key: API_KEY
url: https://emoncms.org
id: 1
As of Feb 2020, the integration will discover all sensors from Emoncms and will use the unit of measurement specified in the Feed from Emoncms, in preference to the one set in the configuration. Tested with Emoncmsunit
was added to the API around version V9.9.1.
To write information from Home Assistant to Emoncms, you can use the emoncms_history
integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more].
Configuration variables
Configuration Variables
The base URL of Emoncms, use https://emoncms.orghttp://x.x.x.x/emoncms
.
Positive integer identifier for the sensor. Must be unique if you specify multiple Emoncms sensors.
Positive integer list of Emoncms feed IDs. Only the feeds with feed IDs specified here will be displayed. Can not be specified if exclude_feed_id
is specified.
Positive integer list of Emoncms feed IDs. All the feeds will be displayed as sensors except the ones listed here. Can not be specified if include_only_feed_id
is specified.
Dictionary of names for the sensors created that are created based on feed ID. The dictionary consists of feedid: name
pairs. Sensors for feeds with their feed ID mentioned here will get the chosen name instead of the default name.
Default naming scheme
The names of the sensors created by this integration will use the feed names defined in Emoncms if available,
or the feed ID otherwise, and will be prefixed with “Emoncms”, e.g., “Emoncms Total Power” or “Emoncms Feed 5”.
If the id
property is anything but 1
, the ID will be shown as well, e.g., “Emoncms 2 Feed 5”.
If sensor_names
is used, any feeds with defined names will get those names exactly, with no prefix.
Examples
In this section you find some more examples of how this sensor can be used.
Minimal configuration. All feeds are added as sensors with the unit of measurement being set by the Emoncms Feed or the default unit.
sensor:
- platform: emoncms
api_key: API_KEY
url: https://emoncms.org
id: 1
Display only feeds with their feed IDs specified in include_only_feed_id
.
# Example configuration.yaml entry
sensor:
- platform: emoncms
api_key: API_KEY
url: https://emoncms.org
id: 1
unit_of_measurement: "W"
include_only_feed_id:
- 107
- 105
Display all feeds except feeds with their feed ID specified in exclude_feed_id
.
# Example configuration.yaml entry
sensor:
- platform: emoncms
api_key: API_KEY
url: https://emoncms.org
id: 1
unit_of_measurement: "kWh"
exclude_feed_id:
- 107
- 105
Display only feeds with their feed IDs specified in include_only_feed_id
and give the feed sensors a name using sensor_names
. You don’t have to specify all feeds names in sensor_names
, the remaining sensor names will be chosen based on id
and the Emoncms feedid
.
# Example configuration.yaml entry
sensor:
- platform: emoncms
api_key: API_KEY
url: https://emoncms.org
id: 1
unit_of_measurement: "kW"
include_only_feed_id:
- 5
- 120
sensor_names:
5: "feed 1"
48: "kWh feed"
61: "amp feed"
110: "watt feed"
Use a value_template
to add 1500 to the feed value for all specified feed IDs in include_feed_id
.
# Example configuration.yaml entry
sensor:
- platform: emoncms
api_key: API_KEY
url: https://emoncms.org
scan_interval: 15
id: 1
value_template: "{{ value | float + 1500 }}"
include_only_feed_id:
- 107
- 106
Display feeds from the same Emoncms instance with 2 groups of feeds, where one has a differing scan_interval
and the other a differing unit_of_measurement
.
# Example configuration.yaml entry
sensor:
- platform: emoncms
api_key: API_KEY
url: https://emoncms.org
scan_interval: 30
id: 1
unit_of_measurement: "W"
include_only_feed_id:
- 107
- 106
- platform: emoncms
api_key: API_KEY
url: https://emoncms.org
id: 2
scan_interval: 60
unit_of_measurement: "A"
include_only_feed_id:
- 108
- 61