/r/homeassistant
Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io.
Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io.
/r/homeassistant
I wanted to share my experience with the Sonoff TRV because the device is basically unusable out of the box, but can become very good. However, the setup is a bit complicated so to make it more accessible I made this guide. This may be applicable to other smart-TRVs if they expose the right configuration options.
The Sonoff TRV has a fatal flaw. It works the following way: When the room temperature is less than the set temperature, it opens the valve fully. Once the room temperature is more than the set temperature it closes the valve fully. This is terrible. It's super noisy as the motor has to move far and frequently and the temperature overshoots and fluctuates a lot. In my home the temperature fluctuated by 3-4 degrees Celsius which is unacceptable. It's noisy, uncomfortable and inefficient leading to high heating bills.
However, there is a saving grace with the Sonoff TRV. It has two settings for setting the minimum valve position and maximum valve position. By abusing this, you can programmatically adjust the valve position down to 1%.
This is basically a closed loop feedback system. We set the valve position. The temperature in the room changes, we then adjust the valve position based on this change. It's not an easy problem, due to the delay between action and response, but it is a well studied problem with good solutions. A commonly used one is what's called a PID controller.
Step 1 Install the HACS repository "Smart Thermostat PID".
Step 2 Make a numeric helper between 1 and 100 to represent the TRV valve position (in percentage, 0 = closed, 100 = fully open)
Step 3 Add the following YAML configuration to create a PID thermostat entitity
- platform: smart_thermostat
name: TRV PID controller
unique_id: trv_pid # Id of the climate entity created
heater: input_number.trv_valve_position # The numeric helper you created
target_sensor: sensor.temperature # A temperature entity used as the environment temp.
min_temp: 7
max_temp: 28
ac_mode: False
target_temp: 19 # Initial setting, is modified using the UI
keep_alive:
seconds: 60
kp: 60 # Initial setting, is modified using the UI
ki: 0.01 # Initial setting, is modified using the UI
kd: 2000 # Initial setting, is modified using the UI
pwm: 0 # Set this to zero because we use a numeric input
This will create a new climate entity that will be used for adjusting temperature instead of the one directly associated with the TRV. Once you set it to heating and set the temperature, it will calculate a valve position and update the numeric helper. It will automatically adjust the valve position over time as the temperature changes.
Step 4 Create an automation that sets the max open/closed position of the Sonoff TRV based on the numeric helper.
Here it is in YAML. The equivalent can be configured using the UI. Basically, whenever the helper changes, update max closed/open based on the helper value.
alias: TRV valve adjustment
description: Automatically adjust living room TRV according to PID controller
triggers:
- trigger: state
entity_id:
- input_number.trv_valve_position
conditions: []
actions:
- action: number.set_value
metadata: {}
data:
value: "{{100.0-states('input_number.trv_valve_position')|float}}"
target:
entity_id: number.trv_valve_closing_degree
alias: Set max closed valve position to 100 - calculated position
- action: number.set_value
metadata: {}
data:
value: "{{states('input_number.trv_valve_position')|float+5}}"
target:
entity_id: number.trv_valve_opening_degree
alias: Set max open valve position to calculated position + 5%
mode: single
Step 5 Tune the PID algorithm. It has 3 tunable parameters (P gain, I gain and D gain). They were initialized in the YAML configuration, but future changes are made using a service/action (smart_thermostat: Set PID gains) that can be called using the development tools.
Here is how: https://imgur.com/a/tP01gVu
This guide is quite comprehensive on how to tune the parameters: https://tlk-energy.de/blog-en/practical-pid-tuning-guide
In my case the temperature would overshoot, so I increased the P-gain (Kp) and left Ki and Kd unchanged. This worked well. If you experience that it is too slow at adjusting to temperature changes, you can reduce Kp. If it oscillates, you can adjust the other parameters.
Using this setup I managed to get my TRVs to control room temperature within +- 0,3 degrees while only making very small adjustments to valve position. Exactly what I wanted and what a good climate system should do. Some of the more expensive TRVs do this out of the box.
The downside is that it relies heavily on Home Assistant. So if the valve loses connectivity or Home Assistant stops working, the valve will be stuck in it's last position. However, since it makes small adjustments, this will probably roughly keep the set temperature rather than completely heat/cool the room, which I think is an acceptable mode of failure.
In an ideal world, this would be implemented in firmware. Maybe Sonoff releases something in the future, but I wouldn't keep my hopes up.
If you want physical operation using the TRV to work, you can create a new automation that synchronizes the PID set temperature to the one on the TRV. This should be quite easy
If you want the TRV to display the external room temperature, rather than it's internal temperature, you might be able to modify the automation created earlier to also set the calibration offset of the device to the difference between the external and internal temperature. I haven't tested this. It depends on whether the Sonoff TRV takes into account the offset. Otherwise you can get the Sonoff thermostat which can be directly connected to the TRV.
Hi guys (sorry for my poor English) I'm approaching home automation and I've been advised to avoid buying for example an echo show 15 but to opt for a Smart hub from Samsung or aotec, since I would like a very large panel (at least 15") for the control, how do you think it could be done? I was thinking of buying one of those portable monitors and attaching a fire stick or a raspberry to the back, it seems like a waste to buy a tab just for the controls (given that there are none of that size), thanks in advance for the answers.
Would you know if there's a video doorbell that can integrate with the Home Assistant? And Home Assistant to figure out if I'm home?
Situation 1: Someone rings a doorbell, wife is at home, but I'm not. In that case there won't be alert/notification triggered on my phone.
Situation 2: No one is at home, doorbell rings. In that case I get an alert on my phone.
Or any ideas how to solution this?
This problem is stopping me from getting a video doorbell, as I don't want to be spammed with alerts when not home, but wife is there to answer the door.
Hi Folks,
Long story short, I am moving to a new apartment (medium-size, 90 m2/900 square feet) and I want to put some home assistant solution.
I will have home assistant on an N100 MiniPC that I may share with Octoprint, and file hosting+torrent. And i need some suggestions regarding:
- Smart electrical outlets with power metering + ethernet + line of 5 V?
- Movement sensors
- Router and connectivity.
Questions:
Hue and tado
Do I need Philips Hue hub and tados usb dongle? or can I just punt a generic USB zigbee- z-wave dongle in my MiniPC with home assistant and handle them?
Connectivity Smart Electrical Outlet
I will make some minor renovations so I may put some electrical outlets with gigabit ethernet cable and I may put a 5V line for ESPhome projects. ¿is this worth it? Any electric outlet already ready for this?
I was thinking of using a "normal" electrical outlet but inside a few "Sonoff dual R3 with power metering" So I can know how much electricity each room and appliance uses and shut them down when I'm not home. is this a good idea?
Movement sensors
I have a Smarthings router + 3 Aeotec 6-in-1 sensor. To use them with home assistant I need to pay a subscription for a webhook. Not gonna happen. besides, these sensors had a significant delay so it wasn't worth it. So I am thinking of getting rid of them and replace them.
Which movement sensor would you suggest instead? I can program some myself by using ESPHome, but in this case, I would highly appreciate a sensor recommendation.
Smart Electrical Outlet
I was thinking of using a "normal" electrical outlet but inside a few "Sonoff dual R3 with power metering" So I can know how much electricity each room and appliance uses and shut them down when I'm not home.
Router
Would I need a dedicated router? I am unsure if I may have some signal saturation if everything goes on wifi and if I would need a dedicated router.
So far I will need: 10 Gb Ethernet port for the mini PC + file hosting + 1 ethernet port for main PC +1 RJ11 port (for Philips hue hub) - all of them have 2RJ11 so I don't care and 1 USB for Tados dongle.
So far I have my router and the router that will be installed by the phone company. The ones that may be installed by my company are the following: I assume that the first one is the better, right?
TIA,
With Black Friday deals showing up, should I move away from my Tasmota light switches to Matter or Zigbee devices instead?
Does adding Matter devices improve the network coverage like Zigbee devices do?
So I have a roof watertank and a solar panel that heats it up. I believe the thing has a thermostat to keep it from overheating and exploding somehow.
Then there ia a boiler feature with a switch. Sso during the winter when there is little sun I can heat it up using electricity.
I want HA to know what temperature the water is, so I can use shelly to turn the boiler on if I'm about to go to shower and water is not hot enough.
What sensor do I need to buy?
I've been running an EcoWitt WittBoy GW2001 weather station with Home Assistant for the past few months, and I wanted to share how I've turned basic weather data into a powerful environmental monitoring system. Here's how I combined local sensor data with external APIs to create a comprehensive weather dashboard.
I've created several template sensors to derive more meaningful data from the base readings:
sensor:
- platform: template
sensors:
rainfall_intensity:
value_template: >-
{% set rate = states('sensor.gw2000b_rain_rate_piezo') | float %}
{% if rate == 0 %}No Rain
{% elif rate < 2.5 %}Light Rain
{% elif rate < 7.6 %}Moderate Rain
{% elif rate < 50 %}Heavy Rain
{% else %}Violent Rain
{% endif %}
I've enhanced the station's capabilities by incorporating:
The dashboard is organized into logical sections:
sensor:
- platform: template
sensors:
air_density:
value_template: >-
{% set T = states('sensor.outdoor_temperature') | float %}
{% set P = states('sensor.absolute_pressure') | float %}
{% set RH = states('sensor.outdoor_humidity') | float %}
{{ (P * 100) / (287.05 * (T + 273.15)) | round(3) }}
unit_of_measurement: "kg/m³"
The EcoWitt GW2001 is a powerful platform that, when combined with Home Assistant's capabilities, can provide professional-grade weather monitoring. The key is to think beyond the basic sensors and create derived data that adds real value to your home automation system.
Hi folks,
I'm looking to run HA on a Pi5 come Christmas, depending on pressies.
Kids have also always wanted a minecraft server for the family.
So my question is if I get a Pi5 can it run HA and a minecraft server at the same time. If it can how would I set this up (with very easy to follow instructions please)
Cheers
Hello, I want to start using Home Assistant. I have to experience in selfhosting anything. I see that the easiest solution would be buying HA Green BUT I dont want to end with HA only. I plan to selfhost Adguard Home, Immich and maybe some kind of small cloud storage to share documents with family.
As far as i understand i wont be able to do so on HA Green, and i want to have the least possible amount of devices running. So there is miniPC Raspberry Pi reccomended and supposedly easy to set up. And as far as i understand I would be able to run all those things on one Raspberry Pi (obviously as long as it has good enough parameters and enough space for photos and files)? But then i saw quite a few comments on reddit on different subs that Raspberries are overpriced. Whats your opinion? Do you reccomend other miniPCs to run HA?
Would it be as easy to setup HA on different miniPC as it is on RAspberry Pi? I am total noob in that matter.
I also have an old laptop with windows 10 and 16GB RAM but accorindg to HA website hosting it on it would be hard to do and i gguess it would consume more power than miniPC?
The price is also important, I wouldnt consider anything more expensive than 200$
What hardware would you reccomend for a total newbie to get started with HA and selfhosting generally?
Pretty much what the title says, I love what the new mm wave sensors are capable of, great precision. However I would like to keep my smart home entirely offline, and most offers I have found appear to enforce cloud usage and new account creation. I'm fine with doing a bit of hacking to get it to work, but it has to be offline. Any ideas?
I guess there are a few parts to this question while I wait to get the updated firmware.
Has anyone got the upgraded firmware for their controller that enables matter?
Have you got it integrated with Home Assistant?
If you have, how well does it work? Mainly, do favourite positions work?
My home setup isn't too large, and this is the last major piece of the puzzle to get everything working within Home Assistant and not have a hacked together hybrid Home Assistant/Google Home setup.
Screenshot of the energy counters that sometimes jump to random values
Hi,
I have got a battery connected via can bus to a victron battery inverter and that one is integrated into homeassistant. If I use the battery energy counters as is in the energy dashboard it always shows like hundrets of kWh per day coming from the battery and vice verca. I see that sometimes there might be a readout problem and the value jumps somewhere else.
I tried creating a utility meter helper entity and I checked the option, that the counter sometimes goes back to zero to somehow circumvent the negative energies but now I get weird huge steps in the helper, which also is incorrect.
How can I make a helper that just removes/hides/ignores those huge steps and makes a nice energy counter out of that?
Looking for a smart humidifier with optional essential oil thing(not my choice) that works with home assistant easily. Doesn't need to be too big, just for a bedroom.
I live in an apartment and can't run a cable outside to my security cameras. I currently use blink but they're absolute garbage. Looking for a replacement that is completely wireless, maybe with a solar panel or something. I would like it to be able to show a live feed in home assistant very quickly when I pull it up. Needs to be able to be mounted on a wall or window(I'm currently using suction cups). Budget would be anything under $600. Bonus if I can get a wireless smart doorbell from the same company.
I'm planning to use Zigbee smart wall sockets in my new house and considering Aqara, Sonoff, and IKEA options. I’d like to hear from others about their experiences:
How reliable are these brands?
Any issues with integration (Home Assistant)?
Are there better alternatives to consider?
Idk i want to add them all over the house so maybe i need around 30-40 sockets and the price being too high.
Any advice please..?
HA noob here. I have been looking for an option to turn on LG tv when its off, i don't know what to do. Have been looking into Wake on LAN but i don't understand it properly. What is the better option or idea. New to yaml, don't fully understand how to change things or edit to get it properly
I was wondering if you can fully utilize the Pro bridge to do everything you can with the app? Things like add new devices, for example, not just change dimmer settings?
Guys I really need your help, I live in the UK and hubby is an absolute smart home assistant fanatic, he already has raspberry pi, motion sensors PR sensors LUX sensors automated blinds smart locks smart thermostats smart buttons zigby protocol ZWAVE protocol thread protocol WiFi smart vacuum smart plugs smart cameras, smart doorbell and smart light switches. All the lights in the house are automated. There’s temperature and humidity sensors everywhere including a smart dehumidifier and air purifier. His eco Systems are: apple home Google Nest Google and Alexa He has all his media connected. Any gift ideas for Christmas that would truly surprise him?
Hi,
I am seeking a relatively basic automation, I think?
I want a button on my dashboard or the option to scan an NFC tag to start a timer for my bathroom fan to turn off after x amount of minutes. I've explored a humidity sensor, but it doesn't work for me.
Is there a good way to go about doing this in HA? My bathroom fan is already in HA, but I'm having issues with a timer helper and creating the actual automation.
Thank you!
I wanted to share my Home Assistant dashboard for monitoring my Mixergy smart hot water tank. For those unfamiliar, Mixergy tanks are pretty cool - they can selectively heat portions of water rather than the whole tank, integrate with solar, and have some neat IoT features. ☀️
The dashboard I've built helps monitor and control several key aspects ⚙️:
Smart Features:
Cost Management:
Usage Patterns:
The tank's API integration with Home Assistant made this possible, and I'm using mainly Mushroom cards and ApexCharts for the visualizations. Really helps in optimizing both energy usage and costs, especially with variable electricity rates and solar generation. https://github.com/tomasmcguinness/homeassistant-mixergy
Tank Info: https://www.mixergy.co.uk/solutions/mixergy-x/
Let me know if you'd like more details about any specific aspect of the setup!
From what I can tell, the Apple Watch HA client can only show scripts and scenes. Apple Homekit can only show certain devices when I expose them but it's a limited set. Siri and Shortcuts are other options, but I want to be able to control my door locks, GDO, etc. from my watch without using voice. Are there any options?
HA on WearOS was so much easier.
Hello, Considering this scheme, how much BTU would you suggest for the Conditioner?
The yellow mark will be the head unit, with the maximum outside temperature in summer being 43 C. The W-S part is the corner of the building. living room is 27 square meters, considering bedrooms + bathroom is 53 in total.
The small bedrooms won't have direct airflow so is it worth getting anything more than 12 000 BTU for 30-40 sq meters?
Just want to do a simple automation. the action is to set the device_tracker.my_phone location to home.
However the log says "The see service is not supported for this entity device_tracker"
According to this post:
https://github.com/home-assistant/core/issues/102446
See service is depreciated. This guy MartinHjelmare simply closed the ticket without providing any alternative.
Then how do we set the location of a tracker in the automation action in 2024?
I'm newbie to HA, it seems to me the support is horrendous..I'd like to know the secret passage to get answers to question like this, besides bothering the busy sages here with newbie questions..
Anybody out there with a Kohler DTV+ system?
My system will not change time when entering or exiting daylight savings time (DST).
I have worked with Kohler support on atleast 3 occasions over the pass 2 years. Now they are telling me it’s not designed to change the time because it’s an international product. What!?? Why is there a DST checkbox in the settings??
This question is for the folks in the United States…Does anybody’s Kohler DTV+ clock change with DST? Or does everybody have to change the time twice a year?
It’s crazy! My $50 thermostat can handle DST but this expensive “smart” shower can’t? Somebody out there please help!!
Long story short, I live in a condo with industrial AC and heating. The system provides hot air in winter and cold air in summer (controlled by the building) and the air is piped in, and our thermostats control the fan in each unit to pull the air in. The current thermostat I have is pictured, along with the wiring setup.
There are a few problem. 1, the thermostat is right by the back door, where drafts affect the reading. 2, it only reads the temperature in the living room which is usually a few degrees different than the bedroom at night. 3, probably the worst, the thermostat is situated on the wall where the hot or cold air passes through, which means after 10 minutes of heating or cooling, the thermostat has a very exaggerated reading of the temperature. It’s basically useless as a thermostat and we are constantly adjusting it. Like 20 times a day, if not more.
The landlord replaced the thermostat with a newer model (the one pictured) and it made zero difference. They said no to physically moving it, and the system is not compatible with a low voltage thermostat that most houses use.
Functionally, it’s a relay with 120v mains power, and there doesn’t seem to be anything on the market that I can use to make it “smart” and thus use other temperature sensors to manage the climate.
Would a zigbee relay be the best method forward? I was thinking something simple, like setting the temperate as high (in the winter) or as low (in the summer) as it’ll go, and then having a zigbee relay interrupting the “HOT” wire and having home assist manage the temperature with zigbee temp sensors. This probably won’t work as I’m not sure yet how long the thermostat retains its state after a power cycle.
I could use a multi gang relay and mirror what the thermostat does, but that’ll be a good amount of rewiring (7 wires instead of 1) that the building maintenance guy might not want to deal with.
I could do a low voltage relay to “press” the contacts on the thermostat rubber buttons, but that’s going to require taking the thermostat apart. I suppose I could also use one of those button presser devices, but that seems really janky. How well do those work?
Any other ideas or suggestions? I don’t want to go through another winter constantly fiddling with this stupid thing.
Good day! I am fairly new to HA from SmartThings. I mostly have Leviton switches and Dimmers. We moved and I have several switches in the new house with no neutral on one of each 3,4-way setups. I am faced with several options to make these switches smart but thought I would reach out to the community to see if there are better ideas I do not know about.
Option 1 use Leviton no neutral switches and companions that use a wifi bridge which I already have. I find these switches much slower to respond than the Z-Wave and would like to be able to use double tap which I do not think they support.
Option 2 Smart Bulbs. Family of five here and I know half the switches will be turned off rendering the smart bulb inoperable most of the time.
Option 3 some type of relay in the circuit near one of the fixtures. This would be new to me so not sure if it’s a good way to go.
Currently I have zwave radio (zooz 800 long range Z stick) but would be willing to move into zigbee if that makes sense. Not sure what matter is all about at this point. Prefer to move away from wifi options unless they make sense or are last resort. Running HAOS on RP4.
I thank you all for reading this post and really appreciate any advice that comes my way.
Running the latest 2024.11.2
Anytime I remotely view my dashboard with 5 Frigate camera streams, my network becomes completely unusable. The live streams don’t even fully load, they look like how it used look trying to download a jpg on dial up in the ‘90s.
I set up a ping test. Without the dashboard open, ping averages 40ms. When I open the view, ping jumps up to 1000-1500ms, and sometimes climbs as high as 26000. Closing the tab immediately brings ping back down to baseline.
The interesting thing is I can load the Frigate native website with the exact same five streams and they load up instantly. Ping temporarily jumps to 200ms, but then comes back down to the 50ms after a few seconds.
Why is the Frigate card so problematic? Is this part of the new webrtc changes recently introduced? Any troubleshooting steps?
The frigate card is set to use go2rtc for live provider and webrtc under options.
I am planning to use Mac Mini as unattended home server which will be running multiple docker containers on it.
I have one doubt for the same. In case of power restore, will the docker container come up automatically without having to manually enter password every time?