I recently installed HA and pricked up the EMU 2. I followed the instructions on the Git feed to install and configure but i’m getting an error in my log. Not sure if my serial port is bad or if I do not have the "rainforest’ integration setup proper. Here is the log error:
Logger: homeassistant.components.websocket_api.http.connection
Source: components/hassio/init.py:599
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 5:08:23 PM (12 occurrences)
Last logged: 5:39:27 PM
[140685815848672] The system cannot restart because the configuration is not valid: Platform error sensor.rainforest - Integration ‘rainforest’ not found.
[140685722211952] The system cannot restart because the configuration is not valid: Platform error sensor.rainforest - Integration ‘rainforest’ not found.
Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 185, in handle_call_service await hass.services.async_call( File “/usr/src/homeassistant/homeassistant/core.py”, line 1495, in async_call task.result() File “/usr/src/homeassistant/homeassistant/core.py”, line 1530, in _execute_service await handler.job.target(service_call) File “/usr/src/homeassistant/homeassistant/components/hassio/init.py”, line 599, in async_handle_core_service raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Platform error sensor.rainforest - Integration ‘rainforest’ not found.
I think your problem stems from an update in HA. (Ive had the same issue.) I brought it up with the Devs on discord, but i seem to have fallen on deaf ears.
Anyway, the post 2 below yours is what I used to fix mine and allow me to add my meter to my consumption (it has something to do with output being kW vs Kwh)
I just got my EMU-2 from PSE, and for a brief moment I was able to get Home Assistant to load the rainforest integration, but now whenever I try to restart HA I get:
Reinstalled the Rainforest component via HACS a few times
Removed the batteries (per this forum)
Replaced the USB cable (but it still shows as connected when I check the hardware)
Restarted Home Assistant multiple times.
Good to see another Puget Sounder here. Just got mine yesterday and integrated with Home Assistant today using the same method. Waiting for the Energy dashboard to update now.
Mine just started updating, though I don’t yet have the $$ per KWh. Not sure if that is a feature that still needs to be added. Though, I don’t see $$/KWh on the device itself either, so I guess they are working on that as we are the beta testers.
Was curious about the power price on mine as well. In Home Assistant i just figured out the rate and put that in as a static value. PSE upgraded my gas meter rececntly to Zigbee as well. Wonder if theyll expand EMU2 to support gas consumption as well.
Has anyone gotten this work properly via the HASS container?
I have installed the alternative HACS integration along with the recommended configuration.yaml components. I left off sections about power put back into the grid as I’m only consuming, not returning power from the grid. I have the device connected to a Mac Mini running Ubuntu and Home Assistant 2021.12.8 in a Docker container.
I also am passing the tty device into my container by id to prevent it moving around on me:
However, I do not seem to be receiving data properly. When I cat the device inside the container, I only very sporadically am able to see any xml content and the sensors do not seem to be updating inside of Home Assistant.
No errors are being output in either the docker or home assistant logs. I am also one of the newer people to have received the EMU-2 through PSE.
I’m happy to try anything and everything to get this working!
Update: FWIW, I added debug logging to the rainforest custom_component and while I can see it starting the loop, it never receives any data to then process
Then I get a sensor.emu2 with current usage as the state and a bunch of attributes. The current usage populates right away, but the attributes take some time.
Asking the stupid question, are you sure it reads your meter from where your server is? Just asking because mine is in a closet in the center of the house. I’m actually surprised it reads my meter OK in that location, but it does work.
Thanks @gregg098 - the privileged mode was my problem! I’m not sure why passing the device in wasn’t working, but I’m now getting data in completely as expected.
Unfortunately I did have to switch to specifying the device by name (eg: /dev/ttyACM1) as the serial/by-id directory is not exposed to docker containers.
I’m not using docker compose, but rather just directly starting it from docker which also auto-restarts in case the host restarts. If others are interested, here’s my command string.
@gregg098@Mr_Flibble Have you figured out pricing data? I know I can set a static price in the Energy section of Home Assistant, however that doesn’t take into account the tiered pricing model. I currently just statically set it at 0.1 but I’d like to see something more accurate. The EMU-2 display does show pricing per kwh, but it doesn’t seem to be exposed in the XML.
No. Those values all read “null” in Home Assistant. Honestly I dont think it read anything on the EMU2 last I looked. Its buried in a closet right now where my Home Automation stuff is. I just did fixed price. Last power bill / total kWh from bill.
Been doing some troubleshooting here and noticed that the device seems to bounce around between ttyACM0 and ttyACM1. This could explain some of the ‘cable’ issues people have been commenting on. I have three cables and it hasn’t truly seemed to matter, so long as they are not charge only cables.
Not sure how to ensure the device will come up consistently when it can come up as one or the other. I am guessing that the device does a connect, disconnect, and reconnect while starting and because there is enough capacitance to hold through momentary disconnect, it get seen as another new device to be registered.
Just thoughts. I am still very new to raspberry and HA.
I’d presume the problem there is that the Pi can’t consistently supply enough power for the device, so it intermittently looses power. Perhaps use batteries in it to act as a UPS? Several of us have it plugged into something more powerful (I’m using a Mac Mini running Ubuntu) that is capable of supplying more power to the USB ports than a typical Pi can.
Consider that the USB power adapter supplied by Rainforest outputs 1A of power and the Pi is typically limited to 1.2A max for ALL USB ports (depending on how the Pi is being powered). That very quickly decreases available power to the EMU-2.
I am running Home Assistant Blue (Odroid). I just got my EMU-2 in the mail today, and I got everything hooked up to the point where I had an entity showing real time kWh in history, but after about 30 minutes the data stopped. I was playing with the configuration to try and get the device to show up in the energy dashboard, but I kept getting the “No Matching Statistics” error. Now my entity no longer shows data. I got my configuration from one of the comments on this thread, but it didn’t seem to work.
I see 2 sets of messages that seem to be a problem:
ERROR (Thread-3) [root] Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/config/custom_components/rainforest/sensor.py", line 140, in serial_read
if msgStr != [] and msgStr[0] == '<':
IndexError: string index out of range
AND
ERROR (MainThread) [homeassistant.components.utility_meter.sensor] Could not restore state <unknown>. Resetting utility_meter.Grid Energy Consumed
ERROR (MainThread) [homeassistant.components.utility_meter.sensor] Could not restore state <unknown>. Resetting utility_meter.Grid Energy Returned
I can also see the output XML when I type cat /dev/ttyACM0. Any help or suggestions to try and get things back up and running?
However, the Units on the entity are in kW, and it appears my template for sensor.grid_energy_delivered and utility_meter.get_energy_consumed must have some problem because they can’t be added to the Energy dashboard.