I have several sensors configured exactly the same way and all of them work as expected.
Recently shelly unit controlling garden lights failed and I replaced it with the new one. After some initial issues to restore device’s and entities’ names to original state everything works fine, but this particular Powercalc sensor.
Related entity (light.shelly_garden_lights) exists and properly changes its state. I do not see any errors from Powercalc in log. What could be wrong here?
Thanks but the issue seems to be that if you define the filter as ‘template’ you cannot use the options within that. You can only use the options under ‘include’ (like in your example).
So trying to re-create an include that gives me the same result as the template. Not easy…
So below is already better but the combination of attribute filter ‘power’ combines with integration ‘powercalc’ does only show a small set of the power sensors. Further testing shows it’s the integration: powercalc filter that does not return all powercalc sensors (if I remove other filters).
It seems that sensors created lik below do not get tagged with integration ‘powercalc’ only the ones that are created virtually.
Another drawback is that the powercalc groups do not play nice in auto-entities. You would expect group: sensor.all_powercalc_power to work as a group filter (like it does for instance for lights or media players, but auto-entities does not play nice. @bramski Is there anything you can do about this or is this 100% on auto-entity side?
auto entities looks at entity_id attribute of the group entity, powercalc defined the child entities in entities attribute, so that’s why the group filter not works. I don’t want to change that as lot of users may already depend on that. So there must be a very good reason to do so.
I understand & respect that, but maybe there is a way powercalc could (optional) create another entity eg a a ‘real’ group next to the ‘powercalc’ group? That way you maintain existing functionality but at the same time facilitate new functionality. ‘Real’ groups (and their benefits) are use-full in many cases. posted it on your github.
You can actually create dynamic groups (I did not know of) by calling group.set service like the example below. This will create a ‘real’ group called (in this case) group.test_powercalc which then behaves like a normal group and therefore can also be used by -for instance- auto entities to filter on.
I think these are non-persistent and will need to be called at startup.
It is not good practice for integrations to put much data in the attributes as this needs to be written on every state change, and also quickly adds to the database size.
So I want to adhere to that as much as possible.
I don’t think this is supported by HA yet. Powercalc does not provide pricing. I think there was a topic about it in WTH to also have pricing for individual entities.
Or you might build something yourself with some template sensors.
Should be auto discovered. You can enable debug logging which should give some clues as to what model is detected by powercalc. Maybe this somehow does not match the model in the database.
I recently added a couple Emporia Vue Gen 2 energy monitors to my main panel and subpanel. Even with all of current sensors installed, I have ~20 circuits which are unmonitored. So, I’m initially using them to find the power curves for each of my loads (e.g. dimmable lights via Excel and trendlines, electronics, and basically anything else that has a state monitored/controlled via HA). Thanks to your integration, I’ll be able to monitor them as well as my higher load and non-HA monitored circuits with the Vue. Thank you.
Now that I have the power curve equations, I’m starting to create the Powercalc sensors. After making a few in the UI and getting a good sensor template and overall configuration with the necessary parameters, I’d like to switch to yaml to more quickly configure the remaining sensors.
Where can I find the yaml created by the UI, so I can copy/paste that into my configuration.yaml?
I could go all yaml, but I’ll probably use a mix of UI and yaml Powercalc sensors. Does Powercalc allow for a mixed configuration like this?
Thank you for this great integration, it has proved to be very helpful in tracking the energy usage.
I had several light groups defined in configuration.yaml and they had worked well for few months. But now when I migrated HA and some other stuff (HA from Docker to HAOS VM, zigbee2mqtt to Docker) to new platform, I noticed that the powercalc grouped entities had stopped working. I’m not sure what had changed in the migration (nothing should’ve as such), but with debugging I was able to trace the problem to “could not resolve any entities in group…” error and then I noticed also one line saying that a particular light was missing (but only for one light, in the indoor group). Light was not missing as a zigbee entity but the debug log was pointing to its original id from the time I linked it. I then removed the light from under Powercalc in UI (in integrations screen), and indoor group started working. From additional “could not resolve…” messages I deducted that something was wrong with light in one other group (on lowest level of nested groups for outdoor lights), even though I was not able to see any similar error that would have pointed to old id as with the indoor light. Anyhow, removing every light related to this sub group in Powercalc integration via UI finally led to victory. All working again.
Is there some obvious error in what I did? Should I have removed the instances I had in UI under Integrations / Powercalc to begin with so that they are not in two places? I still have some of the lights left there, the ones that did not cause any errors. So I wonder why (only) some of them started behaving badly at this point. They are zigbee bulbs and coming to HA via mqtt (zigbee2mqtt + mqtt server running on another VM) and I guess I might have changed the name in zigbee2mqtt after linking them while they were already auto dicovered in HA. So the name changed at the very beginning (few months ago). And now some of the error messages I saw in debug log hinted that there could’ve been a reference in powercalc to the original name while in yaml I was using the current names. But as said, everyhing worked until few days ago when I did the migration. So - all good for now but to avoid this hassle in future, looking for advice where I did wrong and how to prevent this from happening in future?
Btw, I should mention I did not find a way to reload the powercalc groups without a HA restart, took a bit of time with several restarts. Is there some better way to do this?