-
Notifications
You must be signed in to change notification settings - Fork 526
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
Create Fresco_Hydrate_Ultra_Pet_Fountain.yaml #2006
Conversation
Support for Pettadore | Fresco | Hydrate Ultra
Fixed waterlevel
These changes should fix the formatting issues and trailing spaces that are causing the linting warnings + adding a fix for the non working waterlevel.
Trailing spaces removed. Indentation adjusted.
done fixing :)
This seems to be a different device despite the similar sounding name. |
custom_components/tuya_local/devices/Fresco_Hydrate_Ultra_Pet_Fountain.yaml
Outdated
Show resolved
Hide resolved
min: 0 | ||
max: 43200 | ||
mapping: | ||
- scale: 1440 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of scaling this to days, add class: duration
to the entity config, and change the unit to min
. Then HA should scale as appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You did not add class: duration
to the entity config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example:
- entity: sensor
name: Filter life
icon: "mdi:air-filter"
category: diagnostic
class: duration
dps:
- id: 104
type: integer
name: sensor
range:
min: 0
max: 43200
mapping:
- invert: true
unit: min
|
||
secondary_entities: | ||
- entity: button | ||
name: Reset Filter Alarm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change "Alarm" to life" here to connect it logically to the sensor below. Including "Alarm" makes it seem like it is connected to an alarm bell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree i can change the name
invert: true | ||
unit: d | ||
- entity: button | ||
name: Reset Pump Alarm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well i change the name
min: 0 | ||
max: 86400 | ||
mapping: | ||
- scale: 1440 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here with class and scale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't gonna do that, as it works correct. as well u have another supported fountain that has almost the same config, and there its the same way.
name: sensor | ||
unit: TDS | ||
- entity: switch | ||
name: UV sterilization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use translation_key: uv_sterilization
instead of name and icon to get consistent icon and translations with other tuya-local devices with this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well why does this device need translation_key: uv_sterilization ? as other fountains like the cat fountain whats supported does not have that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The catit_pixi_smart_fountain does have that. I'm not sure which config you are talking about.
category: diagnostic | ||
dps: | ||
- id: 108 | ||
type: integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dps_val appear to be strings, not integers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not a string but integer.
Uv runtime is no string.
custom_components/tuya_local/devices/Fresco_Hydrate_Ultra_Pet_Fountain.yaml
Outdated
Show resolved
Hide resolved
Hm, okay. Since it looks absolutely identical I was asuming its only a rebrand with the exact same configuration. |
Well, this is the Petoneer Fresco Ultra, did buy it in germany ;) |
I will fix the code next week, as i am short of time. for me i'm using this for a whileand have 0 problems with last HA update. |
I will revamp the whole code according to your suggestions @make-all |
Instead of scaling the values to a more useful unit (days), use the original value with original min units, and the duration class to get the HA UI to do the scaling dynamically. Comment on PR #2006
Well i'm updating the code, and still this is not working at all: So if i do this instead, it will work and show the value normal
this ill show the value 27D and that's correct. So you really need to help me why your suggestion is not working or me.
the output of the device is this, and i know its minutes, but homeassistant doesn't calculate it.
// update i did notice it works backwards, i did reset the filter and the value became 1 aka 1 minute. so the thing is, what i wanted to do before is decrease, so it shows the days instead of the minutes elapsed.. so we know when its time to clean the filter:
|
I think i fixed the code now, but there is a issue i can't resolve.
When i use my new code like this its getting a 100% match:
debug on 107
|
Whole code revamp
removed the "step" in primary
I did fix the full code and it works, however there is an issue i just found out and don't knwo why its happening. So when i press reset water it resets correct, i see the value going to 0 It could be probably an issue with the device itself |
I now know how i can update according to your requests. So i gonna contribute a lot, as i love this integration. But i need only to understand how the reset button is working. However when i look the device debug on tuya cloud, it shows the value getting reset, but sets it back to de current one. So, with this new code update everything is working, and i did add the translation_key: uv_sterilization for DPS 107 and works correct now :) Have an nice day. |
Buttons expect to send true when pushed (from HA point of view). It looks like the reset buttons in this config are of type integer, so I guess they expect that to reset you should send 0, or max. So you need a mapping of HA true to what the dps expects, like:
|
Yes you right that fix it right away, i will update the code now. One final question to finish this. this is what i have
|
i removed the duration class, now it should work. regards |
The |
Removed class duration from normal statuses. Fixed the reset buttons
- from review: add duration class correctly - separate switch and light, since the switch controls the whole device - unbrand the top level name, include full device name in product specific name.
…petfountain.yaml Rename file to fit in with most common naming convention (all lowecase, separate parts for brand, model, device type, but multiple words within those not separated. Not all existing files follow the convention, but the majority do and it is better not to make the inconsistency spread.
Instead of scaling the values to a more useful unit (days), use the original value with original min units, and the duration class to get the HA UI to do the scaling dynamically. Comment on PR make-all#2006
Support for Pettadore | Fresco | Hydrate Ultra