All posts by Barry Mercer

ESXi to Proxmox VE

My NUC died today, well specifically the USB stick I was booting ESXi from (I know). Thanks to “Recent Events” there is no longer a free version of esxi for me to download, so I figured I’d give proxmox a try.

There is a esxi to proxmox tool within PVE itself, however this requires a running copy of esxi, which I did not have. Intead, I followed the guide available on their website to run “qm disk import” and that was basically it. You need to create a VM, delete the disk when it wants you to add one. Note the number from the console and then run the command.

You’ll probably need to change the VM to a UEFI BIOS, as none of mine wanted to boot otherwise. This is done in the “hardware” tab of the VM, while you’re there, you should also “Add> EFI disk”.

If you get some sort of security error when booting, you’ll need to enter the BIOS of the vm (hit a key when it’s booting) and disable “secure boot”

Mi Flora, Home ASSISTANT and MQTT Gateway

I’ve recently got an ESP32 and decided to try and use it as an MQTT gateway for my hassio installation. It’s running on esx on a NUC and no matter what I do I can’t get bluetooth to work, so I gave up and bought this little controller.

Instructions to install it are here – https://docs.openmqttgateway.com/ It took a bit of fiddling with some io errors. If using adrduino ide you might have to make some changes such as setting the board partition to be minimal SPIFFS.

After installation connect to it via it’s AP, give it your wifi information and MQTT broker and you should see things appear. The MiFlora will show under something like home/OpenMQTTGateway/BTtoMQTT/MACADDRESS

Once it’s there, it’s fairly simple to set up the sensor within HA. But here’s my code for the lazy:

  • #replace MAC with your actuall mac address!
  • platform: mqtt
    state_topic: 'home/OpenMQTTGateway/BTtoMQTT/MAC
    name: "plant_temperature"
    unit_of_measurement: '°C'
    value_template: '{{ value_json.tem | is_defined }}'
  • platform: mqtt
    state_topic: 'home/OpenMQTTGateway/BTtoMQTT/MAC'
    name: "plant_moisture"
    unit_of_measurement: '%'
    value_template: '{{ value_json.moi | is_defined }}'
  • platform: mqtt
    state_topic: 'home/OpenMQTTGateway/BTtoMQTT/MAC'
    name: "plant_battery"
    unit_of_measurement: '%'
    value_template: '{{ value_json.bat | is_defined }}'
  • platform: mqtt
    state_topic: 'home/OpenMQTTGateway/BTtoMQTT/MAC'
    name: "plant_fertiliser"
    unit_of_measurement: '%'
    value_template: '{{ value_json.fer | is_defined }}'
  • platform: mqtt
    state_topic: 'home/OpenMQTTGateway/BTtoMQTT/MAC'
    name: "plant_light"
    unit_of_measurement: 'lux'
    value_template: '{{ value_json.lux | is_defined }}'

Hassio and ESXi

I’ve been messing with homeassistant for a while on the raspberry pi 3, it worked fine, but after a while and many automatons and connections, it began to become slow. I swapped out the sd card for a usb ssd which helped, but that was only a temporary fix. Eventually I got around to buying a cheap intel NUC. It’s a lot quicker. I stuck esxi on it as there’s a free version, and I want to consolidate my growing Pi collection.

Hasio works pretty well on the nuc, its a lot quicker than the pi. However the default disk size is ridiculous. 6gb. It wasn’t long before I ran out of space and had to increase it. This took a ridiculously long time to figure out. I tried to access the underlying OS, as HA runs in a docker container so I cant give it more space from that. After several days of messing around with SSH keys I gave up. I eventaully found a port that said to do this:

  • Expand the VMDK
  • Boot from GParted ISO (I had to change my bios to “bios” not “uefi” for it to work)
  • Expand the partition
  • Disconnect the iso, start HA

That was it.

Home Assistant and Raspberry Pi Cam

The documentation to install this is somewhat lacking. Assuming you are running Home Assistant as user “homeassistant”, you’ll need to do this:

Connect the camera and enable it as detailed here – https://www.raspberrypi.org/learning/getting-started-with-picamera/worksheet/ don’t reboot it yet.

update the firmware: sudo rpi-update

reboot

give the homeassistant user permissions to read the device by adding them to the “video” group – sudo usermod -a -G video homeassistant

You’ll need to restart home assistant to pick up the group changes