Hello,
I am new to HA (as well as to AD or HADash) - so bear with me.
I bought a Xiaomi Gate and a set of temperature (+humidity, + pressure) sensors and wall plugs. The idea is to automate the floor heating using pairs of sensor+wall plug as ‘thermostats’. It is doable in HA, but there’s a catch: the target temperature is ‘hardcoded’, and … it does not look very well. AppDaemon (and HADash) look fine, but… how to do it? Seems that ‘climate’ widget does not fit. A custom widget? Maybe. But where to start from?
I have read numerous posts, as well as the documentation, and did not find a clues.
To be frank, I am a bit disappointed about HA docs: What’s a ‘platform’?
Then I turned to AppDaemon docs. I thought it was easy/documented how to create a custom thermostat starting from the generic one: no clues. What about custom widgets? Almost nothing, as the docs simply list the code for ‘baselight’ widget and the so-called customization talks only about variables of the base widget.
… anyway, enough complaining.
Can someone point me to the right direction?
I can get you the code when I get home but I have something similar but for my Air Conditioner. I have my apt temp showing as a single number averaged from separate temperature sensors around my apt. let me know if this sounds like what your looking for. Or I wonder is this what your looking for https://www.home-assistant.io/components/climate.generic_thermostat/
Thank you for the swift response.
Any code will help. What I really need is to be able to control the temperature for each and every ‘room’ (since I have temperature sensors and AC actuators - actually wall plugs connected to the floor heating ‘central device’).
Actually I looked at the climate.generic_thermostat code, but it is unclear to me how to integrate it in the Xiaomi ‘environment’. I’m pretty much convinced there’s a way to derive a custom class from xiaomi.py and generic_thermostat.py, but I do not know how.
the generic thermostat does actually just do 1 thing.
it takes a temparature sensor and a switch.
then you set the temperature you want and the thermostat turns on or off the switch based on the sensor.
so use the gateway to see the sensors and switches in HA (if needed)
then when you have the sensors and switches in HA you can use those for the thermostat.
off course forget about the thermostat option that xiaomi gives you.
by the way, you dont need to look at the code at all if you want to use components. just put the right yaml in your config.
to answer a few of your questions:
a platform is a group of components. for example the platform “switch” which contains all switch components or the platform “camera” that contains all camera components.
dont start thinking about a dashboard if you dont know how to add stuff to HA. dashboard is just a way to show things that are in HA on a certain way.
dont start thinking about appdaemon to use for coding, if you dont know how to add stuff to HA. appdaemon is a program that is there to automate the stuff you already have in HA.
i think you didnt read the appdaemon docs completely by the way.
there is a complete section about custom widgets: http://appdaemon.readthedocs.io/en/latest/WIDGETDEV.html#
and you probably read the section about customising widgets. which is a complete different thing and is here:
http://appdaemon.readthedocs.io/en/latest/DASHBOARD_CREATION.html#widget-customization
and yeah, i get it when you say that its confusing because its both called customising. but i dont see another way to name those things, but if you can come up with something that is less confusing, then andrew is listening.
but like i said, dont jump into the deep water if you start to learn how to swimm.
- add the stuff you want to HA. (sensors, switches and any other components)
- create a simple dashboard with the stuff you have
- create simple apps to make basic automations
- if you know how things work and want to customise your dashboard more start thinking about custom_widgets
- create more complex apps.
Hi Rene,
Thank you for your feedback. And thank you for accepting that some therms are confusing.
What I did till now is:
- started Xiaomi G/W and pairing the devices
- started HA, and during the first run, the ‘discovery component’ in configuration.yaml has found everything
- using the names of different entities, I created groups.yaml, and grouped the entities into ‘rooms’
- at this point all the above groups are visible in HA main page
As you can see I “know how to swim” and I believe I am ready to “jump in the deep water”. My question about “platform” still stands. With all due respect a platform is not a group.
Returning to HADash. There’s no thermostat widget. I guess it may be represented in a dashboard as multiple widgets: a sensor (reporting the current temperature), an input (number or slider) to set the target temperature and some other widget (or code!) to control a switch.
With Xiaomi zigbee devices one can even see the battery status (which is displayed in HA!) - this is what I would call “customization”.
What bothers me with the above is that I will end up having several widgets which are tight to the same room/automation and which are displayed as standalone widgets. This is where I need help.
yeah it is a group, but not a “group”
i did explain it wrong though.
a platform is more like a producer from a group of devices.
if you look at this:
switch:
- platform: broadlink
then you know its a switch and it comes from broadlink
you can also have a broadlink sensor and together they form a platform.
another example is for instance xiaomi. it has lights, switches, gateways, sensors, remotes, and much more.
they all talk the same way and use the same code parts to create and control the entities in HA.
i hope that makes it more clear?
there are 2 devices in dashoard that are there for thermostats.
first the most common: climate
a thermostat in HA is a climate entity. a generic thermostat is also a climate entity
the heater widget is a combination from an input slider and a switch.
yeah you can create 1 widget that shows all kinds of entities and attributes in 1 widget.
that kind of customising expects you to know how to program in HTML, CSS and javascript.
and the guidelines for that kind of custumising can be found in this section i gave you:
http://appdaemon.readthedocs.io/en/latest/WIDGETDEV.html#
but be aware that it asks you to know advanced javascript and CSS programming
if you dont have that kind of programing skills, you get stuck with just customising existing widgets on CSS level. and thats not a problem on its own, because you can also group widgets together.
this is how i have my thermostats for 5 heaters:
and some more ways how i had them in the past