finity69x2 / fan-control-entity-row Goto Github PK
View Code? Open in Web Editor NEWProvides a means to show a compact graphical control row for 2 or 3 speed fans in Home Assistant
Provides a means to show a compact graphical control row for 2 or 3 speed fans in Home Assistant
The Treatlife DS02 and DS03 Fan control has 4 speeds Low, Medium, High, Highest Can you add this as an option?
I have a diffuser that I am treating as a fan. It only has 3 speeds: Low, High, and Off. Could there be a way of hiding the unsupporting ones?
Either
The off button no longer works. I am using a BOND but the "off" event does work with scripts or sending the event manually.
""
Is it possible to modify this to support the 4 speed options of Lutron fan controls?
EDIT: seems I misunderstood how sendStateWithSpeed was supporsed to work. That is not the issue...
I have a MQTT based fan that, for some reason, will not turn off when using v1.5 of this plugin w/ hass 0.110. Works w/ my 3 other Insteon based fans. From what I can see the service call fan.turn_off doesnt seem to be sufficient, but rather the fan expects fan.set_speed set to off..
I tried to set up a fan and integrated it to lovelace with your control. I assume my setup is somehow wrong:
fan.turn_on
, fan.turn_off
, fan.toggle
and fan.set_speed
speed_list:
- '1'
- '2'
- '3'
speed: '1'
friendly_name: Wohnraumlüftung
supported_features: 1
The fan template looks like:
fan:
- platform: template
fans:
ventilation_fan:
friendly_name: "Wohnraumlüftung"
value_template: >-
{% if states('switch.switch_ventilation_relay_1') == 'on' %}
off
{% else %}
on
{% endif %}
speed_template: >-
{% if states('switch.switch_ventilation_relay_2') == 'on' %}
2
{% elif states('switch.switch_ventilation_relay_3') == 'on' %}
3
{% else %}
1
{% endif %}
turn_on:
service: switch.turn_off
data:
entity_id: switch.switch_ventilation_relay_1
turn_off:
service: switch.turn_on
data:
entity_id: switch.switch_ventilation_relay_1
set_speed:
service_template: >-
{% if speed == '1' %}
script.ventilation_fan_1
{% elif speed == '2' %}
script.ventilation_fan_2
{% elif speed == '3' %}
script.ventilation_fan_3
{% endif %}
speeds:
- '1'
- '2'
- '3'
I integrated it in lovelace with
- type: entities
title: Belüftung
show_header_toggle: false
entities:
- entity: fan.ventilation_fan
type: custom:fan-control-entity-row
name: Wohnraumlüftung
but the buttons are not initialized correctly and are not selectable - the state was
speed_list: 1, 2, 3
speed: 1
friendly_name: Wohnraumlüftung
supported_features: 1
and state on
, so "LOW" should have been selected.
My home assistant version is
arch | armv7l |
---|---|
chassis | embedded |
dev | false |
docker | true |
hassio | true |
host_os | HassOS 4.8 |
installation_type | Home Assistant |
os_name | Linux |
os_version | 5.4.42-v7l |
python_version | 3.7.7 |
supervisor | 226 |
timezone | Europe/Vienna |
version | 0.110.4 |
virtualenv | false |
The theme is https://github.com/JuanMTech/google_dark_theme
Changes are high that I did something wrong, would be glad if you could point me in the right direction.
Lutron Caseta fan switches support "low, medium, medium-high, high". Could this be added?
I am seeing this in the logs with the latest update.
/community_plugin/fan-control-entity-row/fan-control-entity-row.js:219:1 Uncaught SyntaxError: Unexpected token '}'
Hello,
I have several bathroom fans with only two speeds. Would it be possible to hide/disable third speed in config?
This repo is missing a hacs.json file. Because of this, the repo does not appear in the HACS repo list.
Home Assistant 2021.4.1
Fan Control Entity Row: 2.1
2021-05-05 12:47:13 WARNING (MainThread) [homeassistant.components.fan] The fan.set_speed service is deprecated, use fan.set_percentage or fan.set_preset_mode instead
Any possibility of adding support for fans with more than 3 speeds?
I use the Hampton Bay Universal Wink Enabled fan controller, which gives my fans the following speed settings...
Low
Medium
Medium-High
High
Comfort Breeze (FYI, this is a setting where the fan randomly changes speed to simulate a natural breeze)
Off
For my fan, the current setting of speed is not working. In your code, first a set_speed is sent, and then a turn_on. This is not working for my fan: it first needs the turn_on and then the set_speed. Is it possible to add an option for this?
Heads up:
I'm on the dev build right now and I get this when I use this lovelace addon.
[homeassistant.components.fan] fan.set_speed is deprecated, use fan.set_percentage or fan.set_preset_mode instead.
Explanations of the new methods are here in the dev docs.
I don't know when this method is going away entirely, but this is coming at some point.
All of the sudden I've noticed that I get this error when clicking on my fan Hi/Mid/Low/off buttons.
Searched around, although admit-tingly not very thoroughly and didnt see anything related.
works:
- customIsOffColor: 'rgb(128, 0, 0)'
customIsOffSpdColor: '#121212'
customIsOnHiColor: 'rgb(0, 128, 0)'
customIsOnLowColor: 'rgb(0, 0, 128)'
customIsOnMedColor: 'rgb(128, 128, 51)'
customTheme: true
entity: fan.living
name: Ceiling Fan
secondary_info: last-changed
type: 'custom:fan-control-entity-row'
- customIsOffColor: 'rgb(128, 0, 0)'
customIsOffSpdColor: '#121212'
customIsOnHiColor: 'rgb(0, 128, 0)'
customIsOnLowColor: 'rgb(0, 0, 128)'
customIsOnMedColor: 'rgb(128, 128, 51)'
customTheme: true
entity: fan.kitchen
name: Kitchen Fan
secondary_info: last-changed
type: 'custom:fan-control-entity-row'
does not update buttons, but it does control the group:
- customIsOffColor: 'rgb(128, 0, 0)'
customIsOffSpdColor: '#121212'
customIsOnHiColor: 'rgb(0, 128, 0)'
customIsOnLowColor: 'rgb(0, 0, 128)'
customIsOnMedColor: 'rgb(128, 128, 51)'
customTheme: true
entity: group.airmovers
name: All Fans
secondary_info: last-changed
type: 'custom:fan-control-entity-row'
groups.yaml:
airmovers:
name: All Fans
entities:
- fan.kitchen
- fan.living
Anyway to make this work, or possibly an update to fix it?
Love these button components as I use both extensively.
Thanks
Hi
If the fans is in off state, clicking on any speed should allow for the fan to be turned on in the speed selected. Clicking on the device to turn on then select speed defeats the purpose of this card.
Rishab
I currently have a BOND controller that sends the fan commands to my fans. The current plugin works great, however, it can end up 'out of sync' with my actual fan due to users interacting with the physical fan controller itself.
Example:
Suggestion 1: The ability for the UI to allow a user to select a setting/button but after the selection (ex: High Speed button), the button does not retain a 'IsOn' state but instead just immediately defers back to the 'IsOff' state. This way, the HA display is not out 'out of sync' with the actual physical state and strictly acts as a controller to send commands but automatically default back to 'IsOff'.
Suggestion 2: Allow the same state to be selected again (MEDIUM is currently selected but allow the user to select MEDIUM again). I can then simply change the style of the 'IsOn' and 'IsOff' state to be the same.
With the new fan percentage system, this plugin is now throwing an error:
Failed to call service fan/set_speed. invalid literal for int() with base 10: 'low'
Is there a way to get this working with the new fan model, or do I need to replace it with fan-percent-button-row for all of my fans?
Is it feasible to shrink the name area so there isn't a big gap when this element is used in places other than an entities card? Might it also be feasible to hide the name area entirely if name=false?
My use cases are in the picture elements card
and in the custom banner-card
. I'm going for a fairly tight layout on my dashboards and without the extra gap I could put 2 of these in the space 1 normally requires. The gap also makes the buttons seem unrelated to the icon and name on a picture elements card
.
These adjustments would be handy as a consistent feature across all your custom elements.
Hi,
I'm using the fan-control-entity-row for my mechanical ventilation. This is something I can't turn of,f so it should be nice to have the option to hide the off. Could this option be added?
Pressing the high button sets the speed properly then a second or so later, sets the speed to medium. A plain switch on with Insteon FanLinc always sets the speed to medium.
Removing this line restores the previous behavior for me
line 209 this.hass.callService('fan', 'turn_on', {entity_id: this._config.entity});
I also edited these line to make buttons bigger for me... an enhancement to adjust button size would be nice
min-width: 65px;
max-width: 65px;
height: 65px;
font-size: 12px !important;
Otherwise great code thanks for sharing
Everything was working fine but did recent update of HA core and no longer can I click on "high; med;low". The error is "failed to call service fan/set_speed. Service now found" Any ideas what is broken?
My Air purifier has fan speed attributes, but also has a mode attribute.
If you manually select a speed, mode sets to 'manual'.
the purifier has an auto button. sets mode to Auto. Speed becomes null
If you could add option:
auto_button : true (default false)
Enables an Auto button, the Auto button sets mode attribute to auto,
I'm using this fan controller, and have it showing in lovelace. However, if a fan is on, and HA reboots, when it comes back up, the interface shows that the fan is off, even though it's still on.
How can I make it so the speed shows after reboots?
This is showing up in the logs:
2020-10-07 00:10:03 ERROR (MainThread) [frontend.js.latest.202009180] http://redacted/local/fan-control-entity-row.js:6:1 Uncaught SyntaxError: Unexpected token '<'
Screen grab of top few lines in Notepad++ attached
Home Assistant in Docker running on Synology Nas.
use fan.set_percentage
https://www.home-assistant.io/integrations/fan/
Since version 1.8 the customIsOffSpdColor setting has no effect anymore.
Using the following card settings:
- entity: fan.dyson_pure_cooltm
name: Dyson
type: 'custom:fan-control-entity-row'
sendStateWithSpeed: true
customTheme: true
customIsOffColor: var(--primary-color)
customIsOffSpdColor: var(--secondary-background-color)
customIsOnHiColor: var(--primary-color)
customIsOnLowColor: var(--primary-color)
customIsOnMedColor: var(--primary-color)
state_color: true
Hello! Card doesn't work in HA 2021.4.4.
Because set_speed is deprecated now
P.S. Card is great!
One of my fans has an issue:
fan.turn_off
low
when off
is passed to fan.set_speed
I would like to propose re-ordering the 2 actions taken when the off
button is pressed.
I believe the custom theme should be set to false as default. Default behavior should match whatever theme the user specifies.
I also think even setting this to false, for some reason the theme is not matched completely.
Using Fan Mode Button Row via Hacs, HA 2021.5.5 on a PI4 Safari 14.1 with and without iOS/MacOS Apps. Fancontroller is a Sonoff iFan02 Tasmotized with 9.3.1
Lovelace:
entity: fan.fan_sz
type: 'custom:fan-mode-button-row'
name: Schlafzimmer
reverseButtons: true
Problem is, i can't click on all of the 4 Buttons, but no reactions. In the more-info Dialog i can change the speed flawless, can even do so by Servicecalls.
What i did so far:
Of course i restarted HA every time, and cleared cache frequently.
I still donno if it is a Bug or if i did something wrong.
Nothing seems to work, no matter the number of forced refreshes. All other settings seem to take effect.
Using the Bond integration with 4 run-of-the-mill remote-controlled fans.
lovelace ui:
cards:
- type: entities
show_header_toggle: false
title: Ceiling fans
entities:
- entity: fan.office_fan_3
type: custom:fan-control-entity-row
name: Office fan
customTheme: false
Whenever I attempt to turn the fan off, the fan instead set its speed to 3. The logs show it:
# initial state is off
Sep 25 15:25:10 cube docker-compose[3376158]: home-assistant | 2020-09-25 15:25:10 DEBUG (MainThread) [homeassistant.components.bond.entity] Device state for fan.office_fan_3 is:
Sep 25 15:25:10 cube docker-compose[3376158]: home-assistant | {'power': 0, 'speed': 3, 'direction': 1, 'light': 1, '_': '449c0000'}
# turn the fan on (speed 1)
Sep 25 15:25:23 cube docker-compose[3376158]: home-assistant | 2020-09-25 15:25:23 DEBUG (MainThread) [homeassistant.components.bond.entity] Device state for fan.office_fan_3 is:
Sep 25 15:25:23 cube docker-compose[3376158]: home-assistant | {'power': 1, 'speed': 1, 'direction': 1, 'light': 1, '_': '276a1988'}
# turn the fan off (speed is set to 3) ????
Sep 25 15:25:34 cube docker-compose[3376158]: home-assistant | 2020-09-25 15:25:34 DEBUG (MainThread) [homeassistant.components.bond.entity] Device state for fan.office_fan_3 is:
Sep 25 15:25:34 cube docker-compose[3376158]: home-assistant | {'power': 1, 'speed': 3, 'direction': 1, 'light': 1, '_': '4b031e4f'}
Commenting out the set_speed
call that is made when turning off the fan seemed to solve the issue:
setSpeed(e) {
const speed = e.currentTarget.getAttribute('name');
if( speed == 'off' ){
this.hass.callService('fan', 'turn_off', {entity_id: this._config.entity});
// this.hass.callService('fan', 'set_speed', {entity_id: this._config.entity, speed: speed});
} else {
if(this._config.sendStateWithSpeed){
this.hass.callService('fan', 'turn_on', {entity_id: this._config.entity});
}
this.hass.callService('fan', 'set_speed', {entity_id: this._config.entity, speed: speed});
}
}
I'm sure that call was put there at some point for a reason, but it sure breaks things for me.
Hi,
Is there any way to provide the oscillation feature for this card? I'm using smartir to control a Mitsubishi Fan and it would be great if we can switch the oscillation on or off.
Hi, thank you for an amazing component
Is there a way I can use this with a 6 speed fan with speeds named Speed 1, Speed 2 , Speed 3 etc?
Thank you
Current speed is blank but changes speed accordingly when you click on it. All boxes are blank.
Hi,
I am using your great tool - fan-control-entity-row but lately, it doesn't work properly. Could you update your code and change used service from fan.set_speed to fan.set_percentage? Fan.set_speed is deprecated since 2022.3
Thanks in advance
Radek
Hi.
A change in how lovelace cards are set up in Home Assistant 0.105 increases performance, but enables cards to accidentally modify their own configuration in the loaded lovelace configuration.
I'm going through the cards in the HACS default repository, and noticed that your card may be susceptible to this. Looking through your code it seems you may modify parts of the config object passed to your card in setConfig
.
The result could be that your card does not work well with the GUI editors or that parts of the configuration start showing up multiple times.
At some point in the future, it is likely that the configuration will be frozen before being passed to setConfig
. At this point, your card will fail entirely when it tries to modify the configuration object.
There are several ways to fix/protect agains this problem.
The best is to restructure setConfig
such that the configuration is never modified.
Other alternatives are to make a copy of the configuration and work on that instead.
setConfig(config) {
config = { ...config }; // This works for simple configurations not containing arrays or objects
...
import { deepClone } from "deep-clone-simple";
// https://github.com/balloob/deep-clone-simple
setConfig(config) {
config = deepClone(config); // This is a safe and fast method
...
or
setConfig(config) {
config = JSON.parse(JSON.stringify(config)); // This uses built-in functions, but may be slower than deepClone
...
Please note that I have not tested your card agains Home Assistant 0.105 or later, but just quickly looked through the code. If I'm mistaken in my assessment, I appologize for taking your time.
See thomasloven/hass-config#6 for more info.
Hi,
I'm using the fan-control-entity-row for my mechanical ventilation. This is something I can't turn off (which is common in the Netherlands with ITHO devices) so it should be nice to have the option to hide the off. Could this option be added?
Since the latest update I have noticed that the add-on now says it is depreciated in the Configuration>Lovelace>Resources section. It also fails to load half of the time which I think is related to that as I have other depreciated front end add-ons that are doing the same. I have to refresh a few times for it to display the card now. Not sure if there are any tweaks I can do on my end so I figured I would reach out here. Let me know if you need more info.
The element is terrific. I'm able to see it on my dashboards both on desktop and Mobile browsers. When I try to view it on the Home Assistant Android app I see errors.
Custom element doesn't exist: fan-control-entity-row.
entity: fan.fan_switch_family_room_level
type: 'custom:fan-control-entity-row'
name: Family Room
customTheme: false
reverseButtons: true
Apologies if this is the wrong way to post this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.