Skip to content
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
Puneit ThukralP

Puneit Thukral

@Puneit Thukral
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store
About
Posts
90
Topics
7
Shares
0
Groups
0
Followers
1
Following
9

Posts

Recent Best Controversial

  • Where did everyone go?
    Puneit ThukralP Puneit Thukral

    I have said this before (I do not know where) but here it is again.
    One of the reasons that MySensors didn't become as popular as other frameworks is because it somewhat matured before YouTubers were popular. Today, fewer people like to read, and most like to watch a YouTube video sitting on the toilet. The YouTubers not only provide step by step instructions, they do live streams and then there are Discord servers.

    I myself manage a small discord server on Home Automation and I see everyday newbies coming in and they are looking for a magical cheap solution which somehow works.
    The barrier for entry into MySensors is big (involves a lot more wires, it does not seem sexy, no one talks about it on YouTube). On the other hand, everyone has an ISP given All-In-One router+AP+DHCP server and ESPs simply connect to them. Everyday Amazon, AliExpress etc are flooding the market with Wifi based products, so the time for feeling of gratification is very small. You buy, plug in, use the app and it works

    That said, we do have a dedicated MySensors channel on our discord server and I have been pushing (literally) people to try MySensors. Serious DIYers are still interested and I have successfully introduced 4 people to it, 2 have started using it.

    I won't call the Mysensors a stagnant or dying breed but the concept of forums in my opinion is. Forums are still the most structured support system (I am not saying otherwise) but many people want instant answers, - they do not want to make the effort asking a good question. And across many forums which have been there for a few years, a common answer is "search before you ask".

    This is my two cents on this topic

    General Discussion

  • Best password manager?
    Puneit ThukralP Puneit Thukral

    I moved from keepass to Bitwarden self hosted. For a while I used both in parallel and now I have fully moved to Bitwarden self hosted. It integrates very well with everything- iOS, Safari on Mac and other browsers

    General Discussion

  • Advisory: put IOT devices on a separate LAN/vLAN for better security
    Puneit ThukralP Puneit Thukral

    @NeverDie creating VLANs and restricting access of the IOT devices to must have access is the method I follow.

    General Discussion

  • [Answered] Any recommended load-and-go VM or Docker images for mysensors?
    Puneit ThukralP Puneit Thukral

    @jkandasa I am yet to use to Serial2Mqtt in order to test this out without breaking my current setup.. I will do it and share my feedback. I would definitely want to run Mycontroller in parallel to HA.

    Controllers

  • [Answered] Any recommended load-and-go VM or Docker images for mysensors?
    Puneit ThukralP Puneit Thukral

    @NeverDie MySensors via UI came in this release 2021.3. Prior to that it was through an entry (very simple one) in configuration.yaml.

    If you have cameras, 3D printer (running Klipper) - all that can come into HA. And Homekit via HA works great as well.

    Controllers

  • [Answered] Any recommended load-and-go VM or Docker images for mysensors?
    Puneit ThukralP Puneit Thukral

    @NeverDie VM install is one with the supervisor.. yes this is what I was referring to. VM is one of the supported methods, I guess

    Controllers

  • [Answered] Any recommended load-and-go VM or Docker images for mysensors?
    Puneit ThukralP Puneit Thukral

    @NeverDie While I never used proxmox or VM, I did use the supervised install on Linux and then moved away from it. The advantage of supervised install is that you get the addon store but the disadvantage is that Supervisors starts to complain and moan as you install more containers on the host system.
    It then stops you from upgrading to latest versions and prevents addons to be updated. At that stage I decided to move away from a supervised install.

    Controllers

  • 💬 Capacitive Soil Moisture Sensor
    Puneit ThukralP Puneit Thukral

    @Ron @Anticimex The radio stops at 1.9V.. so I think its fair to do a BOD of 1.8V.

    I used arduinoAsISP to burn bootloader and this is my platformio.ini

    [env:program_via_ArduinoISP]
    platform = atmelavr
    framework = arduino
    ;  Serial bootloader protocol
    upload_protocol = custom
    ; Serial upload port
    upload_port = /dev/cu.*
    ; Get upload baud rate defined in the fuses_bootloader environment
    upload_speed = 19200
    board_build.f_cpu = 8000000L
    board_hardware.oscillator = internal
    board_hardware.uart = uart0
    board_hardware.bod = 1.8v
    board_hardware.eesave = yes
    board_hardware.ckout = no
    upload_flags =
        -C
        ; use "tool-avrdude-megaavr" for the atmelmegaavr platform
        /Users/puneit/Nextcloud/PlatformIO/bootloader/tool-avrdude/avrdude2.conf
        -p
        $BOARD_MCU
        -P
        $UPLOAD_PORT
        -b
        $UPLOAD_SPEED
        -c
        stk500
    upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
    
    OpenHardware.io mysensors soil moisture capacitive soil moisture nrf24l01+ atmega328p

  • [Answered] Any recommended load-and-go VM or Docker images for mysensors?
    Puneit ThukralP Puneit Thukral

    @ncollins Yes, it is very easy to (re)deploy a whole system using the docker compose files.
    I have 4 splits --- one being my core containers , Homeassistant, Nodered, Mosquitto, etc and then one of them being "applications that I don't need but have".. I recently had to redeploy and my core stack was running in under 10 minutes..

    It is a very powerful tool.

    Controllers

  • 💬 Capacitive Soil Moisture Sensor
    Puneit ThukralP Puneit Thukral

    Hi great design... If I can suggest one improvement, it would be to burn a minicore bootloader and set BOD to 1.8V so that the batteries can last longer.

    OpenHardware.io mysensors soil moisture capacitive soil moisture nrf24l01+ atmega328p

  • [Answered] Any recommended load-and-go VM or Docker images for mysensors?
    Puneit ThukralP Puneit Thukral

    Home assistant has a docker container which talks nicely with a mysensors serial gateway connected via USB on a Dell machine.

     homeassistant:
        container_name: hass
        image: homeassistant/home-assistant:stable
        volumes:
          - /home/server/homeassistant/:/config
          - /etc/localtime:/etc/localtime:ro
          - /var/run/docker.sock:/var/run/docker.sock
        restart: unless-stopped
        devices:
          - /dev/ttyUSB0:/dev/ttyUSB0:rwm
        healthcheck:
          test: ["CMD", "curl", "-f", "http://127.0.0.1:8123"]
          interval: 30s
          timeout: 10s
          retries: 6
        network_mode: host
        depends_on: 
          - mosquitto
    

    the following line enables serial gateway into HA and then in the latest release 2021.3 one can add Mysensors from UI

    devices:
          - /dev/ttyUSB0:/dev/ttyUSB0:rwm
    
    Controllers

  • GUIDE - NRF5 / NRF51 / NRF52 for beginners
    Puneit ThukralP Puneit Thukral

    @monte Could you please share the custom sleep function?

    Development

  • Your suggestions to choose naming for "sensor" and "variable"
    Puneit ThukralP Puneit Thukral

    Hello @jkandasa
    This is looking very good. Nomenclarture wise - I am of the opnion that users adapt but if you ask me I like sensor over element (but I can live with element as well).

    In future will it be possible port this to mobile apps for iOS and Android?

    One integration I would request is for HomeKit.

    Thank you

    MyController.org mycontroller.org mycontroller

  • GUIDE - NRF5 / NRF51 / NRF52 for beginners
    Puneit ThukralP Puneit Thukral

    @ncollins It is possible to use NRF51822 for gateways with serial. I am using it for many months now. We need USB to serial adapter.
    Also, I do not use JLink or ST-Link for flashing the NRF51 chips. I use raspberry pi with OpenOCD.
    OpenOCD setup can be overwhelming (it was for me) but I have been able to make it work and replicate for a while now. If someone needs inputs, I am happy to help. Ask here or reach out to me on discord @ Puneit#2433

    For the very reason you stated - hardware bugs in NR51 chips leading to high power-consumption - they make compact repeater nodes / powered nodes with repeaters.

    Development

  • cant add two relays in the Home assistant
    Puneit ThukralP Puneit Thukral

    Hello
    It could be a case of presentation being done too fast. Add a wait(50) like this

     // Present all relays to controller
      for (int sensor=CHILD_ID_RELAY, pin=RELAY_1; sensor<CHILD_ID_RELAY+NUMBER_OF_RELAYS;sensor++, pin++) {
        // Register all sensors to gw (they will be created as child devices)
        present(sensor, S_LIGHT);
         wait( 50 ); // <--- byTheo
    
    Troubleshooting

  • 💬 Battery Powered Sensors
    Puneit ThukralP Puneit Thukral

    Adding on to this.. If we use a map function to convert the battery level like this, then it shows up as an attribute in HomeAssistant and Homekit

    Map function works and not the percent. The percent always shows as zero in Homekit.
    Hope this helps someone!

    void battery()
    {
      long batteryMillivolts = hwCPUVoltage();
      int batteryV =batteryMillivolts /1000 + 0.5;
      auto batteryLevel = map(batteryV,EMPTY_BATTERY, FULL_BATTERY, 0, 100);
      if (batteryLevel > 100) 
      {batteryLevel=100;}
    
    #ifdef MY_DEBUG
      Serial.print("Battery voltage: ");
      Serial.print(batteryMillivolts / 1000.0);
      Serial.println("V");
      Serial.print("Battery Level ");
      Serial.print(batteryLevel);
      Serial.println(" %");
    #endif
    
      if (oldBatteryLevel != batteryLevel) {
        sendBatteryLevel(batteryLevel);
        send(msgV.set(batteryV,2));
        oldBatteryLevel = batteryLevel;
      }
    }
    

    ![Home Assistant](812c9e02-8b21-44dc-ab8d-04559bf38462-image.png image url)

    IHomeKit

    Announcements battery

  • Nrf5x on NodeManager
    Puneit ThukralP Puneit Thukral

    @Francisco_Elias Not using node manager but this sketch. See if it helps you

    //#define MY_DEBUG //Debug Disabled in production
    #define MY_RADIO_NRF5_ESB
    //#define MY_NODE_ID 10 // change this for every node
    #define SKETCH_NAME "Door Sensor" // this can be changed as well
    #define SKETCH_VERSION "V1"
    #define MY_SMART_SLEEP_WAIT_DURATION 500 //activate smart sleep
    #define MY_SLEEP_TRANSPORT_RECONNECT_TIMEOUT_MS  10000 //wait for 10 seconds to reconnect in case of transport problems
    #define MY_TRANSPORT_WAIT_READY_MS 30000  //try connecting for 30 seconds
    //#define MY_PARENT_NODE_ID 0
    //#define MY_PARENT_NODE_IS_STATIC
    
    
    
    #define DIGITAL_INPUT_SENSOR 2       // The digital input you attached your Door/Window sensor.
    #define CHILD_ID_DOOR 1            // Id of the door/window sensor child.
    #define CHILD_ID_BATTERY 254      // ID of the battery sensor
    #define BATTERY_FULL          3    // 
    #define BATTERY_EMPTY         1.8    // NRF51822 does not work below 1.8V
    float BATTERY_FULL_PCNT=100;    // 
    float BATTERY_EMPTY_PCNT=0;    // NRF51822 does not work below 1.8V
    #include <MySensors.h>
    
    
    
    #ifdef MY_DEBUG
    uint32_t SLEEP_TIME = 30000; // when debugging, sleep time is 30 seconds
    #endif
    #ifndef MY_DEBUG
    
      uint32_t SLEEP_TIME = 60000 * 1440 ; // when deployed, sleep time is 30 minutes
    #endif
    
    #define SHORT_WAIT 500  
    
    bool oldValueDoor = -1;
    float batteryVoltage = 0;
    //bool tripped=2;
    // Initialize door/window message
    MyMessage msgDoor(CHILD_ID_DOOR, V_TRIPPED); //Door/Window.
    
    MyMessage msgBattery(CHILD_ID_BATTERY, V_VOLTAGE);
    int batteryPcnt=-1;
    void setup()
    {
    
      pinMode(DIGITAL_INPUT_SENSOR, INPUT_PULLUP);  // sets the door/window sensor digital pin as input
      digitalWrite(DIGITAL_INPUT_SENSOR, HIGH);
    }
    void presentation()
    {
    
      sendSketchInfo(SKETCH_NAME, SKETCH_VERSION);
    
      present(CHILD_ID_DOOR, S_DOOR, "Door");
      wait(SHORT_WAIT);
      present(CHILD_ID_BATTERY, S_MULTIMETER, "DoorBatt");
    
    }
    
    void loop()
    {
      
      bool tripped = digitalRead(DIGITAL_INPUT_SENSOR)==HIGH;
    
      if (tripped != oldValueDoor)
      {
    
    
        send(msgDoor.set(tripped ? "1" : "0"), true); // Send door/window tripped value to gw
    
        oldValueDoor = tripped;
      }
       
    
        batteryVoltage = ((float)hwCPUVoltage()) / 1000.0;
        
        send(msgBattery.set(batteryVoltage, 2)); //this creates a voltage sensor
        batteryPcnt = round((batteryVoltage - BATTERY_EMPTY) *100.0 / (BATTERY_FULL - BATTERY_EMPTY));
        if (batteryPcnt > 100) {batteryPcnt = 100;}
       if (batteryPcnt <= 0) {batteryPcnt = 0;} 
        sendBatteryLevel(batteryPcnt, true); // this adds attribute to the door sensor
        sendHeartbeat();
            batteryPcnt=0;
    
        smartSleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
        
    
    }
    
    NodeManager

  • Ds18b20/ nodemcu fluctuations in temp
    Puneit ThukralP Puneit Thukral

    @mjdula
    This is not a support forum for Tasmota. You should try their Discord

    Hardware temperature node esp82 ds18b20

  • Question about MySensors features
    Puneit ThukralP Puneit Thukral

    @IronFelix
    I would not combine so many inputs and outputs in one sketch. But I think if there is enough memory for variables ; then it is possible to go for sensing (step by step) for a combination of sensors.
    Similarly for buttons, actuators, use a separate hardware.

    My Project beginner sensor features
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular