Efergy Switch in HASS

2018-11-13 13:34:33 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform efergy
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/efergy.py”, line 71, in setup_platform
sid = sensor[‘sid’]

What flavour of HA are you running -
Hassio, Hassbian etc ? What version of Python are you running ?

Just tried a fresh token (the third new one that i’ve created for this) and it worked!! Thanks so much for your patience and effort. Now i will try to configure…

1 Like

Great news - don’t forget to get your groups working :wink:

I am getting Energy cost and Energy Consumed as unknown. Energy usage does come through though. Do I need top wait some days for these to populate?

Under Developer Tools press “states” 2nd from the left and go thourgh the list to see what is available - you may have a device id that needs to be added to the group to show up.

They show up in the group but as unknown like this:


And look like this in states:

Show me your sensor settings for Efergy ?

Here is mine again

- platform: efergy
  app_token: !secret efergy_token
  utc_offset: 0
  monitored_variables:
   #- type: instant_readings
   - type: budget
   - type: cost
     period: day
     currency: £
     #name: Day
   - type: cost
     period: week
     currency: £
   - type: cost
     period: month
     currency: £
   - type: amount
     period: day
   - type: amount
     period: month
   - type: current_values

Remember to highlight your settings first then press </> to get the formatting correct.

  - platform: efergy
    app_token: code
    utc_offset: UTC_OFFSET
    monitored_variables:
      - type: instant_readings
      - type: budget
      - type: cost
        period: day
        currency: £
      - type: amount
        period: day
      - type: current_values

Don’t really know what i’m doing…

I have changed your spacing to match mine and added the utc offset for the UK. Try this

- platform: efergy
  app_token: code
  utc_offset: 0
  monitored_variables:
   - type: instant_readings
   - type: budget
   - type: cost
     period: day
     currency: £
   - type: amount
     period: day
   - type: current_values

Appreciate your efforts but i think i’m making a pig’s ear of this. I am totally unfamiliar with HA. That reformatting had no affect. I do have two badges called efergy_734053 & Per-Device Usage sitting there amongst the other badges.

Does the checker throw any errors ?

Do these new sensors show any data ?

I have to get ready for work so will not respond for a few hours.

Yes - one does, the efergy_734053 seems to be a current consumption reading. The other does not. Config checker shows No errors.

If you put this into a browser with your API key added do you get any data ?

http://www.energyhive.com/mobile_proxy/getInstant?token=MY-API-KEY&period=day&offset=0

I get this

{“age”:2,“last_reading_time”:1542399810000,“reading”:2475}

I get:
{“age”:4,“last_reading_time”:1542409074000,“reading”:1282}

I must have something wrong in one of the groups, sensors or customize files…

Whatever shows up under states can be added to the group view as that is the live data that you can use.

Can you share a screenshot of your state page ? Here is mine -

efergy

The sensor.efergy is tracking the MAC address via known_devices.yaml as is not part of the API.

Thanks so much for your help again, you are a proper star!
By sheer coincide all entities are now reporting. It’s like it needed time to kick in.
For your info here’s my states:
latest

1 Like

Just thinking through your last comment… You are able to calculate cost based on a mac address? Therefore assuming I have Mac address of my electric car I can see what it costs to charge? That would be awesome! Also is there a way to recalculate costs based on a separate day/night tariff which Efergy don’t appear to support.

Great news David - glad we got there in the end.