Hello,
because I wanted to play around with HomeAutomation issues a little bit, I intended to buy an raspberryPi 4 , because there are lots of tutorials how to start with it.
Unfortunately they are hard to get and so I found some articles, describing how one used their NAS for HomeAssistant server.
So I gave it a try, but it took me quite some time to get „HomeAssistant“ eventually running on my WD mycloudEX2ULTRA. Because some people might be interested in giving their device an additional task, I put together my experiences.
I will guide you step by step and link some pages, that had relevant information for me.
1. Upgrade to version 5 of mycloud firmware
I did not make it, to get docker running on version 3 – so please upgrade first.
2. Install docker on your device
Docker auf einer WD MyCloud installieren - geht! - WD Deutsches Forum / Netzwerk Laufwerke - WD Community [German]
download installation file
Docker 20.10.15 · JediNite/wdpksrc (github.com)
Install with menu entry „Apps – install an app manually“
3. Enable SSH on device
Menu entry Settings ->network
4. Assigning new port for portainer, when using Twonky
Twonky & pre-installed portainer unfortunately use the same port 9000
As you can’t change the port for Twonky, here is the instruction, how to change for portainer
Port number for Portainer - Docker - openmediavault
Login to your device by ssh
If portainer is already running, you have to stop it before you can start the new instance with a different port assignment
docker run -d -p 9001:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
You can also change the link of the WD-UI:
Docker Install on PR4100 · Issue #37 · WDCommunity/wdpksrc
You may want to edit the redirect in /shares/Volume_1/Nas_Prog/docker/web/index.html
to point to the new port and also change the script /shares/Volume_1/Nas_Prog/dockerupdate_portainer.sh
.
5. Home Assistant dockerfile
When trying to start the „homeassistant:latest“ I noticed several problems
First of all there is the JEMALLOC issue, so make sure you always set the ENV variable.
DISABLE_JEMALLOC true
Furthermore there was an issue with „wheels“.
2022.7.x docker container broken on 1st gen Raspberry Pi · Issue #75142 · home-assistant/core
So I used 2022.6 docker container for home assistant to setup.
When I wrote this tutorial, I had a look again and found out, that the issue was just fixed.
So I updated and I’m happy to have the current system running now:
Here is the docker-compose, I use as stack in portainer.
version: "2"
volumes:
homeassistant_data:
external: true
services:
homeassistant:
container_name: HomeAssistant
image: linuxserver/homeassistant:latest
restart: unless-stopped
volumes:
- homeassistant_data:/config
So when your container is running, you should be able to reach HomeAssistant on port 8123 of your WDmyCloud IP adress.
Congratulations → you basically made it !
6. Install HomeAssistant configurator (text-editor)
For some small hacks and configurations you could need a handy editor.
I don’t understand why, but the configurator is not part of the docker distribution of HomeAssistant.
But we can run it as a separate docker-file
Home Assistant Container Part 6: Editing configuration.yaml from within Home Assistant :: Sequr
And here is my docker-compose, which matches directly to my HomeAssistant stack:
version: "2"
volumes:
Configurator:
external: true
homeassistant_data:
external: true
services:
hass-configurator:
container_name: hassconf
image: causticlab/hass-configurator-docker
restart: unless-stopped
ports:
- "3218:3218/tcp"
volumes:
- Configurator:/config
- homeassistant_data:/hass-config
7. Getting basic health values for your NAS
Having set up HomeAssistant as your dashboard, you might want to keep an eye on your devices health status.
You can start with the basic ones of the included systemmonitor.
System Monitor - Home Assistant
8. Getting more info with SNMP Sensors
I’ve been inspired by this post:
WD EX4100 NAS SNMP Sensors - Share your Projects! - Home Assistant Community
Unfortunately the WD mycloudEX2Ultra seems to use different OIDs, so here is the part from my sensors.yaml what I got working so far:
- platform: snmp
name: 'NAS Disk 1 Temperature'
host: 192.168.1.8
baseoid: 1.3.6.1.4.1.5127.1.1.1.8.1.10.1.5.1
community: 'public'
version: '2c'
unit_of_measurement: '°C'
value_template: "{{ value.split(':')[1] }}"
scan_interval: 60
- platform: snmp
name: 'NAS Disk 2 Temperature'
host: 192.168.1.8
baseoid: 1.3.6.1.4.1.5127.1.1.1.8.1.10.1.5.2
community: 'public'
version: '2c'
unit_of_measurement: '°C'
value_template: "{{ value.split(':')[1] }}"
scan_interval: 60
- platform: snmp
name: 'NAS Fan Status'
host: 192.168.1.8
baseoid: 1.3.6.1.4.1.5127.1.1.1.8.1.8.0
community: 'public'
version: '2c'
value_template: "{{ value }}"
scan_interval: 60
- platform: snmp
name: 'NAS Size'
host: 192.168.1.8
baseoid: 1.3.6.1.4.1.5127.1.1.1.8.1.9.1.5.1
community: 'public'
version: '2c'
value_template: "{{ value.replace('T','') }}"
unit_of_measurement: 'TB'
scan_interval: 300
- platform: snmp
name: 'NAS Free Space'
host: 192.168.1.8
baseoid: 1.3.6.1.4.1.5127.1.1.1.8.1.9.1.6.1
community: 'public'
version: '2c'
value_template: "{{ value.replace('T','') }}"
unit_of_measurement: 'TB'
scan_interval: 300
- platform: template
sensors:
nas_free_pct:
friendly_name: 'Free Space'
value_template: "{{ ( 100 * states('sensor.nas_free_space')|float / states('sensor.nas_size')|float |round(1) }}"
unit_of_measurement: '%'
Conclusion:
I have HomeAssistant running on my WD mycloudEX2Ultra for around 40 days now and I’m quite happy with it.
Processor usage in normal operation mode is less the 10% .
Regards.
Matt