Where to Manually add things

Hey folks, I am going to go ahead and apologize that I am probably an idiot and/or missing something painfully obvious, usually i can wade through about anything but I am lost as can be right now, and the documentation is not helping. for context I have been working on servers and networking since some here werent alive, so im old but I can still troubleshoot.

Anyway,

So Today I decided to jump into home assistant to create some automated routines around the house and create some local webhooks. I downloaded the VMDK, converted it and resized it then put it in my unraid server, created the VM, assigned the random MAC a static and everything was running fine.

I added the file browser and terminal, and since my primary platforms are Lutron, Hue, and TP-Link Kasa I added TP-link. It discovered lots of stuff on my network, at least on my primary VLAN. Its missing a couple of outlets, and its not seeing anything on a separate vlan (is there a way to configure this?). So I thought whatever, added a nic for that VLAN and of course that didnt help so I reverted.

Now I started digging for configuration files to add or edit entities/devices… but my configuration.yaml is essentially empty.

So, can someone point me in the general direction of where devices and entities are stored/manually added, And is there a way to tell the server to access another vlan (its routed, bypasses the firewall internally, shy of broadcast its just another vlan, the only difference is its a /24 and my main is a /21)

Help? Yeah I know im an idiot, but I have spent hours just looking for a config file that has any of my data in it.

Welcome to the HA community!

…but you did find it and it has some code in it?

I’d suggest starting off straight up using Packages since they keep things nice and organised rather than trying to switch to using them later.
Essentially you need to create a folder called ‘packages’ in your ‘config’ folder and then put new yaml files in there for each new ‘thing’ you want code for.

eg:
config\packages\kitchen_light.yaml

Hi Dave, thanks for the quick reply.

Yes it has this in it:

Configure a default setup of Home Assistant (frontend, api, etc)

default_config:

Text to speech

tts:

  • platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Going to look into the packages now. let me ask another dumb question, where is it putting the devices that it discovered? I dont seem to see a file around with that info, other than maybe its in the database, but I wouldnt expect configuration like that to be written to the DB on discovery. though maybe I am crazy.

They should be listed under Configuration-> Integrations in the GUI. The data is saved in a JSON file which I’d strongly advise not to try editing.

OK, yeah, im not going to touch the json unless I have to.

So you recommend packages for the 3 devices I need to manually discover for the TP-Link integration? Ill have to see how to tell it to use that integration but I think I saw some documentation on that.

Thanks!

It’s super easy for those devices:

The way I organise my code is by device or function. So for example I have a TP-Link socket used to monitor the washing machine.

That package contains not only the code for the device integration but the automations as well. It’s just a nice way to keep related code together. You don’t have to follow this approach, it’s personal preference.

config\packages\washing_machine.yaml

###  ALL CODE RELATED TO THE WASHING MACHINE   ###

input_select:
  washing_machine_state:
    name: Washine Machine is
    icon: mdi:washing-machine
    options:
      - 'Off'
      - Idle
      - Running
    initial: 'Off'

tplink:
  discovery: false
  switch:
    - host: 192.168.0.60

sensor:
  - platform: template
    sensors:
      washing_machine_power:
        friendly_name: "Washing Machine Power Consumption"
        value_template: '{{ states.switch.washing_machine.attributes["current_power_w"] | float }}'

### <2W = off
### >3W = idle
### >7W = filling
### >90W = washing
### >200W = spin

automation:
  - alias: 'Washing maching -status tracker- Idle'
    trigger:
      - platform: numeric_state
        entity_id: sensor.washing_machine_power
        above: 2
        for: '00:00:05'
    action:
      - service: input_select.select_option
        data:
          entity_id: input_select.washing_machine_state
          option: Idle

  - alias: 'Washing maching -status tracker- Running'
    trigger:
      - platform: numeric_state
        entity_id: sensor.washing_machine_power
        above: 5
        for: '00:00:05'
    action:
      - service: input_select.select_option
        data:
          entity_id: input_select.washing_machine_state
          option: Running

  - alias: 'Washing machine -status tracker- Off'
    trigger:
      - platform: numeric_state
        entity_id: sensor.washing_machine_power
        below: 2
        for: '00:01:00'
    action:
      - service: input_select.select_option
        data:
          entity_id: input_select.washing_machine_state
          option: 'Off'

  - alias: 'Washing machine finished notification'
    trigger:
      - platform: state
        entity_id: input_select.washing_machine_state
        from: Running
        to: Idle
      - platform: state
        entity_id: input_select.washing_machine_state
        from: Running
        to: 'Off'
    action:
      - service: notify.mobile_phones
        data:
          message: 'The washing machine has finished'
          data:
            ttl: 0
            priority: high

Oh this is nice, thank you so much for showing me this before I got too far.

2 quick last questions.

  1. do you know a way to make discovery aware of another subnet/vlan? If not its no big deal
  2. Nevermind - Edited

I’m not too sure about VLAN’s as I’m just learning about them. The is a great series by The Hook Up on YouTube which explains how to set them up to allow everything to work properly