Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,


as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.


As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!



Smart Home Forum by FIBARO Team

  • 0

0-10v Sensor max 4 digit Lux





I'm new to this forum so first of all hi everybody! :-)

I hope you can help me with my use case of the smart implant. Google and oOrum searches had no results.

I connected 2 analog 0-10v sensors to the smart implant, 1 wind sensor and 1 Light/Lux sensor. Both basiclly work, but I have a problem with my Luxsensor.

It is a Sensor which messures up to 100.000 Lux, because I want to use it outside and for raffstore controlling/scenes. But when I open the configuration of the sensor in smart Implant, I can max enter 4 digits of max Lux, so max 9999 Lux at 10v, which gives me wrong numbers of the exact Lux outside (see picture in attachement).

Does anyone know, how I can configure the smart implant so I can say at 10v it is 100.000 Lux?


Thanks in advance,



Please login or register to see this attachment.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0


This is actually not a problem, if you are using LUA you just have to multiply it.
But that's actually not your problem.
I have the same problem and am currently working on a solution.
If you have 100000 lx but only one resolution at:
8bit = 390lx
12bit = 24lx
16Bit = 1.53lx
If it is now the case that only positive values are calculated but only with half resolution, the result is even worse.
No data sheet says anything about resolution or accuracy.
If you now assume 2% accuracy and + -1 bit, you have a real problem.
That is also my problem, so I am currently building a 12/16 bit solution with a microprocessor where I know the accuracy and where I am sure of the resolution and evaluation (0-10V / + - 0-10V).
I have already asked such a question in many forums and never received an answer.
A smart home is just a smart home and not a measurement or evaluation system, although the step is small and the chips provide something like that.
The z-wave chips have 12 bit A / D converters that can be programmed and even contain amplifiers, but this has apparently not been taken into account.
So if you want it exactly you will have to tinker.
I need even longer because I have to deal with the programming of the microprocessor and the communication with the HC3.
Greetings Frank



Das ist eigentlich kein Problem, wenn du LUA benutzt musst du es nur Multiplizieren.
Das ist aber eigentlich nicht dein Problem.
Ich habe das Gleiche Problem und bastel grade an einer Lösung.
Wenn du 100000 lx hast aber nur eine Auflösung bei :
8bit  = 390lx
12bit = 24lx
16Bit = 1,53lx
Wenn es jetzt so ist das nur Positive Werte berechnet werden das aber nur mit Halber Auflösung so ist das Ergebnis noch schlechter.
Kein Datenblatt sagt etwas über die Auflösung oder die Genauigkeit.
Wenn du jetzt noch 2% Genauigkeit und +-1Bit annimmst so hast du ein Richtiges Problem.
Das ist auch mein Problem darum baue ich mir grade mit einem Microprocessor eine 12/16 Bit Lösung bei der ich die Genauigkeit kenne und wo ich mir mit der Auflösung und Auswertung (0-10V/+-0-10V) sicher bin.
Genau solch eine Frage habe ich schon in vielen Foren gestellt und nie eine Antwort erhalten.
Smart-Home ist eben nur ein Smart-Home und kein Mess- oder Auswertesystem obwohl der Schritt klein ist und die Chips so etwas hergeben.
Die z-wave Chips haben 12 Bit A/D Wandler die sich Programmieren lassen und sogar Verstärker beinhalten aber das ist scheinbar nicht berücksichtigt worden.
Also wenn du es Genau haben möchtest wirst du basteln müssen.
Ich benötige noch länger da ich mich wert mit der Programmierung des Microprozessors und der Kommunikation mit dem HC3 beschäftigen muss.
Gruss Frank


Link to comment
Share on other sites

  • 0
7 minutes ago, FBerges said:

I have already asked such a question in many forums and never received an answer.

I forgot about your question.


If you want *very* good analog resolution, accuracy and noise performance ... the ADCs on most microcontrollers won't cut it... And you won't buy something expensive...


I can highly recommend boards based on ADS1115 chip originally made by Texas Instruments:


Please login or register to see this link.


16-Bit ADC

Internal Low-Drift Voltage Reference

I2C Interface: Four Pin-Selectable Addresses

Four Single-Ended or Two Differential Inputs (ADS1115)


The I2C interfaces with Z-Uno or ESPxxxx or any microcontroller actually ?


I've used a few of those for analog sensing, but since then I've moved on to digital sensors (for Illuminance, Temp, Hum, ...).

  • Like 1
Link to comment
Share on other sites

  • 0

Hi Peter @petergebruers

Yes, I have exactly the ADS1115 in mind.
As a microprocessor the ESP32-WROOM-32.
I already have a flashing LED at the start, but it will take some time until the solution is finished.
Once that's up and running, transferring it to other tasks is child's play.
The hardware is not a problem, I dealt with it quickly, even if there are one or the other amplifier, low pass, etc., nothing is an issue.

Greetings Frank


  • Like 1
Link to comment
Share on other sites

  • 0

Hi Peter

Could you see if you can tell me where my mistake is?
I've been looking for the problem for 2 days.

I would like to connect my ESP32 board to a program you have changed (Air Quality).
I get a connection.
The data is received with the QA.
Only the Json cannot convert them and brings an error.
It is desperate because I don't see the mistakes.

Here is the code from the ESP32.

Please login or register to see this code.

Now the one from the QA

Please login or register to see this code.

That's the mistake

/usr/share/lua/5.3/json/decode/util.lua:35: unexpected character @ character: 1 0:1 [<] line:


json String 

Response data: {"software_version":"ESP32_Dachboden_V1.0","age":0,"sensordatavalues":[{"value_type":"DHT11_T","value":0},{"value_type":"DHT11_H","value":0},{"value_type":"BB_H","value":0},{"value_type":"BB_L","value":0},{"value_type":"signal","value":-74}]}


Link to comment
Share on other sites

  • 0

Please login or register to see this code.

instead of


Please login or register to see this code.


Wondering about 

Please login or register to see this code.


Please login or register to see this code.


Sounds like special characters, which can't be decoded.


Instead of



Please login or register to see this code.


try json.encode and print that out to check what really inside your "json"


  • Like 1
Link to comment
Share on other sites

  • 0

Yes, there are definitely still many mistakes in it and some things I don't understand yet.
Thanks to your examples and your explanations, this is progressing.
I am in the process of understanding this and adapting it to what I want to do.
Little by little it becomes and every now and then I run into problems that I first have to fathom.
The squirrel has a hard time feeding itself.
I haven't learned all of that and have to read everything and try it out first.
I ran the json through a test on the internet that is OK so far. Now I'll break it down character by character and see what comes out of it.
First thanks for the help.
Greetings Frank


Ja da sind mit sicherheit noch viele Fehler drin und einige Sachen verstehe ich auch noch nicht.
Dank Eurer Beispiele und eurer Erläuterungen geht das voran.
Ich bin dabei das zu verstehen und an das was ich machen möchte anzupassen.
Nach und nach wird das und ab und an stosse ich auf Probleme die ich erst mal ergründen muss.
Mühsam ernährt sich das Eichhörnchen.
Ich habe das alles nicht gelernt und muss mir alles erst anlesen und ausprobieren.
Ich habe den json durch einen Test im Internet laufen lassen, der ist so weit OK. Jetzt werde ich den mal Zeichen für Zeichen zerlegen und mal sehen was dabei raus kommt.
Erst mal Danke für die Hilfe.
Gruss Frank

Edited by FBerges
Link to comment
Share on other sites

  • 0
9 hours ago, FBerges said:

function QuickApp:getValues() -- Get the values


local n = 5 for i=1,n do

if jsonTable.sensordatavalues[i].value_type == "DHT11_T" or jsonTable.sensordatavalues[i].value_type == "temperatur" then

data.temperature = jsonTable.sensordatavalues[i].value


And you don't have to do the looping, if you know for sure what sensors you will connect. This looping is introduced for the software of sensor.community where more types of sensors can be used. 

  • Like 1
Link to comment
Share on other sites

  • 0

So that's the mistake.
At the beginning there was a CR and LF in the string.
Of course it's hard to see.


jsonTable = json.encode (response.data) - JSON decode from api to lua-table
print ("jsonTabele raus =", jsonTable)



jsonTabele raus = "\r\n{\"software_version\":\"ESP32_Dachboden_V1.0\",\"age\":0,\"sensordatavalues\":[{\"value_type\":\"DHT11_T\",\"value\":0},{\"value_type\":\"DHT11_H\",\"value\":0},{\"value_type\":\"BB_H\",\"value\":0},{\"value_type\":\"BB_L\",\"value\":0},{\"value_type\":\"signal\",\"value\":-74}]}\r\n"


bring that to light.


That helped me to become a decision maker.
You could see it there, I wouldn't have thought of that, I wanted to dismantle the string this morning character by character.
It went a lot faster that way.


Great thank you !


Greetings Frank

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...