-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
[Feature]: Show current humidity level in humidifier card #1088
Comments
Templates are always rendered on the backend so allowing them everywhere is a performance hog, generates extra requests. Mushroom does have access to the hass state object, but it doesn't support JavaScript templating like custom-button-card which is what would be required to use front end templates (not too hard to do, but probably not in the cards (heh) for mushroom anytime soon. Not sure having arbitrary entities outside of templates is common enough to get accepted. How does everyone feel about JS templates from button-card? |
Is it possible to have the state of the humidifier actually pull the target humidity attribute and display that on the card insead of displaying "on" the majority of the time and only momentarily changing when the humidity target gets updated Also like the climate card, it'd be nice to have the -/+ buttons as actual UI elements and not a slider |
Actually, if the humidifier card worked more like the climate card I think it'd function a lot better, be much more usable, and be a lot more in line with the overall vibes of the mushroom cards |
I dug into this a bit because the humidity card in the documentation shows the current humidity, but my mushroom cards do not. I think I may have found the issue within the let stateDisplay = this.hass.formatEntityState(stateObj);
if (this.humidity) {
const humidity = this.hass.formatEntityAttributeValue(
stateObj,
"current_humidity",
this.humidity
);
stateDisplay = humidity;
}
let stateDisplay = this.hass.formatEntityState(stateObj);
if (stateObj.attributees.current_humidity !== null) {
const humidity = this.hass.formatEntityAttributeValue(
stateObj,
"current_humidity",
this.humidity
);
stateDisplay += ` ⸱ ${humidity}`;
} I think this change will make the card more like the climate card that displays the current state and temperature in the "State" option that can be chosen in the card's various data fields. I'm just jumping into typescript, so I haven't yet figure out how to best test this modification. Can anyone actively working on these cards take a look? Thanks! |
@piitaya Apologies for the ping, this issue is old enough I wasn't sure anyone would see my comment above. (And you are the only person to have touched this code for > 2 years). |
I can also reproduce that "the humidity card in the documentation shows the current humidity, but my mushroom cards do not." Your fix sounds reasonable. I suggest opening a PR with what you described. |
Finally got a dev environment working. PR submitted #1625 |
Requirements
Is your feature request related to a problem?
I currently use my dehumidifier with the Mushroom humidifier card. I really like it, but it would be helpful to be able to display the current humidity level (which my dehumidifer measures) inside of the card.
Describe the solution you'd like
I'm not sure what's best implementation from a dev perspective, from a user perspective it would be cool if I could provide an arbitrary sensor for primary/secondary information type.
Describe alternatives you've considered
AFAICT templating doesn't work in fields like the card name, otherwise I would do something like set the name to
Dehumidifier ({{ states(blahblahblah)}}%
.I can get that to work in the template card but I don't think there's a way to add a slider to control the humidity level there. Maybe that would be a more powerful way to make this feature request possible? It would also help people who want to do a bit more customization for thermostats or lights.
Additional context
No response
The text was updated successfully, but these errors were encountered: