ascillato / Tasmota_KNX

Alternative Firmware for 'ESP8266, ESP8285 and ESP32 based devices' like Itead Sonoff, Shelly or NodeMCU, with Web, Timers, OTA, MQTT, KNX, Rules and Sensors' Support, to be used on Smart Home Systems. Written for PlatformIO. Documentation at
http://tasmota.com
GNU General Public License v3.0
44 stars 11 forks source link

Rule to send KNX Telegram with BH1750 Sensor Data #230

Closed lost-hope closed 6 years ago

lost-hope commented 6 years ago

Hello I have a little Problem with the BH1750 Sensor. It is set up and works in tasmota grafik

Now i want to send the Sensor Data through KNX. I did not get even a rule to work to save the sensordata to a Variable, when the value is different from the variable. Here is my attempt of the rule: on BH1750#Illuminace!=%var1% do var1 %value% endon

I am not quite shure if the != works in tasmota rules, but also a > did not work Can you please Help? When this is not working with KNX it is also possible to sent it to MQTT konstantly and i will then adapt it to KNX on change.

The Hardware setup is a bit strange, but i don't want to tinker around with 230V.

IMPORTANT NOTICE If you do not complete the template below it is likely that your issue will not be addressed. When providing information about your issue please be as extensive as possible so that it can be solved by as little as possible responses.

Make sure these boxes are checked [x] before submitting your issue - Thank you!

ascillato commented 6 years ago

Hi,

Sorry, the operand != is not used by rules' trigger, so that rule will not work. Please don't @lost-hope, there is a solution. :wink:


rule1 1
rule1 on tele-BH1750#Illuminance do knxtx_val1 %value% endon

rule1 1
rule1 on system#boot do backlog var1 0; var2 0 endon on BH1750#Illuminance>%var1% do backlog var1 %value%; knxtx_val1 %value%; var2 %value%; add1 5; sub2 5 endon on BH1750#Illuminance<%var2% do backlog var2 %value%; knxtx_val1 %value%; var1 %value%; add1 5; sub2 5 endon

I have just added this tested example to the wiki at https://github.com/arendst/Sonoff-Tasmota/wiki/KNX-Features#6-rule-to-send-knx-telegram-with-bh1750-sensor-data

Please, confirm if your issue is solved. Thanks.


Support Information

See Wiki for more information. See Community for forum. See Chat for more user experience.

lost-hope commented 6 years ago

Hello it worked, but it is spelled Illuminance so there is a missing n

Greetings Sören

ascillato commented 6 years ago

Thank you. Typo corrected. :+1: