Now at the third version (v0.3.0) I thought I would share my custom integration mqtt-energenie-ener314rt. The integration allows local control & monitoring of the energenie range of sockets, switches, relays, radiator values and sensors using their 433Mhz radio transmitter board the ENER314-RT; there is no need for a separate MiHome Gateway.
The code, which is lightweight, executes under node.js on a raspberry pi where the ENER314-RT is installed. It communicates with Home Assistant via MQTT, and it has MQTT discovery support is built-in.
Several of us have been successfully running the code since January.
The code is still in beta, so all feedback welcome.
Thanks. Iām relatively new to HA and have it running in my Pi 4B 8G as an HA installed image on the SD card using the Pi installer. Iām using HA to learn about modern development and still trying to get my head around how it all works and all the advantages of each flavour of install.
Is the above configuration compatible with this installation or should I be running Pi OS and HA on Docker or some other way instead?
Many years ago I was a developer using embedded software and C development on OS/9 68k and Unix but didnāt make the leap into OO programming so itās a bit of a learning curve currently as I work out the high level stuff and understand how it (magically) works at medium and low level. Thanks for any input.
Sorry for the late reply. The key thing is being able to access GPIO from the program so it needs an environment where that is enabled. I donāt think a shell within docker HA will work as this access is blocked by default. Try it and see!
FYI: My installation uses an old Pi2B with the ENER314-RT, this runs the MQTT broker and my software. I have HA running on a separate machine (an NPC) running HAOS.
hello,
i am.new to HA and have i installed HA OS .
i installed your integration but nothing detected. can younplease let me.know what i need to install, dependencies, of your integration please
Unfortunately you cannot run this (AFAIK) on the same machine under a HA OS installation as it needs access to a node.js runtime environment such as Raspberry Pi OS.
I use 2 machines for my installation an NPC running HAOS and an old Pi 2 that runs debian and has the module adaptor and my code. It uses MQTT to communicate.
So I run a Pi4 with plenty of RAM and CPU left running HAOS. So, what is there to stop me, on the same pi, installing ssh+terminal addons, logging in as root via ssh, installing node.js docker, and create a docker for your module adapter. MQTT would already be running under the HAOS?
I might even built the image from all three but small steps first.
I wasnāt sure of your technical ālevelā when I responded. Yeah you would need to run a docker container that has nodejs environment and, critically, gpio (ideally spidev) access to make it work.
npm install should install the dependencies once you have a nodejs container. My module only has 3 dependencies (energenie-ener314rt, mqtt and npmlog) , but I know MQTT and npmlog have many more.
I have not heard of anyone doing this, so I would be very interested in your results!
Thank you for this, Iāve had the hat in a drawer for years and this has finally given me the push to actually use it.
Just for info Iām using docker to run home assistant and mqtt.
Iāve had two problems hoping you can shed some light on them, firstly,
ln: failed to create symbolic link '/lib/systemd/system/mqtt-energenie-ener314rt.service': File exists
Failed to start mqtt-energenie-ener314rt.service: Unit mqtt-energenie-ener314rt.service not found.
Failed to enable unit: Unit file mqtt-energenie-ener314rt.service does not exist.
Iām pretty sure I followed your readme exactly, and I tried changing .../pi/... to being the user and the hostname I use just in case. If you can shed any light that would be amazing.
The second is the use of OOK devices, I am using light switches and have found while the turn off always seems to work, they donāt always turn on - is this something you have seen?
@morphok The first part is all about creating an automated startup of the application. These instructions were added by someone else to my README; ultimately you just need something to execute node app.js in the correct directory; If you are using docker you could get it to execute the node app.js command, something like this: Start node app at container start with Docker - Stack Overflow
For the second part the command to switch off/on an OOK switch is almost identical bitwise. If it isnāt always receiving, it will be poor signal either due to a) range or b) interference from other 433MHz radio devices in your home. You could try increasing the number of ook_xmits in your config.json file; try 20 instead of 10; this should help with interference.
To fix a) there is an aerial mod you can do on the boardā¦ I canāt locate the instructions at the mo, let me know if you need it.
Extra keys ā433MHzā and āMiHomeā added to āpackage.jsonā (@genestealer)
Instructions added to README for joining undiscovered Monitor devices #52
Fixed
Type error on Maintenance LOW_POWER_MODE causing crash #49
Changed
MQTT Discovery: Entity names are now in Title Case (instead of all lower case)
MQTT Discovery: eTRV Climate now operates differently to align closer to the Climate modes in Home Assistant #47 (note: the numbers in brackets show the equivalent eTRV āVALVE_STATEā)
āautoā (2) mode in HA means it is run by an external schedule, so has therefore been removed as not applicable
āheatā (was 0 now 2) mode operates to the set-point temperature
āoffā (1) mode unchanged
āalways onā (0) has been removed, as there isnāt an equivalent in HA
MQTT Discovery: Origin added to device discovery message (@genestealer)
MQTT Discovery: Device Class for Smart Plug switch set to outlet (@genestealer)
MQTT Discovery: eTRV REPORTING_INTERVAL and Maintenance Entity categories set to config (@genestealer)
MQTT Discovery: eTRV temperature step added and set to 0.5 (@genestealer)
MQTT Discovery: Battery % now shows as dynamic icon in Home Assistant for eTRV (@genestealer) and Home Energy Monitor (@Achronite)
MQTT Discovery: āFREQUENCYā and āVOLTAGEā added as HA ādisabled entitiesā for Monitor Plug, and Smart Plug+
MQTT Discovery: Added thermostat, including Climate Control entity
MQTT Discovery: Added MiHome Click
The number of retries is now configurable for cached commands (applies to eTRV and thermostat) by setting cached_retries in config,json (default remains at 10)
MQTT Discovery: Added āBattery Timestampā (mapped to MQTT VOLTAGE_TS), āDiagnostics Ranā (mapped to DIAGNOSTICS_TS) and 'Valve Exercised (mapped to VALVE_TS) for eTRV
MQTT Discovery: Added āIdentifyā Button for eTRV
Setting target temperature now caters for 0.5 increments (previously integer)
A different mechanism of reporting processed commands has been implemented for the thermostat, that relies on the fact that when (and only when) the thermostat processes a command it outputs itās telemetry data. This mechanism has been used to assume that the command just sent to the device (upon WAKEUP) has been processed successfully; This command has itās retained state set in MQTT [#61](Thermostat retained topics Ā· Issue #61 Ā· Achronite/mqtt-energenie-ener314rt Ā· GitHub
MQTT Discovery: A new device mqtt-energenie-ener314rt has been added to represent the software and the ENER314-RT board, which includes a āDiscoverā button, āConnected Stateā and reports the number of discovered monitor (FSK) devices. All Discovered āmonitorā devices are automatically linked to this new device as āConnected devicesā. The README examples have also been updated to show how to link these to the board device using via_device.
Home Assistant: Added āDiscoverā button for the board device; this will perform a 10 second auto-scan and will update the device list via MQTT Discovery for all devices found.
#81 Auto-retry switch command added for MIHO005, enabled by default, disabled by adding retry: false into config.json. This functions checks that the resulting monitor message matches the (just) sent command; if it is different it retries the command (indefinitely)
#80 āVersionā added to entity mqtt-energenie-ener314rt, which shows if a software update is available for this applicationt. This checks runs once on startup and then at 3:26AM every day.
Fixed
Added options to mqtt service for increased resilience of restarting the service upon failure #62(@genestealer)
Only enable discovery if monitoring is also enabled #82
Changed
BREAKING DEPENDENCIES: The version of mqtt.js has been updated, this newer version required node.js >= v18.2.0
BREAKING DEPENDENCIES: The version of energenie-ener314rt needed is v0.7.x. This uses a newer GPIO library that is compatible with the pi5. gpiod and libgpiod will need to be installed first
Pretty printed all device JSON files
MQTT Discovery: OEM Part Number and Device ID added to HA device model field (@genestealer)
Submitting a cached command will now replace the existing cached command for the device
Added data value to the reporting of command when it has been successfully cached (also only update MQTT when this is set to 0=None) #69,
e.g. āSet Temperatureā becomes āSet Temperature 18.5ā
MQTT Discovery: In line with HA best practices, the primary entities for each of the FSK control devices (see table below) have had their names updated to āNoneā/null, e.g: sensor.motion_sensor.XXX.motion ā sensor.motion_sensor.XXX. These entities are indicated by "main":true in the device json files.