Code Monkey home page Code Monkey logo

lovelace-thermostat-card's Introduction

Lovelace Thermostat Card

hacs_badge

A simple thermostat implemented in CSS and SVG based on Thermostat Control by Dal Hundal (@dalhundal) on CodePen

  • Supports HACS installation
  • Extra ambient temperature
  • Allow changing of Opration mode
  • Allow avoid the card background

Preview

Update

v1.3.0

  • fix icon
  • Fix the problem that the title blocks the arrow button #16
  • Remove the small_i parameter and have done adaptive scaling

HACS Installation

Search for Thermostat Card

Manual Installation

  1. Download main.js thermostat_card.lib.js styles.js
  2. Copy to www\community\lovelace-thermostat-card
  3. Add the following to your Lovelace resources
    resources:
      - url: /hacsfiles/lovelace-thermostat-card/main.js
        type: module
  4. Add the following to your Lovelace config views.cards key
    - type: custom:thermostat-card
      entity: climate.gong_zuo_jian_kong_diao
      title: 工作间
    Replace climate.gong_zuo_jian_kong_diao with your climate's entity_id and 工作间 with any name you'd like to name your climate with

Options

Name Type Default Description
type string Required custom:thermostat-card
entity string Required The entity id of climate entity. Example: climate.hvac
title string optional Card title
no_card boolean false Set to true to avoid the card background and use the custom element in picture-elements.
step number 0.5 The step to use when increasing or decreasing temperature
highlight_tap boolean false Show the tap area highlight when changing temperature settings
chevron_size number 50 Size of chevrons for temperature adjutment
pending number 3 Seconds to wait in control mode until state changes are sent back to the server
idle_zone number 2 Degrees of minimum difference between set points when thermostat supports both heating and cooling
ambient_temperature string optional An entity id of a sensor to use as ambient_temperature instead of the one provided by the thermostat

Credits

@dalhundal

lovelace-thermostat-card's People

Contributors

chipriley avatar fineemb avatar zuluwhiskey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lovelace-thermostat-card's Issues

HVAC modes for maxcube

Hey, I absolutely love your card! And I got it basically working.

The thing is, I cannot really use the hvac mode. When I click on the symbol, it fills out the whole card and when I click on it again it says Failed to call service climate/set_hvac_mode.

2020-02-19 22:41:11 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.139732047504912]
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1251, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 198, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 356, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 384, in _handle_service_platform_call
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 422, in async_set_hvac_mode
    await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 418, in set_hvac_mode
    raise NotImplementedError()
NotImplementedError

I was hoping I could switch between the original modes of the thermostat, which are auto, boost, manual and vacation.

The sensor in HA looks like this in Auto mode:

hvac_modes: auto
min_temp: 4.5
max_temp: 30.5
preset_modes: boost,manual,vacation
current_temperature: 22.8
temperature: 21
preset_mode: null
friendly_name: Bad
supported_features: 17

and like this in manual mode:

hvac_modes: auto
min_temp: 4.5
max_temp: 30.5
preset_modes: boost,manual,vacation
current_temperature: 22.9
temperature: 16.5
preset_mode: manual
friendly_name: Bad
supported_features: 17

Any chance to reflect that?

The title above the chevron

Hi,
It seems that there is an issue with clicking on the target temperature up chevron, due it is behind the title.
In the smaller size mode.

Thanks in advance.

image

Smaller size

Hi, thanks for amazing card in the first place. I was wondering if there could be some way to make overall size of card a bit smaller, as now it "shouts out" over my other cards in my dashboard . thanks

How to remove Thermostat Title

entity: climate.daikin_ac
step: 1
chevron_size: 20
highlight_tap: true
card_mod:
  style: |
    .dial__lbl--title {
        font-size: 0px;
    }
    ha-card {
      background: rgba(0, 0, 0, 0.0);
    }


I have no idea why fineemb did not put this as an option but here is how you do it. You will need card mod. Figured the community can use some help for this.

No tick highlights

Is it possible to add a different (highlighted) color to the tick marks between the current temperature and the target temperature?
The original control on Codepen does have a different tick mark color (see image below:)
th_codepen
And this is the behavior in lovelace:
th_hass
Also, when the heater is off, no tick mark highlights are visible:
th_hass_off

(btw: using Thermostat Lovelace card v1.2.8 on HASS 105.4, browsers: Safari and Chrome)

set fan speed

Hello
I find your card very beautiful.
Is it possible to insert the possibility to set the fan speed for the air conditioner?

Page will not render once new custom card added

Initial install via HACS did not work at all due to missing components. That issue was fixed by recent checkin (40 mins ago).

Now entire page of controls does not render because of presence of this control.

Dial not turning orange when heating

I am using the new Nest Integration. The thermostat attributes are:

hvac_modes:
  - 'off'
  - heat
min_temp: 7
max_temp: 35
preset_modes:
  - none
  - eco
current_temperature: 21.6
temperature: 22
hvac_action: heating
preset_mode: none
friendly_name: Living Room
supported_features: 17

As you can see, hvac_action is reported as heating not heat. I think the code triggers an orange dial when hvac_action is heat. There is another thermostat-card project that allows you to map off, heat and cool to your thermostat's action states.

Scale for thermostats not consistent

Hello, first a great implementation of a thermostat. I would like to use it but there is one issue I would like you to resolve.

I have a Hive Thermostat which is located in the living room and multiple TRVs (not hive and various manufacturers), the TRVs are showing a scale which has 18 - 20 c at the extreme lower end of the scale while the Hive thermostat has the 18 - 20 c at the mid point of the scale.

Thermostat presence error

I have error:

Uncaught TypeError: Cannot read property 'toLowerCase' of null
    at ThermostatUI._updateColor (thermostat_card.lib.js?v=0.1.1:332)
    at ThermostatUI.updateState (thermostat_card.lib.js?v=0.1.1:188)
    at HTMLElement.set hass [as hass] (main.js:42)
    at HTMLElement.value (hui-view.ts:61)
    at HTMLElement.value (hui-view.ts:337)
    at HTMLElement.t.addEventListener.once (hui-view.ts:68)
    at r (fire_event.ts:76)
    at create-element-base.ts:92

and that's true actually, as my thermostat preset_mode is null, when it's in manual mode

image

If you don't set a title then 'Title' is shown

I've just set this up, thank you firstly for the hard work on this!

Version: 1.3.0

When adding this card to Lovelace but I don't utilise the title: option my thermostat just shows "Title", when I assume it should be blank instead?
YAML:

type: 'custom:thermostat-card'
entity: climate.hallway_thermostat

Screenshot:
therm

Thanks in advance 😄

Reopening #5

Uncaught TypeError: Cannot read property 'toLowerCase' of null
    at ThermostatUI._updateColor (thermostat_card.lib.js?v=0.1.1:332)
    at ThermostatUI.updateState (thermostat_card.lib.js?v=0.1.1:188)
    at HTMLElement.set hass [as hass] (main.js:42)
    at HTMLElement.value (hui-view.ts:61)
    at HTMLElement.value (hui-view.ts:337)
    at HTMLElement.<anonymous> (hui-view.ts:68)
    at r (fire_event.ts:76)
    at create-element-base.ts:92

Still error occurs.

⚠️ Information: Future card configuration changes.

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.

ALSO! Please restore the original MIT license file and honor it's attribution clause.

Non uniform step used

Ive set the step configuration to 0.5, however, when I go to change temperature setting it goes from 74.9 to 74.4 to 73.9 etc.

To me the expectation here would be 75 to 74.5 to 74 etc. I think the current temp to the 1 decimal place is coming through and then its stepping 0.5 from there. I say this because even if I change step to 1.0 I still get a similar experience.

Can this be fixed?
Perhaps there’s a way to set temp to full numbers or .5 numbers. Thoughts?

Title does not change state to AWAY

Hi,

When I switch to AWAY preset mode it does not change on the thermostat lovelace card.

image

It remains HOME.

The target temperature is correct.

Regards,

custom element does not exist

I have tried both a HACS install and a manual install. can't get around the "type does not exist" issue that many others seem to have. How did anyone else even get this card working?

Custom element doesn't exist: thermostat-card

Installed via HACS, worked until the update yesterday. Webdev console says:

GET http://ha/community_plugin/lovelace-thermostat-card/dist/styles.js?v=0.1.1 net::ERR_ABORTED 404 (Not Found)

GET http://ha/community_plugin/lovelace-thermostat-card/dist/thermostat_card.lib.js?v=0.1.1 net::ERR_ABORTED 404 (Not Found)

Uncaught (in promise) http://ha/community_plugin/lovelace-thermostat-card/main.js

The color on the scale is missing

Hi,
Since last HA update, 0.110.2, there is no scale coloring, blue, orange, depends on the AC operation mode.
It is all white now.

image

Thanks in advance.

Dial Color

The dial background color is always orange because heat mode is enabled. If I disable heat mode the dial background color is black.

I'd like the dial background to reflect the climate sensor's "hvac_action" attribute current value.

  • "idle" shows black background.
  • "heating" shows orange background.
  • "cooling" shows blue background.

Essentially, exactly what happens when you look at a Nest thermostat.

Enhancement: Display Nest Leaf (as per the Nest actual device settings)

Please add support for the Nest Leaf!
The Nest Leaf displays on my thermostat when my heating temperature is set to 19 C or less. It's not based on ECO mode. In ECO mode, the Leaf is simply triggered to display because ECO mode sets the ECO temperature to a range I configure in Nest settings (range is off, 4.5 to 21.0). That range setting happens to display a Leaf on the slider at 16.5 C or less but in operation, the Nest displays a Leaf at <19.5 C. Perhaps add an option to manually specify leaf_heat_setpoint: and default to 19 if not configured. That way the user can control the display of the Leaf but within a range of min_setpoint to max 19 C and if user specifies a higher value use 19 C. I don't know what the cooling setpoints are for the Leaf trigger as I do not have A/C...

Show Humidity?

Hi,

Is there a way to also show the humidity?
On this Github page I've noticed a yellow raindrop with percentage icon:
Humidity_icon
So I suppose this is the humidity level? On your Github there is no parameter to add/hide the humidity sensor.
Currently I'm using another custom thermostat because I want to visualize the humidity/room (thermostat)
So If I could also see the humidity in your lovelace-thermostat-card I would instantly switch.
Humidity

  - type: 'custom:simple-thermostat'
    id: tado_thermostat_bathroom
    name: "BATHROOM"
    entity: climate.badkamer
    step_layout: row
    icon: false
    step_size: 1
    sensors:
      - entity: sensor.badkamer_humidity
        name: Humidity
    control:
      hvac:
        some_mode: false
        another_mode: false

  - type: 'custom:thermostat-card'
    title: BATHROOM
    entity: climate.badkamer
    small_i: true

Thanks!

Colors for the interval do not show up

Hi
I am using lovelace thermo card. I recognized that the values temp and set-temp are not marked with colors as shown here.
grafik

I am using HA version
grafik

In my dashboard the thermostat looks like this, no colors !
grafik

what is here wrong, can you give me some hints what I am doing wrong ?
regards Chris

Menu (3 dots) not visible

Hi,
Seems that the menu button (3 dots) is not visible anymore. Although it is still possible to tap on that area to get the whole settings pop-up opened.

Totally fine if this was the intention, maybe make it configurable. What do you think?

Thanks in advance.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.