Jump to content

apnar

Members
  • Posts

    212
  • Joined

  • Last visited

Everything posted by apnar

  1. It won’t help but I had the same issue using the hue emulator built into Home Assistant. Stood it up and the harmony didn’t detect it. I eventually gave up and just used an automation based on something else in the system turning on/off.
  2. That sucks. Are you still running in mirrored mode or did you move fully to nvme?
  3. What is the issue that is making you think you need to revert?
  4. @tazman thanks for giving it a try. Took me a bit but I tracked down the issue. I use a significantly bigger sized virtual disk in my setup but had dropped it down to 16GB when I uploaded it to match what was in the original script. Even though the OVA file from HA is only 800MB they have it configured as a 32GB virtual disk so when it was trying to be copied to the smaller 16GB volume it errored out. Guess that's what I get for thinking a small tweak wouldn't cause any issues. As to the error on line 126, I'm not seeing that but suspect it might be related to posting the shell script on the forum. So I added some extra quoting and I'll upload it as a file here in addition to pasting it. Updated version: #!/bin/sh # Where do we want to storge VM resources (ZFS pool name and mount path) VMFILESET="storage/vms" VMDIR="/storage/vms" # Home Assistant VM name and how much resources to allocate HA_VM_NAME="homeassistant" HA_VM_CPU="2" HA_VM_MEM="1G" HA_VM_DISC="32G" # specify network interface - by default it's Ethernet re0 INTERFACE="re0" if [ $(id -u) != "0" ] then echo "Must be run with sudo" exit fi # Automatically pick the latest release from https://github.com/home-assistant/operating-system/releases/ HA_IMAGE_URL=$(curl -sL https://api.github.com/repos/home-assistant/operating-system/releases/latest | \ grep "browser_download_url.*haos_ova.*qcow2.xz" | sed -e 's/.*: "\(.*\)"/\1/') # Internal variables TMPDIR=`mktemp -d` IMAGE_NAME="${TMPDIR}/haos_ova-x86-64.img" VM_CONF=${VMDIR}/${HA_VM_NAME}/${HA_VM_NAME}.conf # make sure ifconfig_DEFAULT is not set as it causes tap0 interface issues # ensure re0 is set to DHCP sysrc -x ifconfig_DEFAULT sysrc ifconfig_re0="DHCP" echo "Make sure necessary packages are installed" pkg install -y vm-bhyve edk2-bhyve wget qemu-tools echo "Prepare /etc/rc.conf" sysrc vm_enable="YES" sysrc vm_dir="zfs:${VMFILESET}" # this makes Home Assistant VM start up automatically on boot, comment out if this is not desired sysrc vm_list=${HA_VM_NAME} echo "Create ZFS fileset for VMs and prepare templates" zfs create ${VMFILESET} vm init cp /usr/local/share/examples/vm-bhyve/*.conf ${VMDIR}/.templates/ # create VM networking (common for all VMs on the system) vm switch create public vm switch add public ${INTERFACE} echo "Downloading image" wget -O ${IMAGE_NAME}.xz ${HA_IMAGE_URL} echo "Extracting..." unxz ${IMAGE_NAME}.xz echo "Creating a VM" vm create -t linux-zvol -s ${HA_VM_DISC} ${HA_VM_NAME} echo "Image info:" qemu-img info ${IMAGE_NAME} echo echo "Copying image... (may take a bit of time)" qemu-img convert ${IMAGE_NAME} /dev/zvol/${VMFILESET}/${HA_VM_NAME}/disk0 rm -rf ${TMPDIR} GRAPHICS=0 echo -e "\n\nDo you want to enable unauthenticated VNC access to your Home Assistant virtual machine? (y/N)" read answer if [ "$answer" = "Y" ] || [ "$answer" = "y" ] then GRAPHICS=1 sysrc -f ${VM_CONF} graphics="yes" fi ## Initial setup TMPDIR=`mktemp -d` # set zvol to full so partitions are visable zfs set volmode=full ${VMFILESET}/${HA_VM_NAME}/disk0 sleep 2 # set baud rate for serial console mount -t msdosfs /dev/zvol/${VMFILESET}/${HA_VM_NAME}/disk0p1 ${TMPDIR} # add serial console to linux boot command line sed -i '' -e 's/console=ttyS0/console=ttyS0,115200/' ${TMPDIR}/cmdline.txt # umount device umount ${TMPDIR} SSH=0 echo -e "\n\nDo you want to enable SSH access to your Home Assistant virtual machine? (y/N)" read answer if [ "$answer" = "Y" ] || [ "$answer" = "y" ] then SSH=1 ## SSH Access # install ext4 fuse driver and load it pkg install -y fusefs-lkl kldload fusefs # mount vms /root/.ssh directory lklfuse -o type=ext4 /dev/zvol/${VMFILESET}/${HA_VM_NAME}/disk0p7 ${TMPDIR} sleep 5 mkdir -p ${TMPDIR}/root/.ssh chmod 700 ${TMPDIR}/root chmod 755 ${TMPDIR}/root/.ssh # create a new SSH keypair and at it as an authorized key in the VM ssh-keygen -t ed25519 -N "" -C "Access Home Assistant running on eisy on port 22222" -f /home/admin/ha-ssh-key cp /home/admin/ha-ssh-key.pub ${TMPDIR}/root/.ssh/authorized_keys # set perms so admin user can access the ssh keys chown admin:admin /home/admin/ha-ssh-key* umount ${TMPDIR} fi ## Clean up # switch zvol mode back to normal zfs set volmode=dev ${VMFILESET}/${HA_VM_NAME}/disk0 sleep 5 rmdir ${TMPDIR} sysrc -f ${VM_CONF} loader="uefi" sysrc -f ${VM_CONF} cpu=${HA_VM_CPU} sysrc -f ${VM_CONF} memory=${HA_VM_MEM} vm start ${HA_VM_NAME} vm info ${HA_VM_NAME} vm list echo -e "\n\n##########################################################################\n" echo "Please wait about 10 minutes and follow instructions at https://www.home-assistant.io/getting-started/onboarding/ to get your Home Assistant setup" echo "ISY integration: https://www.home-assistant.io/integrations/isy994/" echo -e "\nIf you need console access to the HA VM you can run \"sudo vm console ${HA_VM_NAME}\" then log in is as root. Use \"~~.\" to exit." if [ "$GRAPHICS" -eq "1" ]; then echo -e "\nYou can access your HA VM via VNC on port 5900 at your eisy's IP address." fi if [ "$SSH" -eq "1" ]; then echo -e "\nYou can access your HA VM via SSH using \"ssh -p22222 -i ha-ssh-key root@{HA VM IP}\"" fi md5 of script is 93f64d030f2531578df06c46d35c8056 create_ha_vm.sh
  5. I finally had a few cycles to take a look at this. I wrote up a modified script that will use the VM based Home Assistant images instead of the one meant for bare metal. I also added some other tweaks that allow you to choose to enable access to the VM via console, VNC, and SSH during install. Unfortunately there isn't an easy way to "fix" an existing install so you'll need to start from scratch or you can try backing up and restoring your HA config but no guarantees there. To start this will delete your current VM and all related configs. It will completely destroy your existing Home Assistant VM so only run this if you want to start fresh or are sure you have all the backups you need. sudo vm poweroff -f homeassistant sudo vm destroy -f homeassistant sudo vm switch destroy public sudo zfs destroy storage/vms Here is a new create_ha_vm.sh script. Save it and run it with sudo. see updated version below @Michel Kohanim it might be worth updating the blog post with this script so new installs get the proper image.
  6. The error is legit, but it is just a warning. The script on the blog uses the generic x64 OS image instead of one of the VM tailored images. They don’t have a FreeBSD VM image specifically but when I have some time I’ll see if I can get one of the other VM images running instead. For now it should be reasonably safe to ignore.
  7. Looks like the partition table on your NVME drive is corrupt somehow. You can try recreating it with: sudo gpart destroy -F nvd0 sudo gpart create -s GPT nvd0 Then reboot and retry the same commands from my message above to see if you get better results. Might also be worth trying reseating the NVME drive physically.
  8. The scripts as they exist today appear to all be one way. If you want to go back to a mirror I could likely put together some commands you could run. If your drive dies support should be able to help you get the base OS back. You should be backing up your configs though.
  9. What does “sudo gpart show nvd0” show? And “dmesg | grep nv”?
  10. I suspect that this will be an issue for anyone with a zpool beyond the default eisy one(zudi). So folks that still boot from eMMC and add a drive, folks that mirror or boot from NVME and added an extra pool. Basically anyone that has an extra zpool (most likely called /storage). Easy enough to test, just reboot and see if /storage is there (or visible is in “zpool status”). Should be no harm in creating the directory: “sudo mkdir /etc/zfs” You may need to do a “sudo zpool export storage” then “sudo zpool import storage” to then get the correct cache file created once the directory is there.
  11. @Michel Kohanim Ran into another small issue. On reboots my zfs pool /storage wasn't mounting automatically. It worked fine if I did a "zpool import storage" after boot. I tracked down the issue to a missing /etc/zfs directory which stopped the creation of the normal zpool.cache file. It's possible that it's something I missed in my manual steps recovering from the issue above but I don't see it created in any of the scripts. So I'd suggest adding a line to the scripts somewhere to creates /etc/zfs.
  12. I don’t know about hot swapping but I’ve used the Zwave half with HA before and see no reason why the Zigbee half would t work as well.
  13. @Michel Kohanim Just ran through the new easy way. Ran into an error which I tracked down. Sort of my own fault but I think you could improve the script a bit to avoid it. The prompt reads: Would you like to add an extra ZFS partition for your own purposes? (Y/n) As a regular *nix user I read this to be there are two choices yes or no and that yes is the default since it is capitalized. As such I just hit Enter to accept the default since that is what I wanted to do. This resulted in the following error: [: =: unexpected operator Checking the code is because the check on the result isn't properly in quotes. It also ended up giving a result opposite to what I wanted. Luckily the rest of the script continues on smoothly, just without creating the extra partition. I was able to go back, manually remove the partitions and recreate them as the script would have, just a bit of annoyance and likely outside the skill set of many. TLDR; I suggest changing line 352 in /usr/local/etc/udx.d/static/fl.ops from: if [ $answer = "Y" ] to something like: if [ "$answer" = "Y" ] || [ "$answer" = "y" ] || [ "$answer" = "" ] and while all the other questions in the script do properly quote $answer I'd be worth updating them to handle both cases as well as enter for accepting the default.
  14. Micheal, Love that we now have a supported way to use NVME, thank you! I’d like to see an intermediate option between the mirror and no-mirror options, as I want the speed of the later with the protections of the former. I think this could be accomplished well with an asynchronous “mirror” that syncs a couple times a day. If my drive does fail I’d much rather have a backup from some time in the last 24 hours as opposed to nothing, especially since there aren’t a lot of changes happening on my eisy. Since you’re using ZFS this should be reasonably easy to accomplish using ZFS send/receive. At whatever scheduled time you take a snapshot of the NVME drive and send it to the eMMC, then delete the snapshot from the previous run. Could be a simple script you guys whip up or leverage something like zrepl or sanoid. Thanks for considering!
  15. I’d love to be able to firmware update all my devices to ignore “all-on”. There are also a couple bugs with how KPLs turn off scene buttons when pressed that I have to work around with programs. I’d even pay money to buy an Insteon specific flasher and manually flash all my devices by hand. I suspect it’s possible but likely a customer service nightmare.
  16. apnar

    Polisy OS Crash?

    I saw the email. I take it his concern is folks running "sudo pkg update && sudo pkg upgrade -y". If instead we were told we could run something like "sudo update-polisy" which did all the correct things in the correct order I think everyone would be happy.
  17. apnar

    Polisy OS Crash?

    @Michel Kohanim can you give us the SSH command that corresponds to clicking the Upgrade Packages button in the console? I've got to imagine it's calling a script in the OS that we could just call directly. It's so much of a better user experience running an upgrade via the console, it allows us too see what's going on, if there are any errors, and when it's completed. The UX experience of clicking a button only for the UI to entirely disappear and then have us sit around next to our devices hoping to hear a series of beeps is not user friendly at all (as noted many have their devices in places that aren't physically accessible or have issues hearing the beeps).
  18. I moved over to ISY on Polisy a few months back and it's been great so far. Today I had to replace an Insteon dimmer switch and it didn't go as planned. Added the new switch in the console then did the usual replace in console. I don't recall the exact wording but it said something along the lines of needing to open a new window. I exited the console and restarted it. The new device had taken the old ones place as it was supposed to have, showed proper new ID and such but the new device wasn't responding to any scenes that the old device was in. Tried a restore on the device but still wasn't reacting in scenes. I queried the devices link table and it only had 1 record in it. The ISY table for the device showed the same. Luckily the device was only in a few scenes so I removed it and readded it to each in the console which got everything back to the way it was supposed to be. Has anyone else had success replacing a device in IoP? Is there a step I missed somewhere (I recall the 994 used to reboot on a replace)?
  19. In case anyone is interested this is an example of the config I use in HA for one of my fans (with HA talking to my ISY). In this case the real fanlinc is "fan.guest_room_fan" and I'm creating a new virtual fan called "v_guest_room_fan". I also have 4 scenes guest_room_fan_med (and off, high, low) which do what you expect and include the KPL buttons. I have it set so a "on" turns it on at medium: fan: - platform: template fans: v_guest_room_fan: unique_id: v_guest_room_fan_id friendly_name: "Guest Room Fan" value_template: "{{ states('fan.guest_room_fan') }}" percentage_template: "{{ states.fan.guest_room_fan.attributes.percentage | float }}" turn_on: service: switch.turn_on entity_id: switch.guest_room_fan_med turn_off: service: switch.turn_on entity_id: switch.guest_room_fan_off set_percentage: service: switch.turn_on data_template: entity_id: > {% if percentage > 90 %} switch.guest_room_fan_high {% elif percentage > 50 %} switch.guest_room_fan_med {% elif percentage > 10 %} switch.guest_room_fan_low {% else %} switch.guest_room_fan_off {% endif %} speed_count: 3 I do this for every fan in my house, then I expose just the virtual fan to Alexa (via HA instead of ISY). It'd be cool if this sort of thing was built into ISY Portal. It might be possible to do something like this with a Node server as well, but I don't know of any today that'd do it.
  20. What are exposing to Alexa though? Wouldn’t you need to expose all 4 scenes, each as their own device for this to work. I’d think on the Alexa side it’d look like 4 on/off switches.
  21. The problem with this is then you can’t tell Alexa to set the fan to a level or have the right level displayed. You end up with 3-4 different devices as you need one for each scene.
  22. I solved this with Home Assistant and their template feature. I used the template to create a virtual fan for each of my fans. Its status is pulled from the fan linc but each action to set the speed calls one of 4 Insteon scenes which include the KPL buttons. That way I have a single device I can control that sets everything the way I want. I then expose that virtual fan to Alexa.
  23. Not a full fix but you should also be able to change the button mode so in the event you are in the “bad” state (kpl show off but fan is on) you can just hit off again as opposed to having to turn it on and off again.
  24. Just posted in that linked thread an approach to do room aware commands using NodeRed as an intermediary.
  25. Having failed to get this to work for my fans for years, let alone other device types I ended up using a different solution. Using NodeRed I was able to create room aware commands for everything I wanted to (fans, TVs, blinds). Here is the post that got me going and I posted there with my updated config: https://community.home-assistant.io/t/approaches-to-room-aware-voice-commands-for-alexa-with-node-red/165399
×
×
  • Create New...