-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Platform iotawatt does not generate unique IDs. #87182
Comments
Hey there @gtdiehl, @jyavenard, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) iotawatt documentation |
I'm betting related to the known breaking change for IoTaWatt |
Yeah, tried multiple ways to remove, and can't seem to either. Including completely removing the integration and adding it back. I'll watch here for updates. |
I am also having this problem. It looks like it's specifically for IoTaWatt configured "outputs". My "inputs" are correctly creating unique identifiers. This is important because i can't rename my IoTaWatt outputs in HA until they get a unique ID. |
has there been any progress with this? I have the same issue, all the inputs show up, but not my outputs. Same messages in my logs regarding the unique IDs |
Would love it if there could be a solution to this item. |
Hi! Indeed it looks like the reason for the output to not show is because they don't have unique IDs. I created a "Home" output in the IoTaWatt UI with the sum of my phases: When I added the integration the "Home" entity is missing in the integration UI: But when I go to the global entities UI in And clicking on it and trying to configure it I get: The funny thing is that the container I'm running Home Assistant shows warnings but for other input sensors:
No logs for the output Home sensor though. Despite all this, I was able to configure the Energy dashboard (although not sure if it is working correctly): |
I enabled the debug log of the integration and I can see clearly that the outputs are being fetched:
(Pretty printing added) So, it looks like is just an issue with the integration. What is really the problem of generating UUID? I think that (device_name, input number) is a perfectly acceptable seed for a UUID. Is there a limitation I'm not seeing? I'll try to fiddle with the integration to see if I can identify anything. |
So, I did found the unique id here:
As shown, outputs aren't assigned a unique ID. Why? No idea. So I changed that code to this:
And now the output entities are showing in the integration: But.... here is the interesting thing. Look at the logging I put in place for debugging. This is what Home Assistant logs:
Sooooo the error messages about "Platform iotawatt does not generate unique IDs." is not really that it doesn't generate an unique ID, is that the sensor class for each I'll try to continue identifying what's going on... |
I did found @gtdiehl custom component for IoTaWatt, and it does contains the fix I found before: So it seems like the Home Assistant core integration is maybe missing some code. I'll compare both and post here what I found. |
So, I did found the issue with the non unique identifiers. The issue looks like iotawattpy is returning several "energy" sensors for each input or output: When the Home Assistant integration runs, the sensors are created here:
The value of
And here comes the funny part:
So, in my case, keys It looks like the algorithm is deterministic (not sure though), and That's is what's happening, but not sure how to fix it. I could simply improve the ID generation to account for this fact, and create more sensors, or just filter explicitly out either @gtdiehl you're the expert, if you have any suggestion I can implement it. |
I implemented a fix for this issue (both repeating IDs and outputs not showing). Its a one liner, but it has some implications:
It looks like the original author made an assumption, that using the channel is a more unique ID than the name for inputs, and by doing this they forgot the outputs. It works quite good, but if this isn't the direction please let me know. |
PR #91141 was opened. The change is super simple: I don't know if I'll survive Home Assistant merge bureaucracy, but there it is. |
Love your work @carlos-jenkins |
The official integration isn’t missing some changes. It’s a conscious decision as in their mind, the iotawatt outputs do not satisfy the requirements of being unique. See #86834 (comment) |
People are crazy for not accepting this change. Anyway, if you need background on why this was created check: home-assistant/core#87182 home-assistant/core#86834 (comment) https://community.iotawatt.com/t/feature-request-unique-identification-of-outputs/5444/3
Thanks @jyavenard that gives me a lot of context. So, I see there is a lot of politics here. In the meantime I need a working integration. I just published the code of the integration with the fix here if anyone needs it: https://github.com/kuralabs/iotawatt_ha To install, go to your config directory and execute the following command:
|
@carlos-jenkins thank you so much for this. I was getting so frustrated that some of my iotawatt sensors were on their own. Is there a way to force a UUID on these so that we can manage them from the UI and change their friendly names and assign them to an area? For any of my template sensors I just use an online UUID generator to assign one in the configuration.yaml and while I know that isn't recommended it's nice to actually have the option. |
Hi guys, I've followed the above steps from @carlos-jenkins: ran that code from the HA config directory on my NAS (Docker install) and I'm not having any luck. Following executing the code I reload the integration in HA, and also tried completing restarting HA. In both instances I get the below error appear on the integration's panel on the HA Integration screen... it'll temporarily revert to 'Initializing...' while it seemingly tries again, but then reiterate the error. The log suggests it occurs 5 times in that initial burst after restarting. Any ideas?
|
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
On HA v2023.8.1 this issue persists. Since the combination of HA rules/guidelines + IoTaWatt policy seemingly won't ever allow this to work properly, perhaps the integration should be removed from HA core? There seems to be a custom integration now that does work and does not have this error (as far as I can tell? I haven't tried it myself). |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
The problem
As the title says, I see this error in my logs.
What version of Home Assistant Core has the issue?
core-2023.2.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
IoTaWatt
Link to integration documentation on our website
https://www.home-assistant.io/integrations/iotawatt
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
The text was updated successfully, but these errors were encountered: