Giter Site home page Giter Site logo

Comments (18)

mikedm139 avatar mikedm139 commented on June 8, 2024 1

Looks like the master branch fix is working for my install. I’ll update if it errors out.
Thanks!

from ha-emporia-vue.

skynet01 avatar skynet01 commented on June 8, 2024 1

i have the same issue where all my 1 minute and 1 second sensor values stopped working. The only one that works is the main whole home value.

from ha-emporia-vue.

magico13 avatar magico13 commented on June 8, 2024

Interesting. The VueGraf application that also uses the PyEmVue library also had an issue like this with a weird "MainsFromGrid" channel. I'll likely need to add something to ignore that since it doesn't seem to behave like other devices/channels.

from ha-emporia-vue.

Zyell avatar Zyell commented on June 8, 2024

@magico13 Thanks for the quick response! So it sounds like the homeassistant upgrade wasn't an issue, which is good. I ended up querying directly with the PyEmVue library to investigate. This new channel may actually be very useful for those of us with Solar. I had actually setup an automation to calculate the data it looks like this channel is returning. Currently, the mains returns a total value of power going to or coming from the grid. I have to remove the solar contribution to get my total consumption. However, I also wanted to know how much energy I'm pulling from the grid over a given day to compare to my utility's calculation (so far the vue data has been very well aligned with the utility). It looks like MainsFromGrid and MainsToGrid give me the data I need without any additional calculation. :-) This is just from my preliminary investigation. Would it be possible to handle these channels?

from ha-emporia-vue.

Zyell avatar Zyell commented on June 8, 2024

It looks like they only return for queries on the Day scale, not Minute or Second.

from ha-emporia-vue.

magico13 avatar magico13 commented on June 8, 2024

I don't have solar yet so I haven't seen those new values. Maybe I can say in the app that I do just to see if those start populating. If so I should be able to add them as additional sensors with the appropriate scales. I'll try to look into this tonight if my second covid shot hasn't knocked me out too much.

from ha-emporia-vue.

Zyell avatar Zyell commented on June 8, 2024

Sounds good! I have created a hackish workaround for the time being, but hit another unrelated issue that corrupted my pre-upgrade snapshot unfortunately... so trying to fix the database.

Good luck with your second shot! Hopefully you won't have any issues.

from ha-emporia-vue.

mikedm139 avatar mikedm139 commented on June 8, 2024

Adding my notes for tracking purposes in case they're helpful.

My Emporia integration has been offline for the last week or so. I have restarted HA several times, reloaded the integration, updated HA (currently running core-2021.5.0) without improvement. Below is the log lines that are generated.

2021-05-06 07:39:21 WARNING (MainThread) [custom_components.emporia_vue.sensor] No channels found during update
2021-05-06 07:39:21 WARNING (MainThread) [custom_components.emporia_vue.sensor] No channels found during update
2021-05-06 07:39:22 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in async_add_entities
tasks = [
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in <listcomp>
tasks = [
File "/config/custom_components/emporia_vue/sensor.py", line 128, in <genexpr>
CurrentVuePowerSensor(coordinator_1min, id)
File "/config/custom_components/emporia_vue/sensor.py", line 171, in __init__
if self._channel is None:
AttributeError: 'CurrentVuePowerSensor' object has no attribute '_channel'

Based on the discussion in #33, I reinstalled the integration using the master branch. The problem remains but more information was included in the logging:

2021-05-06 10:00:31 WARNING (MainThread) [custom_components.emporia_vue] 1min Update data: {'14681-1,2,3-1MIN': {'device_gid': 14681, 'channel_num': '1,2,3', 'usage': 755, 'scale': '1MIN', 'info': <pyemvue.device.VueDevice object at 0x153acf3b9550>}, '14681-1-1MIN': {'device_gid': 14681, 'channel_num': '1', 'usage': 0, 'scale': '1MIN', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-2-1MIN': {'device_gid': 14681, 'channel_num': '2', 'usage': 0, 'scale': '1MIN', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-3-1MIN': {'device_gid': 14681, 'channel_num': '3', 'usage': 0, 'scale': '1MIN', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-4-1MIN': {'device_gid': 14681, 'channel_num': '4', 'usage': 0, 'scale': '1MIN', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-5-1MIN': {'device_gid': 14681, 'channel_num': '5', 'usage': 0, 'scale': '1MIN', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-6-1MIN': {'device_gid': 14681, 'channel_num': '6', 'usage': 0, 'scale': '1MIN', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-7-1MIN': {'device_gid': 14681, 'channel_num': '7', 'usage': 0, 'scale': '1MIN', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-8-1MIN': {'device_gid': 14681, 'channel_num': '8', 'usage': 37, 'scale': '1MIN', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-1,2,3-1D': {'device_gid': 14681, 'channel_num': '1,2,3', 'usage': 11.787, 'scale': '1D', 'info': <pyemvue.device.VueDevice object at 0x153acf3b9550>}, '14681-MainsFromGrid-1D': {'device_gid': 14681, 'channel_num': 'MainsFromGrid', 'usage': 11.787, 'scale': '1D', 'info': None}, '14681-MainsToGrid-1D': {'device_gid': 14681, 'channel_num': 'MainsToGrid', 'usage': 0.0, 'scale': '1D', 'info': None}, '14681-1-1D': {'device_gid': 14681, 'channel_num': '1', 'usage': 0.0, 'scale': '1D', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-2-1D': {'device_gid': 14681, 'channel_num': '2', 'usage': 0.0, 'scale': '1D', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-3-1D': {'device_gid': 14681, 'channel_num': '3', 'usage': 0.818, 'scale': '1D', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-4-1D': {'device_gid': 14681, 'channel_num': '4', 'usage': 0.0, 'scale': '1D', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-5-1D': {'device_gid': 14681, 'channel_num': '5', 'usage': 0.0, 'scale': '1D', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-6-1D': {'device_gid': 14681, 'channel_num': '6', 'usage': 0.0, 'scale': '1D', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-7-1D': {'device_gid': 14681, 'channel_num': '7', 'usage': 2.731, 'scale': '1D', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-8-1D': {'device_gid': 14681, 'channel_num': '8', 'usage': 0.407, 'scale': '1D', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-1,2,3-1MON': {'device_gid': 14681, 'channel_num': '1,2,3', 'usage': 156.328, 'scale': '1MON', 'info': <pyemvue.device.VueDevice object at 0x153acf3b9550>}, '14681-MainsFromGrid-1MON': {'device_gid': 14681, 'channel_num': 'MainsFromGrid', 'usage': 156.328, 'scale': '1MON', 'info': None}, '14681-MainsToGrid-1MON': {'device_gid': 14681, 'channel_num': 'MainsToGrid', 'usage': 0.0, 'scale': '1MON', 'info': None}, '14681-1-1MON': {'device_gid': 14681, 'channel_num': '1', 'usage': 0.0, 'scale': '1MON', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-2-1MON': {'device_gid': 14681, 'channel_num': '2', 'usage': 0.0, 'scale': '1MON', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-3-1MON': {'device_gid': 14681, 'channel_num': '3', 'usage': 9.368, 'scale': '1MON', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-4-1MON': {'device_gid': 14681, 'channel_num': '4', 'usage': 3.051, 'scale': '1MON', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-5-1MON': {'device_gid': 14681, 'channel_num': '5', 'usage': 16.947, 'scale': '1MON', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-6-1MON': {'device_gid': 14681, 'channel_num': '6', 'usage': 1.705, 'scale': '1MON', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-7-1MON': {'device_gid': 14681, 'channel_num': '7', 'usage': 26.079, 'scale': '1MON', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}, '14681-8-1MON': {'device_gid': 14681, 'channel_num': '8', 'usage': 4.494, 'scale': '1MON', 'info': <pyemvue.device.VueDevice object at 0x153ad54f5880>}}
2021-05-06 10:00:31 WARNING (MainThread) [custom_components.emporia_vue.sensor] No channel found for device_gid 14681 and channel_num MainsFromGrid
2021-05-06 10:00:33 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in async_add_entities
tasks = [
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in <listcomp>
tasks = [
File "/config/custom_components/emporia_vue/sensor.py", line 31, in <genexpr>
CurrentVuePowerSensor(coordinator_1min, id)
File "/config/custom_components/emporia_vue/sensor.py", line 63, in __init__
raise RuntimeError(
RuntimeError: No channel found for device_gid 14681 and channel_num MainsFromGrid

I have solar panels installed. My Vue monitors mains as well as 8 other (non-solar) circuits.

from ha-emporia-vue.

Zyell avatar Zyell commented on June 8, 2024

The workaround I employed basically populates the MainsFromGrid and MainsToGrid as channels on the device containing '1,2,3' and it pulled in the data:
image
Interestingly, the Emporia App doesn't contain these channels or these values anywhere that I can find. Maybe they've added it to the API with the intention of adding it to the app in the future? I am also verifying the values right now against my own calculations based off the '1,2,3' main power sensor (which I've confirmed against values from the utility). So far the FromGrid looks off, but the ToGrid looks mostly correct. It makes me wonder if this is still a bit experimental for Emporia. These values only started showing up last night for me, because I restarted homeassistant and everything came up without issue. I do hope these values end up being correct though, because it is nice information.

from ha-emporia-vue.

magico13 avatar magico13 commented on June 8, 2024

Nice, that's pretty much what I was thinking of doing as well. I'm guessing the data required for From Grid only recently started getting populated so maybe it will be more correct after more of that data is stored. Though if this is for the 1 day scale maybe it's just a bit buggy since it sounds like these were added sometime in the last week,

from ha-emporia-vue.

Zyell avatar Zyell commented on June 8, 2024

Yes, you are probably right. It is a nice addition to the API though. For my workaround, I just did the following in the update_sensors function in init.py:

for device in device_information:
    if device.device_gid == channel.device_gid:
        for channel2 in device.channels:
            if channel2.channel_num == channel.channel_num:
                info = device
                break
        else:
            if channel.channel_num in ('MainsFromGrid', 'MainsToGrid'):
                for channel2 in device.channels:
                    if channel2.channel_num == '1,2,3':
                        _LOGGER.warn(
                            f"Added channel for {channel.channel_num} {scale} using 1,2,3"
                        )
                        info = device
                        device.channels.append(VueDeviceChannel(gid=channel2.device_gid,
                                                                name=None,
                                                                channelNum=channel.channel_num,
                                                                channelMultiplier=channel2.channel_multiplier,
                                                                channelTypeGid=channel2.channel_type_gid))

It works, but I'm not sure it is the most elegant. I'm happy to open a pull request and work on something better. Just let me know how I can help.

from ha-emporia-vue.

magico13 avatar magico13 commented on June 8, 2024

The master branch should have a fix for this in now. Let me know if it works for you or if you've got any more issues. I'll likely push up a new release tomorrow after a bit more testing.

from ha-emporia-vue.

Zyell avatar Zyell commented on June 8, 2024

I can confirm it is working for me as well! Thank you @magico13 !

from ha-emporia-vue.

rjchu avatar rjchu commented on June 8, 2024

The master branch should have a fix for this in now. Let me know if it works for you or if you've got any more issues. I'll likely push up a new release tomorrow after a bit more testing.

I have 1 day and 1 month data but all of the 1 minute values stopped working yesterday mysteriously. I just updated to the lasted version of the ha-emporia integration and still no luck. Will this pending fix here resolve this as well once it's pushed?

from ha-emporia-vue.

magico13 avatar magico13 commented on June 8, 2024

@rjchu that sounds like it could be related. I just pushed out a new release version with these changes so if you update and still have issues let me know.

from ha-emporia-vue.

skynet01 avatar skynet01 commented on June 8, 2024

It seems that reloading the integration sometimes fixes and makes all sensors work again instead of just the global one.

from ha-emporia-vue.

skynet01 avatar skynet01 commented on June 8, 2024

Does anyone know of a way to set up automation to automatically reload the component if all sensors start showing unknown? Or maybe Michael (@magico13) can build that into the component? ❤️ 😄

from ha-emporia-vue.

magico13 avatar magico13 commented on June 8, 2024

Looks like the initial problems in this issue were resolved so I'm going to close this out. Automatic reloading if it detects that it's getting invalid data is something I could look into further but it's somewhat unpredictable and difficult to test.

from ha-emporia-vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.