No video

Home Assistant MQTT Changes & Moving to Packages

  Рет қаралды 14,733

ResinChem Tech

ResinChem Tech

Күн бұрын

Пікірлер: 36
@tarunarya1780
@tarunarya1780 2 ай бұрын
@ResinChem Tech, I am really grateful for this video. Forced migration through SD corruption has been painful. Your clear advice on how to make changes has been a God send.
@ResinChemTech
@ResinChemTech 2 ай бұрын
Glad you found it helpful!
@giantbrain5793
@giantbrain5793 8 ай бұрын
This video really helps me as a beginner, thank you, Suhu👍🙏
@garysinclair6490
@garysinclair6490 Жыл бұрын
The packages: line has to be indented because its a part of the top level homeassistant: entity. Things like automation: entity are also top level entities.
@segamanxero
@segamanxero Жыл бұрын
Have a door sensor that falls into the binary sensor thing with two entities, for door status and one for battery. I had gotten a warning to make some changes in prep for 2022.9, which I /thought/ I addressed. Noticed at some point the sensor stopped working and have been trying to figure this out for almost a month with random trouble shooting off and on. Finally was able to sit down and fully play with things attempting to get it working again. Came across your video and it was the ah ha moment for me to get it working again. I dont like the new everything mqtt in the mqtt.yaml file thing they are doing now. I only have this one sensor so I am going just suck it up. Will keep the packages trick in mind if I end up expanding my mqtt stuff. Hopefully they do not nuke that trick. Thanks so much for doing this video, it was super helpful! I am so happy this is working again for me.
@ResinChemTech
@ResinChemTech Жыл бұрын
Glad I could help! I don't always understand (or like) some of the changes that the Home Assistant devs decide to make, but I'm sure they have their reasons. I think that they often don't consider the potential impact on their long time users in lieu of making things easier on the newbies. I agree that this particular change makes things much less organized for us long time YAML users... and is what drove me to packages. Thanks for watching... and taking time to post a kind comment!
@jimweston6577
@jimweston6577 2 жыл бұрын
packages are part of the "homeassistant:" integration from the "default_config:" if you remove default config you need to enter it this way ######################################### ### Package Setups & Customizations ######################################### homeassistant: customize: !include customize.yaml packages: !include_dir_named packages hope that clears it up a little
@ResinChemTech
@ResinChemTech 2 жыл бұрын
Thanks! That makes sense. I just have all my 'includes' grouped together, and most of those are the default entities (e.g. lights, sensors, etc.). I know that I ran into the same issue reported by many others that tried to move to packages... they put the !include statement for packages at the same level as the other entity integrations and got the "packages are not an integration' error. The resulting solution was to indent by two spaces, but nowhere did I see an explanation as to why this was the case... it just worked! Thanks for taking time to clear that up! Makes sense that since packages are part of the root 'homeassistant:" integration, that's why the two space YAML indentation is needed. I appreciate the clarification that I couldn't find anywhere else!
@timderks5960
@timderks5960 11 ай бұрын
Does that also mean that packages should be a child of default_config? When I put it in a random place in my configuration.yaml file, I get an error about mapping, but when I put it right below default_config:, the error disappears. Sadly, it doesn't seem to load the packages either though.
@tarunarya1780
@tarunarya1780 2 ай бұрын
@ResinChem Tech To return your help, using PSPAD freeware allows you to open and search in multiple files all in one go. This would mean that you use samba but may help you locate your entities. I note that you moved to packages and this may not be of help.
@ResinChemTech
@ResinChemTech 2 ай бұрын
Thanks for the tip, but I did move completely to packages a few years back. I actually have a more updated video that covers the process for moving from a single or split configuration to packages in Home Assistant: kzfaq.info/get/bejne/sJyPoM-E2KfHo5c.html
@tarunarya1780
@tarunarya1780 2 ай бұрын
@@ResinChemTech I did watch more of your videos including re the possible death of homeassistant due to matter. I think that this is no bad thing as some microprocessors will not be reflashable. I bought some TUYA radiator valve devices that used a different processor. I think one of the biggest things letting homeassitant down is the unhelpful documentation and the yaml editor which means things that should take 5 minutes take hours as no one understands the yaml or its errors. The documentation needs to be practical advice including on breaking changes. I had no idea of the mqtt top down directive which was not mentioned on the yaml code check which told me to remove platform line. Anyway thanks again for the pointers. For anyone reading my comment on the PSPAD: The use of a text editor like pspad is useful when using samba to allow access to the files but no one tells you that yaml uses different end of lines chr(10) etc in the format causing errors. *** You need to copy and paste it into the inbuilt file editor if new lines where the linefeed is different *** I have no knowledge of Visual Code Studio which is likely a lot better. THe search and replace, and the use of copying and pasting a template structure that works has saved me time e.g. adding 10 button rf remote control buttons (of which I have a few), or PIRs. etc.etc.
@jimdavis3749
@jimdavis3749 2 жыл бұрын
New Subscriber Well done! Thanks
@rklauco
@rklauco 10 ай бұрын
Did not work for me unless I moved the two-spaced packages EXACTLY at the same place you have it - then the HA worked OK :) Thanks for sharing this!
@ResinChemTech
@ResinChemTech 10 ай бұрын
Yeah... someone explained why you have to indent the package declaration instead of making it like a top level domain. That's YAML for you! I initially had the same issue... wouldn't work unless the packages: statement is indented by exactly two spaces. I've been pretty happy with my configuration in packages... although there are times when I kind of liked it the older way... with each entity type in its own YAML file. Both ways have pros and cons but they are both better than having everything in one great big configuration.yaml file. Thanks for watching!
@giantbrain5793
@giantbrain5793 8 ай бұрын
By making separation like this, configuration.yaml is neater and more structured
@ResinChemTech
@ResinChemTech 8 ай бұрын
Yes, that is correct. If you start to do a lot of customizations or wish to have things like your YAML-based automations and scripts separated out from the UI-generated versions (so you can better organize and include #comments), having everything in a single configuration.yaml file becomes nearly unmanageable. Packages have pros and cons, but another option that I mentioned is to use the split configuration option and !include: statements in your main configuration.yaml. This is also just a bit easier to setup than packages. Using the split configuration also allows you to migrate a little at a time... you don't have to move everything all at once. But either method leads to a more organized overall configuration when you end up with a lot of manual YAML.
@screever
@screever Жыл бұрын
Why don't use the pencil button. Just mark all Lines and hit the comments or tab bitten and all will get the action
@rickz6006
@rickz6006 Жыл бұрын
Thanks! I for one never knew about the pencil functions, had to fix the indent setting but that is great to have learned. Still hope to get things set up so I can edit in notepad++ someday but other squirrels keep nibbling at my brain.
@WndSks
@WndSks Жыл бұрын
HA PR 71676 says: "The background for this PR is that the MQTT integration itself is setup via a config entry, with entities setup via discovery. MQTT entities can also be setup through configuration.yaml though, and those entities are not aware of the MQTT config entry and thus are not removed if the MQTT config entry is disabled or removed." but I still don't agree with this change.
@ResinChemTech
@ResinChemTech Жыл бұрын
Thanks for digging that up! Although it would have been nice to have received some sort of reasoning/justification for the change (maybe in plain English) from the developers as part of the release notes or some other medium. I'm always waiting for the next shoe to drop every time a new release comes out (I read the breaking changes before I even look at the new features... worrying that another "MQTT update style" change is going to require me to spend hours 'fixing' my system with some new change). Again, I'm sure they had their reasons, but when they make these sort of (what appears to be) arbitrary changes, it has the most impact on their longest term (and probably their most loyal) user base that have years of development and potentially thousands of lines of YAML that are impacted by the change. Again... to me, it just goes back to a lack of communication and a clear roadmap/plans to their user base. Thanks again for taking time to share the PR. I guess for now, it's water under the bridge... until the next time they decide to pull another major change like this 'out of thin air' with no general communication for the reasoning behind it.
@user-ft9zy7wj6d
@user-ft9zy7wj6d 4 ай бұрын
Sir, how to control raspberry gpio using mqtt homeassistant?
@DeKempster
@DeKempster Жыл бұрын
Thanks devs.... got to change 600 lines now... dont fix if it aint broke
@ResinChemTech
@ResinChemTech Жыл бұрын
I hear ya! I'm sure they must have their reasons for the change... but sometimes it just seems that they are punishing all of us 'old-time' YAML guys.. and trying to force us into built-in integrations and UI-generated automations!
@yellowpowerplay
@yellowpowerplay 2 жыл бұрын
super :-)
@ResinChemTech
@ResinChemTech 2 жыл бұрын
Thanks! I think the upcoming MQTT changes may catch a lot of folks off-guard. Especially those that don't pour over the Home Assistant release notes. Hopefully this video will catch a few of those folks and give them a little time to make the necessary changes in their Home Assistant installs before the September release breaks everything! Thanks for watching and taking time to comment.
@sygad1
@sygad1 Жыл бұрын
QQ, If I define a switch or sensor in a package, is it usable in other package files?
@ResinChemTech
@ResinChemTech Жыл бұрын
Yep... it will be a normal entity like any others, accessible from anywhere. This is also why you cannot duplicate an entity name in different packages... so you can't define and name a switch 'switch.bedroom' in one package and define another switch with the same entity type an name in another package. Behind the scenes (to greatly simplify it), Home Assistant is really combining and reading everything as one big file anyway. Packages just provide a different way of organizing all that YAML as opposed to split YAML files or putting it all in one great big configuration.yaml or automation.yaml file. Each method has it's own pros and cons.
@knallaff
@knallaff 2 жыл бұрын
All MQTT devices and entities used to appear under MQTT integration. Not for a long time, why is that and how do I find out now?
@ResinChemTech
@ResinChemTech 2 жыл бұрын
You'd have to ask the developers of Home Assistant for the reason 'why', but I believe it is because more devices are now using native integrations and/or APIs. For example, older versions of Tasmota used something called 'MQTT discovery', which would automatically add the MQTT entities to Home Assistant. Newer versions use the native Tasmota integration, so the entities would now show up under that integration... and not MQTT.... even if they are using MQTT in the background. I think older versions of WLED worked the same way, but now use the native WLED integration. Also note that anything you manually define in YAML will not show up under the MQTT integration either. If you want to see everything using MQTT, then you can use a tool like MQTT Explorer, which will connect to your MQTT broker and show all the entities, topics and payloads that are talking to the MQTT broker. I find this to be an invaluable tool, not only to see what is using MQTT, but also to troubleshoot when a device isn't behaving as expected.
@knallaff
@knallaff 2 жыл бұрын
@@ResinChemTech Many thanks for the information, opinion and tip. With mqtt explorer i finally find my entities and values. Unfortunately, it is still very complicated for me, e.g. to query my electricity or photovoltaic meter in Homeassistant. But time will tell ;-)
@TrillasAdventures
@TrillasAdventures Жыл бұрын
just adding an id to my automations in packages doesnt seem to do the trick. is there anything else I need to do?
@ResinChemTech
@ResinChemTech Жыл бұрын
I'm going to need more information that what you provided. Adding an ID really has nothing to do with packages... it only provide a unique identifier and allows you to do things like access your automations via the tracing and other debugging tools. So, I'm not sure what you are referring to when you say "doesn't seem to do the trick". What are you referring to? Moving to packages is a completely different way to organize your YAML. It will likely involve redoing most of what you already have.. but this is somewhat depending on how you currently have your YAML organized. I'll be happy to try to help, but you need to provide a lot more information.
@TrillasAdventures
@TrillasAdventures Жыл бұрын
@@ResinChemTech oh sorry ive already been on packages for a while. and I was thinking I was forced to migrate all of my automation that were done previously. I didn't even know if packages were still possible. Im just trying to make them editable and traceable while in the packages I already have. do you do id: '123432414'? or no ''?
@ResinChemTech
@ResinChemTech Жыл бұрын
OK... that helps a little. First, you don't absolutely have to move your automations if you don't want to. Home Assistant will work just fine in a "mixed" mode... some things in packages and other things still in separate YAML files (I still have a few things like certain sensors that don't fit nicely in a package as I've organized them, so I still maintain a separate sensors.yaml file out side of any packages). As far as the ID goes, I believe you can use any unique combination of letter and numbers... as long as each is truly unique. I generally use an online UUID generator to create the ID for my automations so that I'm reasonably guaranteed that a number is never duplicated. Then you simply include the ID in your automation, similar to: - alias: My Automation id: fe580fa1-915b-4bd9-845e-dcb337e8151a trigger: ... Now, note that this will not allow you to edit the automation with the UI automation editor. Only automations created via the UI (and kept in the automations.yaml file in the root of your config) can be edited via the UI. However, it should make your automations available in the trace tool. I'm not 100% sure, but the automation may need to be triggered after adding the ID before a trace will be available. I hope that helps. Let me know if you have follow up questions.
@TrillasAdventures
@TrillasAdventures Жыл бұрын
@@ResinChemTech yeah that does seem accurate actually they all have unique ids but I can trace them. NOT edit them. seems like a missed opportunity that should be part of the advanced mode lol
Could Home Assistant be headed for trouble?
14:50
ResinChem Tech
Рет қаралды 40 М.
Home Assistant 101: When to Use Automations, Scripts, Scenes, and Groups
15:36
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 21 МЛН
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 37 МЛН
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 8 МЛН
OMG what happened??😳 filaretiki family✨ #social
01:00
Filaretiki
Рет қаралды 13 МЛН
Home Assistant 101: Creating and Using Packages
19:04
ResinChem Tech
Рет қаралды 3,7 М.
How To Make Your Dashboard Smaller And More Efficient
20:35
Smart Home Junkie
Рет қаралды 43 М.
YAML Basics // Level Up Your Home Assistant Skills
22:58
This Smart House
Рет қаралды 74 М.
MQTT and Home Assistant
11:38
Home Automation Guy
Рет қаралды 110 М.
10 примеров использования шаблонов в Home Assistant
26:46
Домашняя автоматизация
Рет қаралды 9 М.
Create a Pro-Level Dashboard in Home Assistant!
17:40
Smart Home Junkie
Рет қаралды 107 М.
Mastering Home Assistant Templates: A Beginner's Guide
23:56
SlackerLabs
Рет қаралды 50 М.
Getting started with ESPHome
15:24
Let's Automate
Рет қаралды 46 М.
AWESOME EMQX MQTT Broker add-on.  Excellent UI for Home Assistant!
21:33
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 21 МЛН