Troubles setting up EMONCMS local

emoncns sensor not working with my local installation - I’m not using the cloud store for data

not sure on the exact syntax of the url as it’s not documented… this does not work…
sensors.yaml (called from configuration.yaml)

- platform: emoncms
  api_key: !secret emon_write_key
  url: http://10.0.26.11/emoncms
  id: 1
  unit_of_measurement: "W"

traceback when HA starts with above config

2018-06-15 18:29:59 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform emoncms
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/sensor/emoncms.py", line 104, in setup_platform
    elem))
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/sensor/emoncms.py", line 137, in __init__
    self._state = round(float(elem["value"]), DECIMALS)
TypeError: float() argument must be a string or a number, not 'NoneType'

Ideas anyone?
Thanks

@joyrider3774 any chance you can help? Thanks

@reynos I have not touched / updated home assistant / emoncms for over a year so not sure what all has changed it still works fine in my old version. However looking at the error and the current code my guess is one of your feeds in emoncms does not have a value yet.

You could try and see if it works if you specify the feedid’s of the feeds that you want to use and make sure in emoncms the feeds you wanna use contains at least one value

- platform: emoncms
    api_key: ....
    url: http://127.0.0.1:8083/emoncmsnew
    id: 1
    unit_of_measurement: "W" 
    include_only_feed_id:
      - 61
      - 110
      - 116
      - 120
      - 5
      - 18
      - 29
      - 48
      - 160
      - 154
      - 158
      - 164
      - 166
      - 168

or use exclude_feed_id to not use the feeds that have no values yet

- platform: emoncms
    api_key: ....
    url: http://127.0.0.1:8083/emoncmsnew
    id: 1
    unit_of_measurement: "W" 
    exclude_feed_id:
      - 61
      - 110

if you want to find out which feed is not having a value you could use http://10.0.26.11/emoncms/feed/list.json?apikey=yourapikeyhere and check the for feeds (id’s) where there is no “value” key pair. It might also be visible in the feed list on emoncms but not sure how it would display

Thanks so much for the ideas, will check.

It certainly was to do with a feed that had a NULL value. I specified exactly which feeds to use and it loaded fine, thanks.

All - Thanks a lot for this solution !