SI1145 mqtt to domoticz

Moderator: leecollings

Post Reply
User avatar
mrccore
Posts: 14
Joined: Wednesday 07 December 2016 11:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: Madeira
Contact:

SI1145 mqtt to domoticz

Post by mrccore »

Hi.
I'm having a problem on my setup... i have one sensor SI1145 connected to a esp board on the board i have tasmota installed and the sensor is connected to pins D3 and D4 and i can see all datta readings made from the sensor on the web page related to the tasmota firmware.
My problem now is that on the tasmota i have mqtt configured and on the tasmota configuration to domoticz i only can send the data off the lux sensor to domoticz... what i want is to send also the readings from UV to my domoticz server but but i don't know how to do it.

Can anyone give me a help on this?
Thanks in advance.
User avatar
mrccore
Posts: 14
Joined: Wednesday 07 December 2016 11:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: Madeira
Contact:

Re: SI1145 mqtt to domoticz

Post by mrccore »

Well the data i'm getting from my UV sensor over mqtt is this one:

01:14:57 MQT: SI1145/tele/SENSOR = {"Time":"2019-11-23T01:14:57","SI1145":{"Illuminance":262,"Infrared":253,"UvIndex":0.3}}

Can anyone give me a help on how to creat dummy sensors to receive this data?

Thanks
User avatar
FireWizard
Posts: 1870
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: SI1145 mqtt to domoticz

Post by FireWizard »

Hi,

The output of your sensor will, according to the specs, give you a calibrated output for the UV index and an indication for the visible light and the IR. These values are unitless.
You said:
on the tasmota i have mqtt configured and on the tasmota configuration to domoticz i only can send the data off the lux sensor to domoticz
How did you achieve, that only the lux sensor sends data to Domoticz? The values for illuminance and IR are not in lux. Is it another lux sensor?

In general the MQTT data provided by a device is not compatible with the data format, required by Domoticz in order to update a sensor.
I have never seen a device that publishes data, which can be read by Domoticz without conversion.
Unless you are a "scripting expert" and you are able to write a script to convert the data, the easiest way to do the conversion, is by Node Red.

This tool can be installed on the same hardware (Raspberry Pi) as Domoticz. Beside that you will also need a MQTT broker, which can also be installed on the same Pi. Probably you have already installed a MQTT broker.

Below you will find instructions on how to install Node Red and Mosquitto.

1. Install Mosquitto MQTT broker.
There are many guidelines on the Internet available.
E.g. See: https://appcodelabs.com/introduction-to ... spberry-pi
Test your MQTT broker, so that you know that it is working properly. Install also mosquitto-clients.

A tool, I use, on the desktop is MQTTfx. (See https://mqttfx.jensd.de/) But there are many others.

Test that you can connect with your tool to the Mosquitto broker. Default port is 1883.

Do not forget to secure your broker with at least username/password.

2. Install in Domoticz the MQTT Client Gateway with LAN interface and fill in the required fields
See:

MQTT Domoticz.png
MQTT Domoticz.png (134.46 KiB) Viewed 996 times
Check that you can communicate between Domoticz and the MQTT Broker.
Subscribe with any client to domoticz/out and you will see various messages passing.

3. On this pi you have to install NodeJS and Node-RED according to this guide:
NodeJS: https://www.instructables.com/id/Instal ... spberry-Pi
Node-RED: https://nodered.org/docs/getting-started/installation

If this all works you can start to read all the published topics into node red and to convert the messages and to re- publish them again to domoticz/in.
Create the necessary virtual switches and sensors in Domoticz. Note down their idx.

If you decide to take the route via Node Red and you have Node Red, Mosquitto (or any other broker) running and you need some help with developing the flow do not hesitate to ask.

I hope this guide helps you with the first steps.

Regards
vern
Posts: 1
Joined: Friday 24 January 2020 19:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Oxford
Contact:

Re: SI1145 mqtt to domoticz

Post by vern »

Hi mrccore

I'm trying to connect an SI1145 sensor to a wemos d1 mini running tasmota 8.x but I'm not having any luck reading the sensor values. Would you mind sharing your setup & configuration?

much appreciated
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest