Home About Meetings FOSS

March 11 2025 Home Assistant, yaml, AWK

Posted on March 16, 2025
( 6 minute read )

Brian described how he had tackled a problem when parcels are delivered; he normally only gets advice of the delivery shortly before it happens and he may be too far away from home to return in time for the delivery.

Home Assistant manages the door control which sends a tremolo which is AC and has to be converted to DC. He can set this signal so that it will automatically open the door. The ESP8266 manages the relays which require 5 volts; however, the ESP8266 has no 5 volt output, only 3.3 volt pinouts. So he takes 5 volts from the lead to power the relays.

Note that the D1 mini has 5 volt output — so he also uses these — while the ESP32 has bluetooth and can pick up the readings from sensors.

With Home Assistant you can program things in yaml and ESPHome tells you what to put in the yaml file; you have to indent like Python. He has programmed it to turn on the relay for four seconds; this takes the lock off the door for four seconds so that someone can push the gate and come in.

Steve raised security concerns about this arrangement and Brian said that it is controlled by whether his mobile is receiving wi-fi or not. If he is out, his mobile is not receiving wi-fi and so the script runs to release the lock; if his mobile is receiving wi-fi, he is at home and the script does not run. Steve wondered whether it was limited to one occurrence and Brian said that was a good idea; he could implement that by putting a sensor in the parcel box so that, when the parcel was delivered, the system would switch off.

Brian noted that Home Assistant can validate your yaml but it doesn’t tell you what is wrong. However yamllint will check your yaml though sometimes it says line 1 is wrong when it isn’t.

Darren asked about automation and Brian said that, in Home Assistant, you can create automations by selecting a device or its entities. If you examine a device, Home Assistant tells you what entities it has. You can then automate by giving an entity a state which is a trigger which may be linked to other conditions to activate the action. You have to create one automation to switch something on and one to switch it off.

Steve asked about presence detection via a mobile and Brian explained that the Home Assistant Companion app is available on a mobile ’phone but not on a laptop. It polls the server and Steve wondered what impact that would have on the battery. Brian said that it was not much though David said that Home Assistant Companion used twice as much as another similar app.

Steve mentioned that he has a device to plug an ESP8266 into a USB. He has a Tuya module pin-compatible with ESP and uses the Tasmotizer to program it.

Darren was going to give a presentation on AWK, the data extraction program, but his browser, Falkon, did not support screen sharing. The following presentation is what he was going to say. The example files are cat_in_awk.awk, cat_slow.awk, sort.awk, sum_categories.awk and sum_input.awk.

David reported that he had got part way through soldering up Klipper but had used the wrong sort of wire; so he has made no progress since last month. He also reported that he had added a SATA card to his desktop but the sticky pad behind the heat sink had dried out and so it was not sinking the heat and the SATA channel was not working properly.

He also mentioned that, in Home Assistant, the sliders are not calibrated for the dimness/brightness to devices; everything happens in the middle of the scale. Brian suggested that you can specify a maximum value for a slider; he also noted that in the recent release the overview had changed. He also noted that you can do Node_RED in Home Assistant because it knows all the entities.

Steve said he was using it to check the TV and turn the amplifier off when the TV is off because the amplifier uses a lot of electricity. Brian said that he had set Home Assistant to know when the TV is on and then turn the amplifier on.