Internal Sensors for Domoticz

Step-by-step how-to guide install the Internal Sensors on Raspberry Pi with the latest Raspbian Buster image and Domoticz.

This how-to is part of a bigger series of Domoticz how-to’s on sancla.com!

As most know by now, the Raspberry Pi 4 has the reputation to run hot. Perhaps hotter then we want, even with an idle CPU with Domoticz… One way to resolve this problem is cooling this beast.

In my humble opinion, the Flirc passive cooling case has been the best accessory for the the Raspberry Pi 4 one could buy (and for only € 20,- it’s a bargin): https://www.tinytronics.nl/shop/nl/raspberry-pi/behuizingen/flirc-raspberry-pi-4-behuizing-aluminium-zwart
In this how-to we utilize this case and it has been running for over an hour at approx 40° Celsius with Domoticz, i-love-this-case!!

Flirc case for the Raspberry Pi 4
Flirc case for the Raspberry Pi 4

However, besides making sure your Raspberry Pi 4 gets proper cooling, it doesn’t hurt to monitor the temperature in Domoticz. Doing so also enables you to configure alerting if the temperature gets to high and cool down your Raspberry Pi with a big bucket of conductive water…..

This tutorial has been verified with:
Domoticz 2020.1

Prerequisites

Tested with

  • Raspberry Pi 4 (MEM 2GB with 16GB sd-card)
  • Raspbian Buster Lite 4.19, Februari 2020
  • Domoticz Stable 2020.1 (compile date 22-3-2020)

Configuring internal sensors in Domoticz

In Domoticz, go to hardware and add a new device:

  • Name: Raspberry
  • Type: Motherboard sensors
  • Data Timeout: 10 minutes
Adding the Motherboard Sensors in Domoticz
Adding the Motherboard Sensors in Domoticz

After a couple of minutes, the internal devices are starting to appear under devices. Click on the green button to enable the monitoring of the device. You can give it a any name you want, such as “Internal Temperature” for example:

Motherboard Sensor devices appearing in Domoticz
Motherboard Sensor devices appearing in Domoticz

The temperature of your Raspberry Pi is now visible in Domoticz under temperature. You can take the same steps for the other sensors should you wish to monitor them.

The internal Raspberry Pi temperature in Domoticz
The internal Raspberry Pi temperature in Domoticz with the Flirc case

As shown in above image, you can configure “Notifications” for each enabled device. So you receive a notification if your Raspberry Pi is starting to run to hot:

Configuring notifications for the internal temperature sensor in Domoticz
Configuring notifications for the internal temperature sensor in Domoticz
READ MORE

RFLINK for Domoticz

Step-by-step how-to guide install the RFLink, on a Raspberry Pi 4, with the latest Raspbian Buster image and Domoticz.

Connection will be based directly on USB, we are working on how-to guides to connect the RF-Link in different ways such as over ethernet (ser2net) or wifi (ESPEasy).

This how-to is part of a bigger series of Domoticz how-to’s on sancla.com!

This tutorial has been verified with:
Domoticz 2020.1

Prerequisites

Tested with

  • Raspberry Pi 4 (MEM 2GB with 16GB sd-card)
  • Raspbian Buster Lite 4.19, Februari 2020
  • Domoticz Stable 2020.1 (compile date 22-3-2020)
  • RFLink firmware R48 (USB/MEGA)

Step 1 Connect the RFLink with USB

This is probably the most easiest step I ever included in a how-to, but just connect your RFLink to the Raspberry Pi.

However, if you haven’t used your RFLink in a long time and you aren’t sure about the firmware version, you can upgrade this to the latest version very easily.

The developers made it easy update the firmware with their (Windows) support application, it’s included with the firmware update download:
http://www.rflink.nl/blog2/download
Just connect your RFLink to your PC, run the support application “RFLinkLoader.exe”, select the included firmware and press the “Upload/Program firmware to device” button.

The RFLink support application  "RFLinkLoader.exe"
The RFLink support application “RFLinkLoader.exe”

Step 2: Configure the RFLink in Domoticz

Once you have connect the RFLink to your Raspberry Pi, go to Domoticz and then to the hardware section under Setup.

  • Name: RfLink433
  • Type: RFLink Gateway USB
  • Data Timeout: Disabled
  • Serial Port: Select the one with “Arduino” in it.
    If this doesn’t work later on, try the other ports till you found the right one.
Adding the RFLink as a hardware device in Domoticz
Adding the RFLink as a hardware device in Domoticz

Step 3: Connect devices in Domoticz

Once you have configured your hardware device, Domoticz will start automatically to recognize the device in your neighborhood once it receives a signal from it. Over time, this can get a bit messy and easily get out of hand, see step 4 for a solution.

Now, once you press a button of a 433mhz device (or any other RF kind if your RFLink supports this), RFLink will communicate that signal to Domoticz and Domoticz will automatically add the device under devices.

Example of recognized 433 devices in Domoticz
Example of recognized 433 devices in Domoticz

The biggest problem with the devices is recognizing the device in question. It’s a trail-and-error game of can give you head-aches if you live in a crowded area such as a city. However, for light switches, we have a trick. Every time you click on a ON/OFF button of your 433mhz device, the device gets an update and you will see the state change in Domoticz in 1-2 seconds.

Last Seen status in Domoticz
Last Seen status in Domoticz

After you identified all your RF devices, named and enabled them, your set and it should all work in Domoticz. Fun fact, in most area’s almost always a neighbor has a 433mhz based outdoor temperature sensor you can receive. And in most cases, they will change the batteries periodically for you, it won’t cost you a single penny!

Step 4: Disable “Accept new Hardware Devices” in Domoticz

Once you have identified and configured your sensors, it’s best to disable the auto-acceptance of new devices and remove the devices that are not yours. Domoticz provides you with a way to work around this ‘feature’ by allowing Domoticz to find and auto-recognize new devices for a short period of time only, for 5 minutes.

To disable the auto-acceptance of new devices or to enable the auto-acceptance for 5 minutes, find the “Hardware/Devices” section under Setup -> Settings.

Be aware that this also disables the recognition of new devices of other hardware devices.
If you add any new hardware or devices of any kind, you may temporary enable this setting again.

Disable the "Accept new Hardware Devices" feature in Domoticz
Disable the “Accept new Hardware Devices” feature in Domoticz

Tips & Tricks

Dipole antenne 433 Mhz from nodo-shop.nl

Sources

READ MORE
ikea-tradfri-assortiment

Ikea TRÅDFRI for Domoticz

Step-by-step how-to guide install the Ikea Tradfri plugin on a Raspberry Pi, with the latest Raspberry Pi OS image and Domoticz.

Thank you Mark, Rob, Marke, Jan and Jurgen for the feedback!

This how-to is part of a bigger series of Domoticz how-to’s on sancla.com

This tutorial has been verified with:
Domoticz 2020.2
Ikea Tradfri plugin v0.9.2

Prerequisites Ikea TRÅDFRI plugin

Tested with

  • Raspberry Pi 4 (2GB model with 16GB sd-card)
  • Raspberry Pi OS Lite 4.19 (release date 2020-05-27)
  • Domoticz Stable 2020.2 (compile date Apr 27 2020)
  • Ikea tradfri plugin v0.9.2

1. Install packages and requirements

Connect to your running Raspberry Pi with Raspbian with SSH.
Then execute these command (it’s easier to copy-paste them into your SSH session if your SSH client supports this -> PUTTY!):

sudo systemctl stop domoticz.service
sudo apt update -y && sudo apt upgrade -y
sudo apt install golang python3 python3-dev python3-pip -y
cd /home/pi/domoticz/plugins/
rm -rf IKEA-Tradfri/
git clone https://github.com/moroen/IKEA-Tradfri-plugin.git IKEA-Tradfri
cd IKEA-Tradfri
sudo -H pip3 install --upgrade pip
sudo -H pip3 install --upgrade setuptools
sudo -H pip3 install -U py3coap
sudo systemctl start domoticz.service

2. Configure and test Tradfri COAP:

python3 plugin.py config IP KEY
python3 plugin.py list 
  • IP is the address of the gateway.
    A very easy way to find the IP address of your Ikea Tradfri gateway is to use the “Fing” app on your phone.
    Fing app for Android (LINK)
    Fing app for Apple iPhone (LINK)
    See the image below for an example result on the app.
  • KEY is the security-key located on the bottom of the gateway (displayed at the orange bar in the picture below).
    WITHOUT THE “-” DASHES !
  • For example:
    python3 tradfricoap.py config 192.168.0.123 gB2pK1YUFi5A2hMN
    or
    python3 tradfricoap.py config 10.1.2.14 gB2pK1YUFi5A2hMN

3. Restart Domoticz

sudo systemctl restart domoticz.service

4. Enable IKEA-Tradfri in Domoticz

Go to your Domoticz webinterface and then to hardware, to enable the new Ikea hardware device. Fill in the hardware configuration as follows (the screenshot is for indication and has other values!):

  • Enabled: Enabled
  • Name: IKEA Tradfri
  • Type: IKEA Tradfri Plugin – pycoap version
  • Data Timeout: Disabled
  • Add groups as devices: Yes
  • Observe changes: Yes
  • Polling interval (seconds): 30
  • Transition time (tenth of a second): 10
  • Debug: False
Configure the hardware device in Domoticz
Configure the hardware device in Domoticz

Regarding the polling interval seconds:
To observe changes when switched using another method than domoticz (for an Ikea remote for example), enable “Observe changes” and specify a poll interval in seconds. The plugin uses this value to poll the state from the gateway. Thus it can take this amount of time for Domoticz to update the state of the Domoticz switches when you use the regular Ikea remotes.

The minimum poll interval is 5, and the interval should be a multiple of 5 seconds. Using a too short interval tends to freeze the Ikea gateway, requiring cycling the power of the gateway to restore communication. A polling interval of 30 seconds or greater seems to be fine and reduce the occurrence of freezes. Configuring this value lower could make Domoticz start to ‘hammer’ the Ikea Tradfri gateway asking it for the latest states…

If you use Domoticz to change the states of the Ikea devices, and not for example with the Ikea remotes, you can also consider to switch this off (set Observe changes to “No”).

5. Enable devices

If everything is correctly installed and configured, you should now see a list of Ikea devices:

Example of Ikea devices in Domoticz
Example of Ikea devices in Domoticz

Sources & credits

READ MORE