What cpu are you using in your NUC?

Woody,

I got it all setup like you showed with MQTT user and password to my server. How do I know if it is working?  I do not see any data being pulled into the MQTT. Is there something more I need to do to make it show that data? I did a package to pull the CPU temp using the  cat /sys/class/thermal/thermal_zone_1/temp since that seems to be the one that shows a temp of 42000 and the temp0 shows a -  263200 value. So how do I pull this cron job information into HA?  Thanks a bunch for this it is the only thing I can get to monitor on the system. I tried to install Netdata application on the NUC but no joy there.

Do you have mosquitto installed on the instance youā€™re running the py file?
You can check executing mosquitto_pub and if it works just double check the MQTT credentials.
You should see in MQTTā€¦

The MQTT is running on a VM on Proxmox under HASSIO addons I put the IP, Username, and Pass to it but it is not showing up in the MQTT section of HA. Does this have to run on Proxmox or the VM because the file is in the root of the Proxmox server not the VM.

I have it as Hasio addon and itā€™s working perfectly.
I have the addon called MQTT and Web Client or something similar.

Then if you want to execute the MQTT publish (via mosquitto_pub) from Proxmox (not from the VM with Hassio), you need to install moquitto also there, at least the client part

Can you run the cron job in the VM using the file.py? If so I can move it there but did not know if you can do that in the HA VM. I know the commands are limited in the shell. Also in the crontab I put it in as below correct?

          • /root/file.py
          • (sleep 30 ; /root/file.py )

Now on the IP for the MQTT do I need to put a port number? XX.XX.XX.XX:1883 or 1884?

Of course you can run it in the VM, but I donā€™t know if the values are the same that you can get directly on Proxmoxā€¦

That is what I was thinking too since that information would come directly from the server of Proxmox. So I followed your instructions and put it in the root folder. Did the Crontab like you had it by copying and pasting it to the bottom of the Crontab and then restarted service. Now in the file I only put the IP of the MQTT host, username, and password for the MQTT server. I checked the MQTT logs but I do not see the pub coming from the Proxmox server at ip 192.168.1.3 to HA 192.168.1.4. I would think it would show up under the log files.

Try to use an MQTT client, like MQTT Explorer, configure with the MQTT server and credentials and you will see all the MQTT messages

Ok I liked in MQTT Explorer and did not see them so ran the file.py script in the shell and I got this but the IP address is correct as well as username / password (I removed the real ones).

mosquitto_pub -h 192.168.32.4 -u mqtt -P 123456789 -t topic/cputemp -m $temp
^
SyntaxError: invalid syntax

The pointer is under the 8 of the 168 in the address. It does not come out when I post it.

Its trying to work but does not like that IP or do I need the port too?

Does mosquitto_sub work?

What NUC-like clone are you using? Iā€™m looking (if possible) for a fanless box that will will handle hass.io (Iā€™ll run HassOS just because I donā€™t want to deal with managing another box.).

Thanks.

I bought this: https://www.aliexpress.com/item/32814284342.html?spm=a2g0s.9042311.0.0.329f4c4dKx1pFX though at the time, mine was supplied with an older generation CPU vs. the Core i5-7200U thatā€™s currently in the product listing. Also 16GB of RAM, mostly just because and 256G SSD. If I were to do it again, Iā€™d do the ā€œNo SSDā€ option and just install a Samsung M.2 NVMe flash module (which Iā€™ve also subsequently done). Mine has an Intel Core i5-6200U CPU running at 2.3GHz. This is certainly some amount of overkill.

I was optimizing for reliability, so no moving parts - no fan, no spinning disk. If it moves, it will break, eventually. So I was willing to spend a bit more $$$ to achieve that goal. The different in cost (right now) between 4G and 16GB of RAM is about $70 (from them). More RAM, more better!

Note that Iā€™m running an Ubuntu 18.04 ā€œserverā€ install (with no desktop environment), and vanilla Docker and the Home Assistant docker image, not HassOS.

If youā€™re curious, hereā€™s what the inside looks likeā€¦ The SATA flash drive is mounted on a bracket on the lid. The CPU is on the back of the PCB and coupled to the body of the case which is just a big heat sink for passive cooling.

Hereā€™s a close-up of the NVMe and M.2 connectors

Looks to be reasonably well constructed, complete with the hot-snot on stuff to keep things from rattling loose during shipment and use.

1 Like

Thanks! Iā€™m looking for a less beefy machine to keep costs down. Iā€™ll keep looking.

Good luck! The path I went down optimized for some amount of expansion flexibility and reliabiliy vs. cost.

Some of my goals was also to migrate Plex over this platform, and also an IP camera DVR thing as well. Both of those access bulk storage via NFS from a separate FreeNAS server (and Home Assistant and automation/control will continue to work even if the NAS is offline.)

I also added the NVMe flash and moved influxdb and the home assistant recorder database over to it, in an attempt to make the historical graphing stuff go faster by using the NVMe storage with higher IOPS capacity than even SATA-attached flash.

Pricing of stuff from Ali Express seems to vary wildly due to stupidity in US tariff fees (which manifest as stupid-high ā€œshippingā€ charges.) So that factors in all this as well. Good luck!

if you execute mosquitto_sub directly from the Proxmox console, does it work?

Thanks! My needs are pretty basic. Iā€™m currently running HassOS on a VM on my Mac Pro, but want to put it on a dedicated box for future plans of being able to shut off my Mac Pro at night. My DVR will stay on the Mac Pro and the NVR that currently runs on the Mac Pro will migrate to another box. I still need to run influxdb, grafana and pihole on it (as Hass.io plugins), but I donā€™t think that will take much power. The fanless is pretty key to me. There are some cheap Atom based boxes without fans, but they might be a tad underpowered.

I purchased a refurbā€™d Intel NUC6I5SYK i5-6260U DDR4 NUC -4GB, no operating system on eBay for $229. Been using it about 2 months now.

Nope get the same if I run mosquitto_pub too, not sure why it is not reaching it. Now the Proxmox is on 192.168.1.3 and the MQTT is on 192.168.1.4 VM on the proxmox but that should not matter. Its saying the IP address has a syntax error but I put it in correctly. I tried to add port number and no joy there.

bash: mosquitto_pub: command not found
bash: mosquitto_sub: command not found

My NUC i3 was gently used on eBay. Great deal, like new, put in an m.2 NVME stick and 8 GB RAM SODIMM and boom, tons of headroom.

You have to install manually mosquitto on Proxmox via console. You find how to install it googling.