ngardiner / TWCManager

Control power delivered by a Tesla Wall Charger using two wires screwed into its RS-485 terminals.
The Unlicense
130 stars 55 forks source link

What's with "power"? #325

Open jherby2k opened 3 years ago

jherby2k commented 3 years ago

In Home Assistant, i see a "power" sensor that reports current (amperage). This seems wrong. It also seems redundant, since there is an ampsInUse (and a chargerLoadInW) sensor already. Is this a bug? Does it serve any purpose?

Code in question is on line 635 of TWCSlave.py:

            self.timeReportedAmpsActualChangedSignificantly = now
            self.reportedAmpsActualSignificantChangeMonitor = self.reportedAmpsActual
            for module in self.master.getModulesByType("Status"):
                module["ref"].setStatus(
                    self.TWCID, "power", "power", self.reportedAmpsActual, "A"
                )
ngardiner commented 3 years ago

It's a good question, but a low priority for me personally. I have around half a day per week to spend on TWCManager these days unfortunately, and that goes to new features and improvements. I appreciate the drive to clean it up and I am a fan of the idea, but it needs to be something that is researched rather than a question that needs to be followed up - what did you find, is there a duplicate in logic where another value is identical? Does it just need to be renamed, or could you publish the sensor twice with the same value but better naming and provide the opportunity for a clean transition? It seems badly named but it is 2-3 years old and hasn't been revisited in that time - so all suggestions and proposals are welcome.