Conversation
Add support for Frizzlife LP365 (non-P) and support for metric/imperial units.
Updated product information and entity definitions for the Frizzlife LP365P water monitor. Added manufacturer details and improved structure for better clarity.
|
This needs reworking to get rid of whatever it is that is preventing line 2 from matching (I suspect line end changes). |
|
@make-all Refactored to fix linting errors. |
|
@make-all Ok, now the linting is erroring out on the duplicate names which I am selectively enabling based on imperial vs metric units. Can we fix the linter to allow it, as it works great? |
|
You need to fix your code, not the linter. Duplicate entity ids are not allowed, and the id is based on the device_id+entity name (with fallbacks to translation_key and class). But rather than changing the names, you should merge the entities into one with conditions to value_redirect to the alternative dp. |
Refactor to align with linter.
|
@make-all Got it. Thanks. |
|
Actually, I don't got it... I can't change the units via a conditional. The file I created appeared to work, but all the entities have no units (which breaks everything). The first solution I came up with worked perfectly, what do you consider wrong with that? |
|
@make-all Thank you. Didn't know about the translation for temperature, updated that. |
|
@make-all Here is another pull request that allows my use case. This is a very narrow scope to only allow duplicate entity names if both of them share the same conditional. |
|
@make-all Please advise how you would handle unit switching. |
|
There are many examples of this in the existing config files for thermostats and air conditioners. Try searching for temp_cur_f or current_temperature_f to find examples. |
|
I have tried 3 different AIs and tried doing this by hand, the ONLY way I can make it work is with duplicate entities. Here is an example that complies with your linter, but it DOES NOT WORK. I could not find A SINGLE example where a device had configurable units based on a DPID. I found LOTS of examples of it changing the TEXT label, but not the units. name: Smart Water Monitor
|
Add support for new LP365-P variant and LP365. Support for metric/imperial.
See testing and discussion here:
https://community.home-assistant.io/t/frizzlife-smart-water-monitor/875335