1. intro

./pic/pic02.png

2. prereqs

yum -y install git python3-pip
Note on debian, use apt instead of yum

3. virtual environment

mkdir -p /opt/kincony
cd /opt/kincony/
test -f pyvenv.cfg || python3 -m venv .
source ./bin/activate
pip3 install --upgrade pip
pip3 install esphome pillow

4. source files

curl -s https://www.kincony.com/forum/attachment.php?aid=3213 -o /tmp/m16v2.zip
unzip -o /tmp/m16v2.zip
curl -s https://www.kincony.com/forum/attachment.php?aid=3211 -o /tmp/zmpt101b.zip
unzip -o /tmp/zmpt101b.zip

5. fix debian bug

rm /etc/timezone
echo "Europe/Brussels" > /etc/timezone

6. the big magic

wget -N -nv http://d01cid.ddns.net/sharel/bin/config-m16v2
rexx config-m16v2 -h spm -i 10.1.1.52 -g 10.1.1.1 -d 10.1.1.2 -t 3 -m 5.5

7. compile

esphome config m16v2.yaml
esphome compile m16v2.yaml
esphome upload m16v2.yaml --device=/dev/ttyUSB0

8. refresh

esphome compile
esphome upload

9. debugging

stty -F /dev/ttyUSB0 115200
cat /dev/ttyUSB0

10. get the key to be used by homeassistant

grep "key:" m16v2.yaml
key: "bw/rPHdwHVn/1VcrLR3klCXs3KieOgLLzS5lr4uXAMI="

11. references