So, I have a bluetooth challenge where i made some kind of workaround for, but wanted to see if some have better ideas.
I move my homeassistant to a virtual machine with HassOs to have it perform better and be more stable. Ran it for years on raspi3b.
But on the machine I have the virtual machine running, I do not have bluetooth hardware. This was fine for the last 6 months as i didnt think of my pool temperature meter (inkbird sensor). now the pool is being used again, I do not have the direct method of pollilng the sensor from within Homeassistant becuase of the missing bt hardware.
I created workaround, which I do not like that much:
created samba share on HassOs
mounted share on my raspi
crontabbed a python script that fetches sensor reading and writes the value to a txt file on the mounted dir
created file sensor in homeasisstant.
This above is adding little too many complex things to my liking. on top of that, the bluetooth on raspi isnt that stable. Often it requires a hci reset.
Who has ideas to make this more simplified?
Add a bluetooth USB dongle to your VM Host and pass it through to Home Assistant. Or if the Host machine is too far away and you want to keep using the pi, there are plenty of Bluetooth to MQTT bridges. e.g. this is the first search result I found:
I run another Home assistant on RPI zero w which connects to my bluetooth sensors and it connects by LAN to my Main Home assistant which has remote home assistant from HACS. I expect you could run it on WIFI. Easy enough to configure on the main Home assistant. Much better range on RPI ble than on ESP32 ble.
Alternatively @YJB is involved with using ESP32 also for just this job as ble bridge(but with a more limited ble range).
You dont have issues on rpi with ble getting stuck? meaning, the hci reset not required very often?
If thats the case, it might be the distance i have the sensor at is too far away for being stable. RPI is also used for pihole on ETH, rather not have that on wifi, but there is enough eth ports around the house to play with location.
That’s exactly what I need to do, but I haven’t been able to find any straightforward instructions for passing my Mac bluetooth through into my VM. Do you know of any?
In most vm management software, there is USB section to configure. I have virtual box and my zwave stick set and works like a charm. Don’t know apple stuff, but should have similar feature
Occasionally I have to run the Bluetoothctl Power off and then Bluetoothctl commands on the rpi zero when I restart the HA but generally ble sensors will run months on the rpi zero without interference. Usually after few months I have to restart HA due to updates. I also run PIHOLE on a seperate RPI zero with LAN which can be up for 4months at a time without needing anything.
If seems - if I understood things correctly - that it’s not possible to pass through into a VM signals from selected Bluetooth devices (eg iBeacon) while at the same time allowing the Mac host to continue to use standard Bluetooth devices such as keyboard and mouse: it’s all or nothing. Anyway, I’ve now ordered a Rapberry Pi Zero to look after the iBeacon devices that I want to pass through to HA.