User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

 

Creasol DomBusTH - Domoticz device Creasol DomBusTH - Domoticz temperature and humidity sensor, with LEDs, inputs and outputsCreasol DomBusTH is a small electronic board, 32x17mm, that can fit any blank cover with a 3mm hole in the centre, needed by the thermal/humidity sensor to exchange air with the room and to get the LEDs light out. It can be connected to the Domoticz controller by a RS485 serial bus (4 wires, 2 for 12/24V power supply, and 2 for data at 115200bps).

The electronic board is supplied with a 20cm long, 10 wires, assembly cable with plugin connector, so it's easy to connect the device to pushbuttons, switches, relays, ....

As other DomBus devices, DomBusTH minimizes power consumption, is automatically detected by Domoticz and each port is fully web configurable via Domoticz device description. See below how to change the factory-programmed address of each device, and how to configure each port as digital inputs, analog inputs, digital outputs, dimmer, buzzer, blind, .... by the Domoticz web panel.

Creasol DomBusTH - Domoticz I/O and sensors, RS485

Features

  • temperature sensor, factory calibrated with a precisoin of +/- 0.3°C
  • relative humidity sensor, factory calibrated with a precison of +/- 2%RH
  • 4 wires that can be configured as digital inputs, analog inputs, 1mA digital outputs and buzzer
  • 2 open-collector outputs with 40V 50mA capability, that can be used to control external relays, electronic boards inputs with pullup, small LEDs (DomBusTH includes the dimmer function)
  • 1 analog input that measure the voltage on bus (but can be configured to measure another external voltage, 30Vdc max, by soldering an additional wire)
  • 1 red LED
  • 1 green LED
  • 1 white LED with 700 mcd luminous intensity
  • 7.5-35Vdc power supply (internally regulated by a switching mode power supply circuitry that minimize power consumption and dissipation)
  • low power consumption: 2.5mA stand-by current at 13.6V
  • 115200 bps RS485 bus (max length: 1km)

Installation

Using RS485 specific cables it's possible to get almost 1km linear bus with several devices attached. Alternatively, it's possible to use 2 twisted pairs of cheap Cat6 UTP or STP cable, one twisted pair for data (A and B) and one for 12-24V power supply. Be careful to connect all devices using a linear bus topology, to get the lowest reflection/noise, and connect 100-150 Ohm resistor on the two ends, as illustrated in the Fig. 2.

dombus connectioncreDomBusTH4 200

creDomBusTH5 200AN domoticz example1

AN domoticz example2

At Raspberry/PC side, it's possible to use a cheap USB-RS485 adapter, if a serial port with RS485 driver is not already available.

Using this installation topology it's possible to avoid RF pollution and minimize connections, connecting DomBus devices in any room by a 4 wire shielded cable to exchange data and get power supply (normally battery-backed 12Vdc, to get the domotic system working even in case of blackout).

N. Color Description
1 Black Ground (0V)
2 Brown Vbus (normally +12Vdc)
3 Yellow RS485 A (data, 115200bps)
4 Green RS485 B (data, 115200bps, inverted)
5 White In1: digital/analog input, low power output
6 White In2: digital/analog input, low power output
7 White In3: digital/analog input, low power output, buzzer output
8 White In4: digital/analog input, low power output, buzzer output
9 Blue Out1: open collector output (active low: can be connected to a relay coil or LED katode, with other relay/led pin connected to positive voltage, +12V or  +24V)
10 Blue Out2: open collector output (active low: can be connected to a relay coil or LED katode, with other relay/led pin connected to positive voltage, +12V or  +24V)

 

Configuration

Writing a microSD card with a fresh Raspbian + Domoticz distribution

Click here if you need to write a microSD card with a clean updated Raspbian+Domoticz image optimized to extend SD life (minimizing writings), and with some addons (firewall, backup, libraries).

Adding DomBus plugin to Domoticz

This procedure is not needed in case of a new Domoticz installation writing the SD as written above.
If Domoticz does not already include the DomBus plugin, type the following commands (from Linux root shell: type sudo su - to become root):

if [ ! `which wget` ]; then sudo apt install wget; fi
cd /home/pi/domoticz # or other directory where domoticz is installed
wget -O /tmp/CreasolDomBus.tgz https://codeload.github.com/CreasolTech/CreasolDomBus/tar.gz/master
if [ ! -d plugins/CreasolDomBus ]; then mkdir -p plugins/CreasolDomBus; fi
tar xvzf /tmp/CreasolDomBus.tgz -C plugins/CreasolDomBus --strip=1
service domoticz restart

Domoticz configuration

After plugin installation and Domoticz restart, it's possible to add the Creasol DomBus hardware (Setup->Hardware , add new "dombus" hardware type "Creasol DomBus" and specify the serial device, normally /dev/ttyUSB0) and connect the DomBus device to the RS485 bus.
DomBusTH is factory programmed with default address 0xff51, and only one port will be automatically added to the Switches panel of Domoticz. Enter the Switches panel, find the new device “dombus - [Hff51] OUT1”, click on Edit and add in the description ,HWADDR=0x0001 to set the new address to 0001, or specify another address of your choice. Reload the Switches panel to see all input/output/led ports of DomBusTH active.

Each device port can be configured via the Domoticz switch description: for example a device type IN_DIGITAL normally is On when it's left unconnected, and Off when it's shorted to GND, but it's possible to invert this function specifying in the switch description the parameter INVERTED, separated by a comma (,): IN_DIGITAL,INVERTED . Please check the following sections Port parameters and DomBusTH port capabilities.

I/O that are not used can be disabled in Domoticz Setup -> Devices clicking on the blue arrow of each useless device (I/O).

I/O parameters

Parameter name Function
HWADDR=0xNNNN This command set new address for the dombus device: reload the Switch panel to see the new devices associated with the new address of DomBus. NNNN is an exadecimal number, from 0x0001 to 0xff00, so 65280 combinations are available. Keep note of address assegnated to each dombus device, because in case of address conflict it's needed to switch off one of the conflicting device and program the remaining one to another address, or make a factory reset as explained below.
INVERTED Used to invert the logic state of an input or output. Can be used in conjuction with OUT_DIGITAL, OUT_RELAY_LP, IN_DIGITAL, DIMMER.
Normally, domoticz switch is On if input is at logic level high (open), and Off when it's shorted to ground. If INVERTED is specified, domoticz switch will be On when the corresponding input is shorted to ground, and vice versa.
OUT_DIGITAL Output, open collector, active low, On => output wire is shorted to GND (max current 50mA). Off => output is open (current=0).
OUT_RELAY_LP Not recommended: output, open collector, active low, but with duty cycle 25% to reduce power consumption on relays coil
OUT_DIMMER Set the output as DIMMER, from 0 to 100% using 5% step, 500Hz frequency. Suitable to control LED strip lights
OUT_BUZZER Set two outputs as BUZZER: a piezo buzzer can be connected to the selected two ports (configured in push-pull) to generate 5KHz frequency when the corrsponding Domoticz switch is On. The Domoticz switch can be configured as selector: in this case buzzer will output 1 or more short alerts to notify a status, similarly to the led configured as OUT_DIGITAL with Domoticz switch configured as Selector.
OUT_BLIND

Port configured to control a blind, in close direction. Next port will be automatically configured as blind in open direction.
Ports OUT1 and OUT2 can directly be connected to 12V relay coils (if Vbus is 12-14V, or 24V relay coils if Vbus is 24V).
Ports IN1..IN3 can be configured as OUT_BLIND, but in this case should be connected to relayboard that already have a transitors/optocouplers to drive relays.

OUT_LEDSTATUS Configure a LED port to show the device status (flashes when a frame is transmit to the RS485 bus)
IN_DIGITAL Digital input, is On when the corresponding input is at high voltage level (open), and Off when the corresponding input is at GND (shorted).
IN_ANALOG In DomBusTH there is one pad/hole where it's possible to solder a wire to measure an external DC voltage, <30Vdc; a solder jumper must be opened (because that pad is connected to Vbus).
Also, one or more of the 4 input wires can be configured as analog inputs, 0-3V range: a solder jumper in the PCB must be opened by cutter to disable the internal pullup resistor. Also, external resistive divider should be added to measure higher voltages, so the voltage at the input is less equal than 3V
IN_TWINBUTTON This is a method to connect two pushbuttons/switches to a single input, to get a UP/DOWN/STOP select switch. The two switches are connected together by a 4.7KOhm resistor, using the schema indicated in the application notes below.
A For analog and distance sensors: used to compute the real value using the formula  REAL_VALUE=A * VALUE_FROM_DOMBUS + B.
B For analog and distance sensors: used to compute the real value using the formula  REAL_VALUE=A * VALUE_FROM_DOMBUS + B

DomBusTH I/O/S capabilities

Port# Name Capabilities Default configuration Description
1 OUT1 OUT_DIGITAL, OUT_DIMMER, OUT_BLIND OUT_DIGITAL Open collector output, max 40V 50mA, that can be connected to external relay coil, small led strip, other electronic device inputs that are active when shorted to GND, ...
2 OUT2 OUT_DIGITAL, OUT_DIMMER, OUT_BLIND OUT_DIGITAL Open collector output, max 40V 50mA, that can be connected to external relay coil, small led strip, other electronic device inputs that are active when shorted to GND, ...
3 IN1 IN_DIGITAL, IN_ANALOG, IN_TWINBUTTON, OUT_DIGITAL, OUT_BLIND IN_TWINBUTTON Input, with 3.3k protection resistor and 10k pullup, that can be used as digital input (active when shorted to GND), twinbutton input (special configuration that permit to connect two pushbuttons to a single input by a 4k7 resistor), analog input (a solder jumper must be cutted to disable the 10k pullup resistor; also, in case of voltage > 3.3V, an external resistive divider must be added)
4 IN2 IN_DIGITAL, IN_ANALOG, IN_TWINBUTTON, OUT_DIGITAL, OUT_BLIND IN_TWINBUTTON Input, with 3.3k protection resistor and 10k pullup, that can be used as digital input (active when shorted to GND), twinbutton input (special configuration that permit to connect two pushbuttons to a single input by a 4k7 resistor), analog input (a solder jumper must be cutted to disable the 10k pullup resistor; also, in case of voltage > 3.3V, an external resistive divider must be added)
5 IN3 IN_DIGITAL, IN_ANALOG, IN_TWINBUTTON, OUT_DIGITAL, OUT_BLIND IN_TWINBUTTON Input, with 3.3k protection resistor and 10k pullup, that can be used as digital input (active when shorted to GND), twinbutton input (special configuration that permit to connect two pushbuttons to a single input by a 4k7 resistor), analog input (a solder jumper must be cutted to disable the 10k pullup resistor; also, in case of voltage > 3.3V, an external resistive divider must be added)
6 IN4 IN_DIGITAL, IN_ANALOG, IN_TWINBUTTON, OUT_DIGITAL, OUT_BLIND(1) IN_TWINBUTTON Input, with 3.3k protection resistor and 10k pullup, that can be used as digital input (active when shorted to GND), twinbutton input (special configuration that permit to connect two pushbuttons to a single input by a 4k7 resistor), analog input (a solder jumper must be cutted to disable the 10k pullup resistor; also, in case of voltage > 3.3V, an external resistive divider must be added)
7 ANIN Vbus IN_ANALOG IN_ANALOG Used to monitor the voltage on DomBus power supply. A solder jumper can be cutted to disconnect Vbus, then a wire can be soldered to connect another voltage, max 30Vdc
8 Led Red OUT_LEDSTATUS OUT_DIGITAL, OUT_LEDSTATUS By default, it lights when a frame is transmitted to the serial bus. It can be configured as OUT_DIGITAL to get LED ON/OFF. If the corresponding Domoticz device is configured as Selector Switch, it shows a number of flashes corresponding to the selector level/10: 0=Off, 10=1 flash, 20=2 flashes, 30=3 flashes, ... After the last flash, it waits 4 seconds before start flashing the next LED (if configured in the same way) or start flashing the same LED again.
Even in the case it's configured as selector switch, if a Domoticz script Set Level to 1 the LED temporarily loose the flash function and turns solid ON: in this way it's possible to use a LED to notify a status, but in case of blackout it can be switched ON until power restores, like an emergency light.
9 Led Green OUT_DIGITAL OUT_DIGITAL Configured as OUT_DIGITAL to get LED ON/OFF. If the corresponding Domoticz device is configured as Selector Switch, it shows a number of flashes corresponding to the selector level/10: 0=Off, 10=1 flash, 20=2 flashes, 30=3 flashes, ... After the last flash, it waits 4 seconds before start flashing the next LED (if configured in the same way) or start flashing the same LED again.
Even in the case it's configured as selector switch, if a Domoticz script Set Level to 1 the LED temporarily loose the flash function and turns solid ON: in this way it's possible to use a LED to notify a status, but in case of blackout it can be switched ON until power restores, like an emergency light.
10 Led White OUT_DIGITAL,OUT_DIMMER OUT_DIGITAL Configured as OUT_DIGITAL to get LED ON/OFF. If the corresponding Domoticz device is configured as Selector Switch, it shows a number of flashes corresponding to the selector level/10: 0=Off, 10=1 flash, 20=2 flashes, 30=3 flashes, ... After the last flash, it waits 4 seconds before start flashing the next LED (if configured in the same way) or start flashing the same LED again.
Even in the case it's configured as selector switch, if a Domoticz script Set Level to 1 the LED temporarily loose the flash function and turns solid ON: in this way it's possible to use a LED to notify a status, but in case of blackout it can be switched ON until power restores, like an emergency light.
Can be configured as OUT_DIMMER, to vary the luminous intensity in 5% steps.
11 Temperature SENSOR_TEMP SENSOR_TEMP Temperature sensor
12 Rel.Humidity SENSOR_HUM SENSOR_HUM Relative humidity sensor
13 Temp+Hum SENSOR_TEMP_HUM SENSOR_TEMP_HUM Domoticz sensor that shows both temperature and relative humidity in one place

(1): can be used as BLIND output, to open a blind/curtain, but only the previous port can be configured in Domoticz as OUT_BLIND because, when configured as OUT_BLIND, DomBus device automatically configure the next port to drive a relay in open direction.

Application notes

Connecting one ore more pushbutton switches

an creDomBusTH pushbuttons

DomBusTH has 4 inputs, so it's possible to connect up to 4 pushbuttons or switches in this way. To connect more switches, see "twinbutton" section below.

Each input connected to the pushbutton/switch should be configured as IN_DIGITAL (On when open, Off when pushed/shorted) or IN_DIGITAL,INVERTED (On when pushed/shorted, Off when released/open).

Connecting two pushbutton switches to a single input (twinbutton)

an creDomBusTH twinbuttons

Configuring one input as IN_TWINBUTTON, it's possible to manage two pushbutton-switches by a single input. In this case, with 4 available inputs, it's possible to manage 4 double pushbuttons (totally 8 pushbuttons).
The two pushbutton-switches are connected together by a 4k7 resistor: in this way the DomBus device can determine if DOWN-pushbutton is pressed (input voltage = 0V) or UP-pushbutton is pressed (input voltage determined by the 4k7 external resistor and internal pullup resistor).
Please note that if UP and DOWN pushbuttons are pressed together, the DomBus device will read it as only DOWN button pushed.

an creDomBusTH twinbuttons config

Using red and green LEDs to show status of the photovoltaic

DomBusTH has 3 LEDs that can be configured as OUT_DIGITAL to switch ON or OFF as a normal light.
Also, configuring the device in Domoticz as Selector, and adding levels 0, 10, 20, ..., it's possible to output one or more flashes on the LED.
In the examble below, 6 levels were added to permit LED to output up to 6 flashes corresponding to 0-5kW of power fed to the electric grid.

 an creDomBusTH ledselector config

In the following video it's possible to see a DomBusTH device configured so
* white led shows the status of ventilation: 1 flash=renew air, 2 flashes=dehumidification, 3 flashes=renew+dehumidifcation (3 in this example)
* green led shows the current power fed, from photovoltaic, to the electric grid: 0=no power, 1 flash=up to 1kW, 2=up to 2kW, ... 6=up to 6kW (3 in this example, so the power fed to electric grid is between 2 and 3kW)
* red LED shows the power from the electric grid (0 in this example, so no red flashes).

Please note that a script that set the number of flashes on a LED configured as "selector switch" have to set the level to

Level Number of flashes
0 Always OFF
1 Always ON (solid ON)
10 1 flash, then 4s pause
20 2 flashes, than 4s pause
30 3 flashes... and so on

 

LUA script that monitors electric grid voltage and power, and turn ON/OFF white LEDs in case of power outage

Click on https://www.creasol.it/support/domotics-home-automation-and-diy/141-domoticz-lua-script-that-check-and-manage-power-consumption to see what the LUA script script_device_power.lua does.

It checks the usage power (measured by a energy meter, like SDM230), automatically enable electric heaters (during the winter) or air dehumidifier (during the summer) in case of excessive phovotolatic power production (in case that selling surplus energy is not convenient), checks that electrical grid is connected activating available white LEDs (inside DomBusTH and externally connected) as emergency lightsprevent circuit breaking by disconnecting some loads/appliances and sending alerts when usage power raise above a threshold for more than N minutes, show on green/red LEDs some flashes corresponding to the produced/consumed power.

Configuring the analog input to measure the bus voltage used to supply DomBus devices

DomBusTH has one analog input internally connected to the bus positive wire (Vbus, normally 12-14V). This information can be used to measure the battery voltage, in case of power outage, disabling some devices (video surveillance, for example) when Pb battery voltage decreases below 12V.

DomBusTH send to Domoticz a integer 16bit number that must be multiplied by the constat value A to get the real voltage, so if the real voltage is 13.6V and shown value is 22197, A=13.6/22197=0.000612695 . Edit the device, in Domoticz, and put in the description IN_ANALOG,A=0.000612695 to show the real voltage value.

It's possible to use this analog in put to measure the voltage of another device: to do this open the PCB jumper  marked "h" (by using a cutter) and solder a wire in the hole AnIn. It's possible to monitor voltages up to 30V. In case of higher voltage, additional serie resistance is needed to provide the needed voltage drop, but this value is beyond the scope of this section.

an creDomBusTH analoginput config
 

Configure one or more outputs as dimmer

It's possible to configure outputs as DIMMER: in this case a PWM  500Hz output is used to regulate the light intensity.

Device have to been configured as OUT_DIMMER and power regulated from 0 to 100%, with 5% step.

an creDomBusTH dimmer device

an creDomBusTH dimmer config

Configure one or more outputs as blind

Domoticz has a Venetian Blind type device that can be used to manage blinds or curtains: a single device can be used to open, close and stop the blind/curtain motor.

This type of device must be associated to two different relays, one for open and one for close direction.
DomBusTH integrates this kind of management, so it's possible to configure Out1 as OUT_BLIND and in this way Out1 will be used to control the close direction relay, and the next output Out2 will be used to control the open direction relay.

an creDomBusTH blind device

an creDomBusTH blind config

Connecting a piezo buzzer to DomBusTH

Connect a piezo buzzer (without internal oscillator) to In3 and In4 I/O of DomBusTH, and configure In3 as OUT_BUZZER : in this way it's possible to enable a tone alert when In3 device is On.

Also, it's possible to configure the In3 Domoticz switch as Selector: in this way selecting level 0, buzzer will be OFF, selecting the next level (level=10) buzzer will be ON for a short pulse then OFF for 4 seconds, selecting level=20 the buzzer will be ON for 2 short pulses and then OFF for 5 seconds,... This function, similar to Led alert explain above, can be useful to send an informational alert within a device status or a warning level.

Installing DomBusTH near the bed switches, in the bedroom

The following diagram shows how it's possible to use DomBusTH in a bedroom to:

  • measure the room temperature and humidity;
  • control, by a pushbutton switch, the alarm system and white led:
    alarm off, short pulse => enable night alarm and turn red Led ON for 2 seconds;
    alarm on, short pulse => toggle white Led ON/OFF (can be used during the night to go bathroom without wake-up the partner);
    alarm on, long pulse => disable alarm and turn green Led ON for 2 seconds;
  • control, by a double-pushbutton UP/DOWN, the roller shutters: two external relays are needed to drive the roller shutter motor UP/DOWN.
  • buzzer alert in case of intrusion detection (alarm) and in case that someone ring the door bell.

Domoticz DomBusTH installed in bedroom - roller shutter motor, white led, temperature and humidity sensor

 

 

Hardware ChangeLog

Firmware ChangeLog

Pin It
Creasol DomBusTH: Domoticz module with calibrated temperature+humidity sensors, 3 LEDs, 4 inputs, 1 analog input and 2 outputs
SKU creDomBusTH
Brand Creasol

Software ChangeLog

FAQ about DomBus products

Why DomBus device does not work?
1. Are you using Domoticz? Does it work?
2. Did you installed the Creasol DomBus plugin on Domoticz? If not, check the Configuration section above
3. If you open the Domoticz web panel, and enter Settings -> Hardware, can you find the Creasol DomBus protocol ? Did you enable it? If not, check the Configuration section above
4. When you connect the DomBus device to the RS485 bus, can you see a new device in the Domoticz Switches panel? if not, the device cannot communicate to Domoticz by RS485 serial bus. In this case, check that:
  a) DomBus device is supplied by 12Vdc or similar voltage
  b) RS485 bus is connected (A, B, GND) to Domoticz (Raspberry or other hw) through the USB/RS485 adapter or other RS485 adapter
  c) Verify that the DomBus protocol on Domoticz is configured correctly (115200bps and right serial device), and that there are not 2 DomBus hardware with in Domoticz with the same serial port
Why current consumption is 0uA?
DomBus devices have a serie protection resistor, 2.2 Ohm, acting as a fuse when the user forget to protect 12V power supply by a fuse. Maybe the resistor is burned (you can check using an ohm-meter) and can be replaced by another resistor or, if you know what you do, by a short circuit.
DomBus1: first version of DomBus1 was not protected against polarity inversion, and switching mode power supply circuitry break down in case of polarity inversion opening the circuit. If you have a solder iron, you can try DomBus1 connecting a 5Vdc power supply to +5V indicated by the red arrow, and GND terminal block. Click to see the picture!
DomBusTH: Check polarity: the first wire (black) is ground (0V) and the second wire (brown) V+ (normally, +12V). DomBusTH is protected against polarity inversion.
How can I change address of DomBus1 device?
DomBusTH is factory programmed with address 0xff51 : please connect only 1 new/unprogrammed DomBusTH to the existing bus, and you'll find one "switch" device in the Domoticz Switches panel with name "dombus - [Hff51] OUT1" or something similar.
Click on the Edit button of that switch and add the following text to its description:  ,HWADDR=0x0001  (don't forget the comma used to separate each parameter) to set the new address to 0001, ot another not-used value.
DomBus device will be set to the specified address, then you'll find in the Switches panel all ports with the selected address.
At this point you can add another new dombus device, and change its address in the same way.
DomBusTH: how to do a factory reset?
Normally, factor reset is not needed because, enabling debug on Domoticz controller, it's always possible to know the address of a device, changing its address, and for each port change it's configuration through the Domoticz web panel.
Anyway, it's possible to do a factory reset in this way:
  1. Disconnect the device
  2. Solder the PCB jumper a to force IN4 in low impedance (150 Ohm resistor)
  3. Connect together IN1, IN2, IN3, IN4 wires
  4. Connect the device to the power supply: you can see a red flash 500ms long, that notify that configuration was restored to the factory default.
  5. If IN4 is used as input, remove the solder bump on PCB jumper a

Need help? join the DomBus channel on Telegram!

Facebook domoticz groups:
Domoticz community, Domoticz Italia, Domoticz France, Domoticz Nederland, ... just search Domoticz on Facebook!