Skip to content

My Project

Show off and share your great projects here! We love pictures!
961 Topics 13.4k Posts
  • Verisure home alarm status as home/away switch

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • A very beginner needs help - MySensors and OpenHab !

    43
    0 Votes
    43 Posts
    28k Views
    dexterbotD
    Hello @ewgor, I follow you on another forum about this subject and are interested myself of this system. I found in the code you posted a small error - might this to be the problem. Please let me your email address - I would like to talk about this topic @ewgor said: Rules: var HashMap<String, String> sensorToItemsMap = newLinkedHashMap( "101;1;" -> "lightBar01", // looks good "lightBar01" -> "101;1;", "101;2;" -> "lightBar01", // <<<<<--------------------------HERE----------------:) "lightBar02" -> "101;2;" )
  • 4x4 softbuttonpad with motorized sliders to control your led's

    2
    6 Votes
    2 Posts
    1k Views
    mfalkviddM
    That's a beautiful solution @timdows, great work! Gotta get me some of those buttons.
  • Bathwater temperature sensor

    4
    2 Votes
    4 Posts
    2k Views
    mark_vennM
    Nice. I am likely to need something like this for my project. Nice idea.
  • Dimable Security light with PIR/Temp/Humidity and Voltage sense.

    10
    6 Votes
    10 Posts
    4k Views
    C
    @Ashley-Savage Had a big rewrite this evening and all seems good now. If you set it to a level then switch it off the level is remembered so if you issue an on command it goes to the previous level. It seems a little bit more stable as well but i'll not know fully until i put it outside for use in the wild as it where. I'm thinking i might change the DHT11 for a Dallas sensor though as i received a few waterproof ones this week as they should be more accurate and can support negative temps which living in the UK i'll need come the autumn. /** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * DESCRIPTION * This sketch provides a Dimmable LED Light along with Temp/Humidity/voltage sensing as well as Motion sensing. */ #include <SPI.h> #include <MySensor.h> #include <DHT.h> #include <SimpleTimer.h> #define SN "SecurityLED" #define SV "1.3" #define CHILD_ID_LIGHT 1 #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 #define CHILD_ID_VOLTAGE 2 #define CHILD_ID_PIR 3 #define EPROM_LIGHT_STATE 1 #define EPROM_DIMMER_LEVEL 2 #define LIGHT_OFF 0 #define LIGHT_ON 1 #define LED_PIN 5 // Arduino pin attached to MOSFET Gate pin #define HUMIDITY_SENSOR_DIGITAL_PIN 6 #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. #define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway) #define MY_DEFAULT_TX_LED_PIN A2 #define MY_DEFAULT_RX_LED_PIN A3 #define MY_DEFAULT_ERR_LED_PIN A4 int FADE_DELAY=50; // Delay in ms for each percentage fade up/down (10ms = 1s full-range dim) // the timer object SimpleTimer timer; int LastLightState=LIGHT_OFF; int LastDimValue=100; DHT dht; float lastTemp; boolean metric = true; float lastHum; float lastVolt; int oldBatteryPcnt = 0; int analogInput = A0; float vout = 0.0; float vin = 0.0; int value = 0; float R1 = 1000000.0; float R2 = 454500.0; boolean sensordelay; MySensor gw; MyMessage lightMsg(CHILD_ID_LIGHT, V_LIGHT); MyMessage dimmerMsg(CHILD_ID_LIGHT, V_DIMMER); MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); MyMessage msgVolt(CHILD_ID_VOLTAGE, V_VOLTAGE); MyMessage msg(CHILD_ID_PIR, V_TRIPPED); void setup() { gw.begin(incomingMessage, AUTO, false); // Send the Sketch Version Information to the Gateway gw.sendSketchInfo(SN, SV); dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input pinMode(analogInput, INPUT); // sets the battery voltage reading input gw.present(CHILD_ID_LIGHT, S_DIMMER ); gw.present(CHILD_ID_HUM, S_HUM); gw.present(CHILD_ID_TEMP, S_TEMP); gw.present(CHILD_ID_VOLTAGE, V_VOLTAGE); gw.present(CHILD_ID_PIR, S_MOTION); sensordelay=0; timer.setInterval(120000,readTempHum); // Send Temp every 2 mins timer.setInterval(300000,measureBattery); // Send voltage every 5 mins //Retreive our last light state from the eprom int LightState=gw.loadState(EPROM_LIGHT_STATE); if (LightState<=1) { LastLightState=LightState; int DimValue=gw.loadState(EPROM_DIMMER_LEVEL); if ((DimValue>0)&&(DimValue<=100)) { //There should be no Dim value of 0, this would mean LIGHT_OFF LastDimValue=DimValue; } } //Here you actualy switch on/off the light with the last known dim level SetCurrentState2Hardware(); Serial.println( "Node ready to receive messages..." ); } void loop() { // Process incoming messages (like config and light state from controller) gw.process(); // Read digital motion value boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; if (tripped ==1 && sensordelay==0) { FADE_DELAY=0; Serial.print("Security Sensor state : "); Serial.println(tripped); gw.send(msg.set(tripped?"1":"0")); // Send tripped value to gw tripped=0; gw.send(msg.set(tripped?"1":"0")); // Send tripped value to gw sensordelay=1; timer.setTimeout(10000,ResetTripped); } timer.run(); } void incomingMessage(const MyMessage &message) { if (message.type == V_LIGHT) { Serial.println( "V_LIGHT command received..." ); int lstate= atoi( message.data ); if ((lstate<0)||(lstate>1)) { Serial.println( "V_LIGHT data invalid (should be 0/1)" ); return; } LastLightState=lstate; gw.saveState(EPROM_LIGHT_STATE, LastLightState); if ((LastLightState==LIGHT_ON)&&(LastDimValue==0)) { //In the case that the Light State = On, but the dimmer value is zero, //then something (probably the controller) did something wrong, //for the Dim value to 100% LastDimValue=100; gw.saveState(EPROM_DIMMER_LEVEL, LastDimValue); } //When receiving a V_LIGHT command we switch the light between OFF and the last received dimmer value //This means if you previously set the lights dimmer value to 50%, and turn the light ON //it will do so at 50% } else if (message.type == V_DIMMER) { Serial.println( "V_DIMMER command received..." ); int dimvalue= atoi( message.data ); if ((dimvalue<0)||(dimvalue>100)) { Serial.println( "V_DIMMER data invalid (should be 0..100)" ); return; } if (dimvalue==0) { LastLightState=LIGHT_OFF; LastDimValue=0; } else { LastLightState=LIGHT_ON; LastDimValue=dimvalue; gw.saveState(EPROM_DIMMER_LEVEL, LastDimValue); } } else { Serial.println( "Invalid command received..." ); return; } Serial.println( LastDimValue ); //Here you set the actual light state/level SetCurrentState2Hardware(); } static int currentLevel = 0; // Current dim level... void fadeToLevel( int toLevel ) { int delta = ( toLevel - currentLevel ) < 0 ? -1 : 1; while ( currentLevel != toLevel ) { currentLevel += delta; analogWrite( LED_PIN, (int)(currentLevel / 100. * 255) ); delay( FADE_DELAY ); } } void SetCurrentState2Hardware() { if (LastLightState==LIGHT_OFF) { Serial.println( "Light state: OFF" ); fadeToLevel(0); } else { Serial.print( "Light state: ON, Level: " ); Serial.println( LastDimValue ); fadeToLevel( LastDimValue ); } //Send current state to the controller SendCurrentState2Controller(); } void SendCurrentState2Controller() { if ((LastLightState==LIGHT_OFF)||(LastDimValue==0)) { gw.send(dimmerMsg.set(0)); } else { gw.send(dimmerMsg.set(LastDimValue)); } } void ResetTripped(){ sensordelay=0; FADE_DELAY=50; } void readTempHum() { delay(dht.getMinimumSamplingPeriod()); float temperature = dht.getTemperature(); if (isnan(temperature)) { Serial.println("Failed reading temperature from DHT"); } else if (temperature != lastTemp) { lastTemp = temperature; if (!metric) { temperature = dht.toFahrenheit(temperature); } gw.send(msgTemp.set(temperature, 1)); Serial.print("T: "); Serial.println(temperature); } float humidity = dht.getHumidity(); if (isnan(humidity)) { Serial.println("Failed reading humidity from DHT"); } else if (humidity != lastHum) { lastHum = humidity; gw.send(msgHum.set(humidity, 1)); Serial.print("H: "); Serial.println(humidity); } } void measureBattery() { // read the value at analog input value = analogRead(analogInput); vout = (value * 5.0) / 1024.0; // see text vin = vout / (R2/(R1+R2)); int batteryPcnt = value / 10; #ifdef DEBUG Serial.print("Battery Voltage: "); Serial.print(vin); Serial.println(" V"); Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %"); #endif if (oldBatteryPcnt != batteryPcnt) { // Power up radio after sleep gw.sendBatteryLevel(batteryPcnt); gw.send(msgVolt.set(vin, 1)); oldBatteryPcnt = batteryPcnt; } }
  • Weather/ wind display

    2
    5 Votes
    2 Posts
    2k Views
    scalzS
    @AWI excellent! I have something looking a bit like this!! I will show you soon, maybe that will give your some ideas ;) btw nice integration :)
  • "Weathercock" / weather comfort station

    11
    9 Votes
    11 Posts
    5k Views
    AWIA
    @AffordableTech will think about it... The weatherstation is a succes with everyone who sees it. I guess it bridges the gap between nerdy and the past. I will post a "techie" version in a few minutes. Basically has all the bells and whistles but less fun..
  • Solar powered observation nesting box network

    9
    5 Votes
    9 Posts
    3k Views
    OitzuO
    @hek thanks! :) I'm really happy with this article and this is great but i also hoped for a little more constructive criticism on the project.
  • 4 Votes
    6 Posts
    14k Views
    oscarcO
    @marekd Thank you, it does help : :+1:
  • 5 Votes
    17 Posts
    15k Views
    scalzS
    you can use .brd files to order at dirtypcb.
  • Hack Garage door keypad to change code with Vera

    3
    0 Votes
    3 Posts
    2k Views
    N
    Thanks, I will explore that as well.
  • Power/ Usage sensor - multi channel - local display

    41
    6 Votes
    41 Posts
    20k Views
    M
    @AWI Goodevening Oh better, we definitie have to de that. When does it suit you? Grtz
  • relay control by an Arduino board on Labview

    2
    0 Votes
    2 Posts
    2k Views
    mfalkviddM
    Hi @sagar-stoufa Welcome to the MySensors community! I am not sure I understand your question, but this example sketch shows how to send data between sensors https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/examples/PingPongSensor/PingPongSensor.ino
  • Office plan monitor (advice required)

    12
    4 Votes
    12 Posts
    4k Views
    carlierdC
    Hello, Last modification: [image: 1462288485642-2016-05-03-17.11.55.png] [image: 1462288493657-2016-05-03-17.14.09.png] I still have your make minor modification on marking and then go to production :) David.
  • Mailbox sensor (Arduino pro mini + NRF24L01+) Luup code?

    4
    0 Votes
    4 Posts
    2k Views
    hekH
    No I haven't moved to UI7 so I couldn't say.
  • 32 I2C Relay

    relay i2c pcf8574
    1
    1 Votes
    1 Posts
    2k Views
    No one has replied
  • My Small GateWay

    19
    1 Votes
    19 Posts
    12k Views
    masterkenobiM
    @C4Vette thanks! I can see more details is at http://www.mysensors.org/build/advanced_gateway
  • My PhD Project

    8
    2 Votes
    8 Posts
    3k Views
    mark_vennM
    @TheoL Hey Theo If you do get to come over some time, let me know and I will show you how my project is going in the test house. Assuming I get some where soon. I have been trying to get an Insteon hub working with openHAB and I have had so many problems, hence my looking for a different approach and looking at MySensors! Just waiting for my pro minis and radio boards to arrive then I can actually get somewhere. (I hope) Might have made a bad decision with my choice of 5v minis with step down regulators for the radio. Wasn't thinking of power for the boards themselves. What do you recommend I do to power 5v boards when there is no power locally?
  • Relay and light dimmer with light level in one node

    7
    0 Votes
    7 Posts
    3k Views
    J
    OK thanks everyone for help, this is code witch works very well: Only I must add the line where the light will be turn "off" when light level will be > 350 after 5 minutes. #include <SPI.h> #include <Encoder.h> #include <MySensor.h> #include <Bounce2.h> #include <DallasTemperature.h> #include <OneWire.h> #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No #define ONE_WIRE_BUS 19 // Pin where dallase sensor is connected #define MAX_ATTACHED_DS18B20 1 OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. #define LED_PIN 3 // Arduino pin attached to MOSFET Gate pin #define KNOB_ENC_PIN_1 4 // Rotary encoder input pin 1 #define KNOB_ENC_PIN_2 5 // Rotary encoder input pin 2 #define KNOB_BUTTON_PIN 6 // Rotary encoder button pin #define photoPin A6 // Fotorezystor #define FADE_DELAY 10 // Delay in ms for each percentage fade up/down (10ms = 1s full-range dim) #define SEND_THROTTLE_DELAY 400 // Number of milliseconds before sending after user stops turning knob #define SN "DimmableLED /w button" #define SV "1.2" #define CHILD_ID_LIGHT 16 #define ID 15 #define EEPROM_DIM_LEVEL_LAST 1 #define EEPROM_DIM_LEVEL_SAVE 2 #define LIGHT_OFF 0 #define LIGHT_ON 1 //WENT //#define WENT_RELAY_PIN 17 // Arduino Digital I/O pin number for relay //#define WENT_BUTTON_PIN 18 // Arduino Digital I/O pin number for button //#define CHILD_ID_WENT 17 // Id of the sensor child #define RELAY_ON 1 #define RELAY_OFF 0 #define noRelays 1 const int relayPin[] = {17}; // switch around pins to your desire const int buttonPin[] = {18}; // switch around pins to your desire class Relay // relay class, store all relevant data (equivalent to struct) { public: int buttonPin; // physical pin number of button int relayPin; // physical pin number of relay byte oldValue; // last Values for key (debounce) boolean relayState; // relay status (also stored in EEPROM) }; //END int dimValue; int fadeTo; int fadeDelta; int persons; byte oldButtonVal; bool changedByKnob=false; bool sendDimValue=false; unsigned long lastFadeStep; unsigned long sendDimTimeout; char convBuffer[10]; float lastTemperature[MAX_ATTACHED_DS18B20]; int numSensors=0; boolean receivedConfig = false; boolean metric = true; unsigned long on = 0; unsigned long onT = 0; MySensor gw; // Initialize temperature message MyMessage msg(0,V_TEMP); MyMessage dimmerMsg(CHILD_ID_LIGHT, V_DIMMER); MyMessage msgl(0, V_LIGHT_LEVEL); //WENT Relay Relays[noRelays]; Bounce debouncer1[noRelays]; MyMessage msg1[noRelays]; //END Encoder knob(KNOB_ENC_PIN_1, KNOB_ENC_PIN_2); Bounce debouncer = Bounce(); int lastLightLevel; void setup() { // The third argument enables repeater mode. // gw.begin(NULL, AUTO, true); //Send the sensor node sketch version information to the gateway // gw.sendSketchInfo("Repeater Node", "1.0"); // Set knob button pin as input (with debounce) pinMode(KNOB_BUTTON_PIN, INPUT); pinMode(photoPin, INPUT); digitalWrite(KNOB_BUTTON_PIN, HIGH); debouncer.attach(KNOB_BUTTON_PIN); debouncer.interval(5); oldButtonVal = debouncer.read(); // Set analog led pin to off analogWrite( LED_PIN, 0); // Init mysensors library gw.begin(incomingMessage, ID, true); // Send the Sketch Version Information to the Gateway gw.present(CHILD_ID_LIGHT, S_DIMMER); gw.sendSketchInfo(SN, SV); gw.sendSketchInfo("Repeater Node", "1.0"); // Retreive our last dim levels from the eprom fadeTo = dimValue = 0; byte oldLevel = 0; Serial.print("Sending in last known light level to controller: "); Serial.println(oldLevel); gw.send(dimmerMsg.set(oldLevel), true); Serial.println("Ready to receive messages..."); // Startup up the OneWire library sensors.begin(); // requestTemperatures() will not block current thread sensors.setWaitForConversion(false); // Fetch the number of attached temperature sensors numSensors = sensors.getDeviceCount(); // Present all sensors to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { gw.present(i, S_TEMP); } gw.present(15, S_LIGHT_LEVEL); //WENT gw.sendSketchInfo("MultiRelayButton", "0.9b"); delay(250); // Initialize Relays with corresponding buttons for (int i = 0; i < noRelays; i++){ Relays[i].buttonPin = buttonPin[i]; // assign physical pins Relays[i].relayPin = relayPin[i]; msg1[i].sensor = i; // initialize messages msg1[i].type = V_LIGHT; debouncer1[i] = Bounce(); // initialize debouncer debouncer1[i].attach(buttonPin[i]); debouncer1[i].interval(5); pinMode(Relays[i].buttonPin, INPUT_PULLUP); pinMode(Relays[i].relayPin, OUTPUT); Relays[i].relayState = gw.loadState(i); // retrieve last values from EEPROM digitalWrite(Relays[i].relayPin, Relays[i].relayState? RELAY_ON:RELAY_OFF); // and set relays accordingly gw.send(msg1[i].set(Relays[i].relayState? true : false)); // make controller aware of last status gw.present(i, S_LIGHT); // present sensor to gateway delay(250); } //END } void loop() { // Process incoming messages (like config and light state from controller) gw.process(); //WENT for (byte i = 0; i < noRelays; i++){ debouncer1[i].update(); byte value = debouncer1[i].read(); if (value != Relays[i].oldValue && value == 0){ Relays[i].relayState = !Relays[i].relayState; digitalWrite(Relays[i].relayPin, Relays[i].relayState?RELAY_ON:RELAY_OFF); gw.send(msg1[i].set(Relays[i].relayState? true : false)); gw.saveState( i, Relays[i].relayState );} // save sensor state in EEPROM (location == sensor number) Relays[i].oldValue = value; } //END // Sprawdzenie temperatury CheckTemp(); onT = onT + 1; on = on + 1; if (on > 401 + 2*ID) { // Poziom swiata lightLevel(); on = 0; } if (analogRead(photoPin) > 350) { persons = 0;} else {persons = 1;} // Check if someone has pressed the knob button checkButtonClick(); // Fade light to new dim value fadeStep(); } void lightLevel() { int lightLevel = (analogRead(photoPin)); Serial.println(lightLevel); if (lightLevel != lastLightLevel) { gw.send(msgl.set(lightLevel)); lastLightLevel = lightLevel; } } void CheckTemp() { // Fetch temperatures from Dallas sensors sensors.requestTemperatures(); // Read temperatures and send them to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { // Fetch and round temperature to one decimal float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.; // Only send data if temperature has changed and no error #if COMPARE_TEMP == 1 if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) { #else if (temperature != -127.00 && temperature != 85.00) { #endif if (onT > 400 + 2*ID) { // Send in the new temperature gw.send(msg.setSensor(i).set(temperature,1)); onT = 0; } // Save new temperatures for next compare lastTemperature[i]=temperature; } } } void incomingMessage(const MyMessage &message) {// if (message.sensor == 17){ //} else { if (analogRead(photoPin) > 350) { persons = 0;} else {persons = 1;} if (message.type == V_LIGHT && persons == 1 && message.sensor == 16) { // Incoming on/off command sent from controller ("1" or "0") int lightState = message.getString()[0] == '1'; int newLevel = 0; if (lightState==LIGHT_ON) { // Pick up last saved dimmer level from the eeprom newLevel = loadLevelState(EEPROM_DIM_LEVEL_SAVE); } // Send dimmer level back to controller with ack enabled gw.send(dimmerMsg.set(newLevel), true); // We do not change any levels here until ack comes back from gateway return; } else if (message.type == V_DIMMER && persons == 1 && message.sensor == 16) { // Incoming dim-level command sent from controller (or ack message) fadeTo = atoi(message.getString(convBuffer)); // Save received dim value to eeprom (unless turned off). Will be // retreived when a on command comes in if (fadeTo != 0) saveLevelState(EEPROM_DIM_LEVEL_SAVE, fadeTo); } if (persons == 1 && message.sensor == 16){ saveLevelState(EEPROM_DIM_LEVEL_LAST, fadeTo); Serial.print("New light level received: "); Serial.println(fadeTo); if (!changedByKnob) knob.write(fadeTo); // Cancel send if user turns knob while message comes in changedByKnob = false; sendDimValue = false; // Stard fading to new light level startFade(); } else if (persons == 0){ if (message.getString() != 0) {gw.send(dimmerMsg.set(0), true);} else {return;} } //WENT if (message.type == V_LIGHT){ if (message.sensor <noRelays){ // check if message is valid for relays..... previous line [[[ if (message.sensor <=noRelays){ ]]] Relays[message.sensor].relayState = message.getBool(); digitalWrite(Relays[message.sensor].relayPin, Relays[message.sensor].relayState? RELAY_ON:RELAY_OFF); // and set relays accordingly gw.saveState( message.sensor, Relays[message.sensor].relayState ); // save sensor state in EEPROM (location == sensor number) } } //END }//} void checkButtonClick() { if ( persons == 1 ) { debouncer.update(); byte buttonVal = debouncer.read(); byte newLevel = 0; if (buttonVal != oldButtonVal && buttonVal == LOW) { if (dimValue==0) { // Turn on light. Set the level to last saved dim value // int saved = loadLevelState(EEPROM_DIM_LEVEL_SAVE); int saved = 100; newLevel = saved > 0 ? saved : 100; } gw.send(dimmerMsg.set(newLevel),true); } oldButtonVal = buttonVal; } } void startFade() { fadeDelta = ( fadeTo - dimValue ) < 0 ? -1 : 1; lastFadeStep = millis(); } // This method provides a graceful none-blocking fade up/down effect void fadeStep() { unsigned long currentTime = millis(); if ( dimValue != fadeTo && currentTime > lastFadeStep + FADE_DELAY) { dimValue += fadeDelta; analogWrite( LED_PIN, (int)(dimValue / 100. * 255) ); lastFadeStep = currentTime; Serial.print("Fading level: "); Serial.println(dimValue); if (fadeTo == dimValue && changedByKnob) { sendDimValue = true; sendDimTimeout = currentTime; } } // Wait a few millisecs before sending in new value (if user still turns the knob) if (sendDimValue && currentTime > sendDimTimeout + SEND_THROTTLE_DELAY) { // We're done fading.. send in new dim-value to controller. // Send in new dim value with ack (will be picked up in incomingMessage) gw.send(dimmerMsg.set(dimValue), true); // Send new dimmer value and request ack back sendDimValue = false; } } // Make sure only to store/fetch values in the range 0-100 from eeprom int loadLevelState(byte pos) { return min(max(gw.loadState(pos),0),100); } void saveLevelState(byte pos, byte data) { gw.saveState(pos,min(max(data,0),100)); }
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    55 Views
    No one has replied

22

Online

11.7k

Users

11.2k

Topics

113.1k

Posts