Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. el tigro
    3. Topics
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by el tigro

    • el tigro

      HA not seeing sensors.
      Home Assistant • • el tigro  

      7
      0
      Votes
      7
      Posts
      1552
      Views

      el tigro

      SOLVED..... Such a mug, such a small error. One character missing in wireless key.
    • el tigro

      combining button with dht11 issue
      My Project • • el tigro  

      2
      0
      Votes
      2
      Posts
      1074
      Views

      el tigro

      sorted works a treat now. My bad, used a sketch I had tinkered with in the past. sketches melded now. Finished sketch below for them that might need. The sketch is for domestic light swith. #define MY_NODE_ID 5 #define MY_DEBUG #define MY_RADIO_NRF24 #include <SPI.h> #include <MySensors.h> #include <Bounce2.h> #include <DHT.h> #define DHT_DATA_PIN 7 #define CHILD_ID 3 #define BUTTON_PIN 3 #define SENSOR_TEMP_OFFSET 0 #define CHILD_ID_TEMP 1 Bounce debouncer = Bounce(); static const uint64_t UPDATE_INTERVAL = 5000; static const uint8_t FORCE_UPDATE_N_READS = 2; float lastTemp; unsigned long interval = 5000; unsigned long previousMillis = 0; uint8_t nNoUpdatesTemp; int oldValue = -1; bool metric = true; MyMessage msg(CHILD_ID, V_LIGHT); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); DHT dht; void presentation() { sendSketchInfo("kitchen Lights", "1.1"); present(CHILD_ID, S_LIGHT); present(CHILD_ID_TEMP, S_TEMP); metric = getConfig().isMetric; } void setup() { pinMode(BUTTON_PIN, INPUT); digitalWrite(BUTTON_PIN, HIGH); debouncer.attach(BUTTON_PIN); debouncer.interval(5); dht.setup(DHT_DATA_PIN); if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) { Serial.println("Warning: UPDATE_INTERVAL is smaller than supported by the sensor!"); } } void loop() { debouncer.update(); int value = debouncer.read(); if (value != oldValue) { send(msg.set(value == HIGH ? 1 : 0)); oldValue = value; } unsigned long currentMillis = millis(); if ((unsigned long)(currentMillis - previousMillis) >= interval) { dht.readSensor(true); float temperature = dht.getTemperature(); if (isnan(temperature)) { Serial.println("Failed reading temperature from DHT!"); } else if (temperature != lastTemp || nNoUpdatesTemp == FORCE_UPDATE_N_READS) { lastTemp = temperature; if (!metric) { temperature = dht.toFahrenheit(temperature); } nNoUpdatesTemp = 0; temperature += SENSOR_TEMP_OFFSET; send(msgTemp.set(temperature, 1)); #ifdef MY_DEBUG Serial.print("T: "); Serial.println(temperature); #endif } else { nNoUpdatesTemp++; } previousMillis = millis(); } }
    • el tigro

      A Basic domestic 240v light and switch.
      Development • • el tigro  

      8
      0
      Votes
      8
      Posts
      2642
      Views

      el tigro

      1485777547: Sending PINGRESP to mysensors-1 1485777562: Received PINGREQ from mysensors-1 1485777562: Sending PINGRESP to mysensors-1 1485777563: Received PUBLISH from mysensors-1 (d0, q0, r0, m0, 'mygateway1-out/5/25/1/0/16', ... (1 bytes)) 1485777563: Sending PUBLISH to home-assistant-1 (d0, q0, r0, m0, 'mygateway1-out/5/25/1/0/16', ... (1 bytes)) 1485777565: Received PUBLISH from mysensors-1 (d0, q0, r0, m0, 'mygateway1-out/5/25/1/0/16', ... (1 bytes)) 1485777565: Sending PUBLISH to home-assistant-1 (d0, q0, r0, m0, 'mygateway1-out/5/25/1/0/16', ... (1 bytes)) This is the mqtt log for one on / off cycle.
    • el tigro

      Struggling with configure.yaml
      Home Assistant • • el tigro  

      21
      0
      Votes
      21
      Posts
      9925
      Views

      el tigro

      Well, the sun shines on a dogs arse some days. We've only gone and done it, HA dash with relay sw. can controll led from dash. I honestly have sticky stuff running down my leg. You have no idea how happy I am. For future reference. I was flicking the power to reset pi in between config changes. My mosquitto was not starting from boot, so nothing to connect to, hence the errors when the code was right. Also reset your nodes after a change. This my yaml for the following setup nodes are arduino nanos with nrf2401+ radio. (mysensors 2.0) gateway is esp8266 NodeMCU 1.09. Wifi with NRF2401+ Pi 3 hosts Home Assistant and Mosquitto broker. Installed with All in one image. mysensors: gateways: - device: mqtt persistence_file: '/home/homeassistant/mysensors4.json' topic_in_prefix: 'mygateway1-out' topic_out_prefix: 'mygateway1-in' debug: true optimistic: false persistence: true retain: true version: 2.0 mqtt: broker: localhost port: 1883 client_id: home-assistant-1 keepalive: 60 Righty. I'm off to play. Be back very soon when i get stuck. Cheers for now fella, thank you for all your help.