Skip to content

Instantly share code, notes, and snippets.

@uSlackr
uSlackr / Readme.md
Created January 3, 2024 02:59
ESPhome temp controller
esphome:
  name: temp-ctrl-1
  friendly_name: Temp Ctrl 1

esp32:
  board: nodemcu-32s
 # framework:
@uSlackr
uSlackr / readme.md
Last active December 28, 2023 03:43
ESPHome with M5 Stack Tube pressure sensor

ESPHome with M5 Stack Tube pressure sensor

Device documents: https://docs.m5stack.com/en/unit/tube_pressure

This device returns a linear voltage (0.1 - 3.1v) based on the pressure. This allows us to use the generic ADC device with EPShome. Due to the limited voltage range of the adc, you have to use the attentuate feature. I used attenuate: auto and it worked fine. I used a lambda function to convert the voltage to pressure (kPA) and to psi. The divide by 6.89... is the psi conversion. Then I round it to one decimal place. I added a device class of pressure and unit_of_measurement of psi.

@uSlackr
uSlackr / 7zipinpwsh.ps1
Created July 27, 2022 01:02
7Zip in powershell
install-module 7zip4powershell
# Extract all rar files in a tree\path
# All files wind up in output path
cd "top-level\folder"
gci -Directory -recurse | foreach {gci "$_\*.rar" | foreach {Expand-7Zip $_ -targetpath t:\some-output\path }}
@uSlackr
uSlackr / Modbus HA and PID.md
Last active February 3, 2022 16:27
Modbus PID Temp controller with Home Assistant

Background

I was asked by a pro-brewer to help him monitor fermentation temp control. In a pro brewery, fermentation control is the key to good and repeatable outcome (aka "good beer"). He uses Solo 4848 PID controllers from Automation Direct inside the brewey to monitor and control temps. What he asked of me was a way to monitor and control the controller(s).

Getting started

My first goal was to connect it to a PC. I purchased a USB <=> RS485 adapter off Amazon and a RTD temp probe for testing. He provided the Solo 4848. Next I downloaded the Solo Configuration software from AutomationDirect. It's free and helped we understand what what happening in the device.
To control the controller via modbus, you must set the On-line Configuration parameter (Cosh, P3-12) to on. This is done through the faceplate controls.
Once set, I was able to see the device with the Solo software via modbus communications.

Once I had this working, I my next goal was get it into Home Assistant using their modbus integra

@uSlackr
uSlackr / mysql_backup.config
Created January 12, 2022 02:08 — forked from mrofi/mysql_backup.config
Bash Script to backup all MySQL databases
[client]
user = "mysql_user"
password = "mysql_password"
host = "localhost"